mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-11-22 07:13:28 +01:00
commit
f5205c3263
164 changed files with 2572 additions and 1869 deletions
|
@ -1,5 +0,0 @@
|
|||
Textures to be made
|
||||
--------------------------------------------------------------------------------------------------------------
|
||||
This file is a reminder to Glenthor for what textures he should make or change.
|
||||
If you want to give making some of these textures a go, go ahead and make a pull request when you're done.
|
||||
--------------------------------------------------------------------------------------------------------------
|
12
build.gradle
12
build.gradle
|
@ -12,12 +12,12 @@ buildscript {
|
|||
}
|
||||
apply plugin: 'net.minecraftforge.gradle.forge'
|
||||
|
||||
version = "1.8.9-r23"
|
||||
version = "1.8.9-r25"
|
||||
group = "de.ellpeck.actuallyadditions"
|
||||
archivesBaseName = "ActuallyAdditions"
|
||||
|
||||
minecraft {
|
||||
version = "1.8.9-11.15.0.1697"
|
||||
version = "1.8.9-11.15.1.1732"
|
||||
runDir = "idea"
|
||||
|
||||
mappings = "stable_20"
|
||||
|
@ -38,11 +38,11 @@ repositories {
|
|||
}
|
||||
|
||||
dependencies {
|
||||
compile "codechicken:CodeChickenLib:1.8-1.1.2.139:dev"
|
||||
compile "codechicken:CodeChickenCore:1.8-1.0.5.36:dev"
|
||||
compile "codechicken:NotEnoughItems:1.8-1.0.5.104:dev"
|
||||
//compile "codechicken:CodeChickenLib:1.8-1.1.2.139:dev"
|
||||
//compile "codechicken:CodeChickenCore:1.8-1.0.5.36:dev"
|
||||
//compile "codechicken:NotEnoughItems:1.8-1.0.5.104:dev"
|
||||
|
||||
deobfCompile "mezz.jei:jei_1.8.9:2.18.1.88"
|
||||
deobfCompile "mezz.jei:jei_1.8.9:2.25.6.140"
|
||||
}
|
||||
|
||||
processResources {
|
||||
|
|
|
@ -12,7 +12,6 @@ package de.ellpeck.actuallyadditions.api;
|
|||
|
||||
import de.ellpeck.actuallyadditions.api.booklet.BookletPage;
|
||||
import de.ellpeck.actuallyadditions.api.booklet.IBookletEntry;
|
||||
import de.ellpeck.actuallyadditions.api.lens.Lens;
|
||||
import de.ellpeck.actuallyadditions.api.recipe.BallOfFurReturn;
|
||||
import de.ellpeck.actuallyadditions.api.recipe.CrusherRecipe;
|
||||
import de.ellpeck.actuallyadditions.api.recipe.LensNoneRecipe;
|
||||
|
@ -28,12 +27,11 @@ public class ActuallyAdditionsAPI{
|
|||
|
||||
public static final String MOD_ID = "ActuallyAdditions";
|
||||
public static final String API_ID = MOD_ID+"API";
|
||||
public static final String API_VERSION = "7";
|
||||
public static final String API_VERSION = "8";
|
||||
|
||||
public static List<CrusherRecipe> crusherRecipes = new ArrayList<CrusherRecipe>();
|
||||
public static List<BallOfFurReturn> ballOfFurReturnItems = new ArrayList<BallOfFurReturn>();
|
||||
public static List<TreasureChestLoot> treasureChestLoot = new ArrayList<TreasureChestLoot>();
|
||||
public static List<Lens> reconstructorLenses = new ArrayList<Lens>();
|
||||
public static List<LensNoneRecipe> reconstructorLensNoneRecipes = new ArrayList<LensNoneRecipe>();
|
||||
public static List<CoffeeIngredient> coffeeMachineIngredients = new ArrayList<CoffeeIngredient>();
|
||||
|
||||
|
|
|
@ -16,14 +16,14 @@ public interface IBookletEntry{
|
|||
|
||||
List<IBookletChapter> getChapters();
|
||||
|
||||
void setChapters(List<IBookletChapter> chapters);
|
||||
|
||||
String getUnlocalizedName();
|
||||
|
||||
String getLocalizedName();
|
||||
|
||||
String getLocalizedNameWithFormatting();
|
||||
|
||||
void setChapters(List<IBookletChapter> chapters);
|
||||
|
||||
void addChapter(IBookletChapter chapter);
|
||||
|
||||
}
|
||||
|
|
|
@ -31,13 +31,6 @@ public class EntrySet{
|
|||
this.setEntry(page, chapter, entry, pageInIndex);
|
||||
}
|
||||
|
||||
public void setEntry(BookletPage page, IBookletChapter chapter, IBookletEntry entry, int pageInIndex){
|
||||
this.page = page;
|
||||
this.chapter = chapter;
|
||||
this.entry = entry;
|
||||
this.pageInIndex = pageInIndex;
|
||||
}
|
||||
|
||||
public static EntrySet readFromNBT(NBTTagCompound compound){
|
||||
if(compound != null){
|
||||
if(compound.hasKey("Entry")){
|
||||
|
@ -56,6 +49,13 @@ public class EntrySet{
|
|||
return new EntrySet(null);
|
||||
}
|
||||
|
||||
public void setEntry(BookletPage page, IBookletChapter chapter, IBookletEntry entry, int pageInIndex){
|
||||
this.page = page;
|
||||
this.chapter = chapter;
|
||||
this.entry = entry;
|
||||
this.pageInIndex = pageInIndex;
|
||||
}
|
||||
|
||||
public void removeEntry(){
|
||||
this.setEntry(null, null, null, 1);
|
||||
}
|
||||
|
|
|
@ -10,7 +10,6 @@
|
|||
|
||||
package de.ellpeck.actuallyadditions.api.lens;
|
||||
|
||||
import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI;
|
||||
import de.ellpeck.actuallyadditions.api.internal.IAtomicReconstructor;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.util.BlockPos;
|
||||
|
@ -28,8 +27,9 @@ public abstract class Lens{
|
|||
|
||||
/**
|
||||
* Invokes the lens type's behavior on a block
|
||||
*
|
||||
* @param hitBlock The block that was hit
|
||||
* @param tile The tile the lens was invoked from
|
||||
* @param tile The tile the lens was invoked from
|
||||
* @return If the Reconstructor should stop continuing (return false if you want it to go through blocks)
|
||||
*/
|
||||
public abstract boolean invoke(BlockPos hitBlock, IAtomicReconstructor tile);
|
||||
|
@ -44,14 +44,6 @@ public abstract class Lens{
|
|||
*/
|
||||
public abstract int getDistance();
|
||||
|
||||
/**
|
||||
* Registers the lense type
|
||||
*/
|
||||
public Lens register(){
|
||||
ActuallyAdditionsAPI.reconstructorLenses.add(this);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the item corresponding to the lense
|
||||
*/
|
||||
|
|
|
@ -18,6 +18,7 @@ import de.ellpeck.actuallyadditions.mod.crafting.CrusherCrafting;
|
|||
import de.ellpeck.actuallyadditions.mod.crafting.InitCrafting;
|
||||
import de.ellpeck.actuallyadditions.mod.crafting.ItemCrafting;
|
||||
import de.ellpeck.actuallyadditions.mod.event.InitEvents;
|
||||
import de.ellpeck.actuallyadditions.mod.fluids.InitFluids;
|
||||
import de.ellpeck.actuallyadditions.mod.gen.InitVillager;
|
||||
import de.ellpeck.actuallyadditions.mod.gen.OreGen;
|
||||
import de.ellpeck.actuallyadditions.mod.inventory.GuiHandler;
|
||||
|
@ -68,6 +69,7 @@ public class ActuallyAdditions{
|
|||
InitToolMaterials.init();
|
||||
InitArmorMaterials.init();
|
||||
InitBlocks.init();
|
||||
InitFluids.init();
|
||||
InitItems.init();
|
||||
FuelHandler.init();
|
||||
UpdateChecker.init();
|
||||
|
|
|
@ -12,11 +12,10 @@ package de.ellpeck.actuallyadditions.mod.blocks;
|
|||
|
||||
import de.ellpeck.actuallyadditions.api.lens.ILensItem;
|
||||
import de.ellpeck.actuallyadditions.mod.blocks.base.BlockContainerBase;
|
||||
import de.ellpeck.actuallyadditions.mod.blocks.base.ItemBlockBase;
|
||||
import de.ellpeck.actuallyadditions.mod.tile.TileEntityAtomicReconstructor;
|
||||
import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
|
||||
import de.ellpeck.actuallyadditions.mod.util.ModUtil;
|
||||
import de.ellpeck.actuallyadditions.mod.util.PosUtil;
|
||||
import de.ellpeck.actuallyadditions.mod.util.StringUtil;
|
||||
import de.ellpeck.actuallyadditions.mod.util.*;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockPistonBase;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.properties.PropertyInteger;
|
||||
|
@ -37,8 +36,12 @@ import net.minecraft.world.World;
|
|||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class BlockAtomicReconstructor extends BlockContainerBase implements IHudDisplay{
|
||||
|
||||
public static final int NAME_FLAVOR_AMOUNTS_1 = 12;
|
||||
public static final int NAME_FLAVOR_AMOUNTS_2 = 14;
|
||||
private static final PropertyInteger META = PropertyInteger.create("meta", 0, 5);
|
||||
|
||||
public BlockAtomicReconstructor(String name){
|
||||
|
@ -49,24 +52,6 @@ public class BlockAtomicReconstructor extends BlockContainerBase implements IHud
|
|||
this.setStepSound(soundTypeStone);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected PropertyInteger getMetaProperty(){
|
||||
return META;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumRarity getRarity(ItemStack stack){
|
||||
return EnumRarity.EPIC;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockPlacedBy(World world, BlockPos pos, IBlockState state, EntityLivingBase player, ItemStack stack){
|
||||
int rotation = BlockPistonBase.getFacingFromEntity(world, pos, player).ordinal();
|
||||
PosUtil.setMetadata(pos, world, rotation, 2);
|
||||
|
||||
super.onBlockPlacedBy(world, pos, state, player, stack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube(){
|
||||
return false;
|
||||
|
@ -129,4 +114,64 @@ public class BlockAtomicReconstructor extends BlockContainerBase implements IHud
|
|||
minecraft.fontRendererObj.drawStringWithShadow(EnumChatFormatting.YELLOW+""+EnumChatFormatting.ITALIC+strg, resolution.getScaledWidth()/2+35, resolution.getScaledHeight()/2-25, StringUtil.DECIMAL_COLOR_WHITE);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Class<? extends ItemBlockBase> getItemBlock(){
|
||||
return TheItemBlock.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumRarity getRarity(ItemStack stack){
|
||||
return EnumRarity.EPIC;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockPlacedBy(World world, BlockPos pos, IBlockState state, EntityLivingBase player, ItemStack stack){
|
||||
int rotation = BlockPistonBase.getFacingFromEntity(world, pos, player).ordinal();
|
||||
PosUtil.setMetadata(pos, world, rotation, 2);
|
||||
|
||||
super.onBlockPlacedBy(world, pos, state, player, stack);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected PropertyInteger getMetaProperty(){
|
||||
return META;
|
||||
}
|
||||
|
||||
public static class TheItemBlock extends ItemBlockBase{
|
||||
|
||||
private long lastSysTime;
|
||||
private int toPick1;
|
||||
private int toPick2;
|
||||
|
||||
public TheItemBlock(Block block){
|
||||
super(block);
|
||||
this.setHasSubtypes(false);
|
||||
this.setMaxDamage(0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName(ItemStack stack){
|
||||
return this.getUnlocalizedName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetadata(int damage){
|
||||
return damage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List<String> list, boolean bool){
|
||||
long sysTime = System.currentTimeMillis();
|
||||
|
||||
if(this.lastSysTime+3000 < sysTime){
|
||||
this.lastSysTime = sysTime;
|
||||
this.toPick1 = Util.RANDOM.nextInt(NAME_FLAVOR_AMOUNTS_1)+1;
|
||||
this.toPick2 = Util.RANDOM.nextInt(NAME_FLAVOR_AMOUNTS_2)+1;
|
||||
}
|
||||
|
||||
String base = "tile."+ModUtil.MOD_ID_LOWER+"."+((BlockAtomicReconstructor)this.block).getBaseName()+".info.";
|
||||
list.add(StringUtil.localize(base+"1."+this.toPick1)+" "+StringUtil.localize(base+"2."+this.toPick2));
|
||||
}
|
||||
}
|
||||
}
|
|
@ -31,8 +31,8 @@ import net.minecraft.world.World;
|
|||
|
||||
public class BlockBreaker extends BlockContainerBase{
|
||||
|
||||
private boolean isPlacer;
|
||||
private static final PropertyInteger META = PropertyInteger.create("meta", 0, 5);
|
||||
private boolean isPlacer;
|
||||
|
||||
public BlockBreaker(boolean isPlacer, String name){
|
||||
super(Material.rock, name);
|
||||
|
@ -43,11 +43,6 @@ public class BlockBreaker extends BlockContainerBase{
|
|||
this.setStepSound(soundTypeStone);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected PropertyInteger getMetaProperty(){
|
||||
return META;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int par2){
|
||||
return this.isPlacer ? new TileEntityBreaker.TileEntityPlacer() : new TileEntityBreaker();
|
||||
|
@ -81,6 +76,11 @@ public class BlockBreaker extends BlockContainerBase{
|
|||
super.onBlockPlacedBy(world, pos, state, player, stack);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected PropertyInteger getMetaProperty(){
|
||||
return META;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock(World world, BlockPos pos, IBlockState state){
|
||||
this.dropInventory(world, pos);
|
||||
|
|
|
@ -46,11 +46,6 @@ public class BlockCoalGenerator extends BlockContainerBase{
|
|||
this.setTickRandomly(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected PropertyInteger getMetaProperty(){
|
||||
return META;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int par2){
|
||||
return new TileEntityCoalGenerator();
|
||||
|
@ -85,6 +80,11 @@ public class BlockCoalGenerator extends BlockContainerBase{
|
|||
return EnumRarity.RARE;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected PropertyInteger getMetaProperty(){
|
||||
return META;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock(World world, BlockPos pos, IBlockState state){
|
||||
this.dropInventory(world, pos);
|
||||
|
|
|
@ -39,14 +39,13 @@ public class BlockCoffeeMachine extends BlockContainerBase{
|
|||
this.setResistance(10.0F);
|
||||
this.setStepSound(soundTypeStone);
|
||||
|
||||
//TODO Fix bounding box
|
||||
//float f = 1/16F;
|
||||
//this.setBlockBounds(f, 0F, f, 1F-f, 1F-2*f, 1F-f);
|
||||
float f = 1/16F;
|
||||
this.setBlockBounds(f, 0F, f, 1F-f, 1F-2*f, 1F-f);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected PropertyInteger getMetaProperty(){
|
||||
return META;
|
||||
public boolean isFullCube(){
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -101,4 +100,9 @@ public class BlockCoffeeMachine extends BlockContainerBase{
|
|||
|
||||
super.onBlockPlacedBy(world, pos, state, player, stack);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected PropertyInteger getMetaProperty(){
|
||||
return META;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -53,11 +53,6 @@ public class BlockColoredLamp extends BlockBase{
|
|||
this.isOn = isOn;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected PropertyInteger getMetaProperty(){
|
||||
return META;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItemDropped(IBlockState state, Random rand, int par3){
|
||||
return Item.getItemFromBlock(InitBlocks.blockColoredLamp);
|
||||
|
@ -133,11 +128,6 @@ public class BlockColoredLamp extends BlockBase{
|
|||
return TheItemBlock.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumRarity getRarity(ItemStack stack){
|
||||
return EnumRarity.RARE;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void registerRendering(){
|
||||
ResourceLocation[] resLocs = new ResourceLocation[allLampTypes.length];
|
||||
|
@ -149,6 +139,15 @@ public class BlockColoredLamp extends BlockBase{
|
|||
ActuallyAdditions.proxy.addRenderVariant(Item.getItemFromBlock(this), resLocs);
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumRarity getRarity(ItemStack stack){
|
||||
return EnumRarity.RARE;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected PropertyInteger getMetaProperty(){
|
||||
return META;
|
||||
}
|
||||
|
||||
public static class TheItemBlock extends ItemBlockBase{
|
||||
|
||||
|
|
|
@ -83,7 +83,7 @@ public class BlockCompost extends BlockContainerBase implements IHudDisplay{
|
|||
if(!player.capabilities.isCreativeMode){
|
||||
player.inventory.getCurrentItem().stackSize--;
|
||||
}
|
||||
tile.sendUpdate();
|
||||
tile.markDirty();
|
||||
}
|
||||
|
||||
//Add Fertilizer to player's inventory
|
||||
|
@ -95,7 +95,7 @@ public class BlockCompost extends BlockContainerBase implements IHudDisplay{
|
|||
player.getCurrentEquippedItem().stackSize += tile.slots[0].stackSize;
|
||||
}
|
||||
tile.slots[0] = null;
|
||||
tile.sendUpdate();
|
||||
tile.markDirty();
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
|
|
@ -42,11 +42,6 @@ public class BlockCrystal extends BlockBase{
|
|||
this.setHarvestLevel("pickaxe", 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected PropertyInteger getMetaProperty(){
|
||||
return META;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int damageDropped(IBlockState state){
|
||||
return this.getMetaFromState(state);
|
||||
|
@ -65,11 +60,6 @@ public class BlockCrystal extends BlockBase{
|
|||
return TheItemBlock.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumRarity getRarity(ItemStack stack){
|
||||
return stack.getItemDamage() >= allCrystals.length ? EnumRarity.COMMON : allCrystals[stack.getItemDamage()].rarity;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void registerRendering(){
|
||||
ResourceLocation[] resLocs = new ResourceLocation[allCrystals.length];
|
||||
|
@ -81,6 +71,16 @@ public class BlockCrystal extends BlockBase{
|
|||
ActuallyAdditions.proxy.addRenderVariant(Item.getItemFromBlock(this), resLocs);
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumRarity getRarity(ItemStack stack){
|
||||
return stack.getItemDamage() >= allCrystals.length ? EnumRarity.COMMON : allCrystals[stack.getItemDamage()].rarity;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected PropertyInteger getMetaProperty(){
|
||||
return META;
|
||||
}
|
||||
|
||||
public static class TheItemBlock extends ItemBlockBase{
|
||||
|
||||
public TheItemBlock(Block block){
|
||||
|
|
|
@ -41,11 +41,6 @@ public class BlockDirectionalBreaker extends BlockContainerBase{
|
|||
this.setStepSound(soundTypeStone);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected PropertyInteger getMetaProperty(){
|
||||
return META;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int par2){
|
||||
return new TileEntityDirectionalBreaker();
|
||||
|
@ -79,6 +74,11 @@ public class BlockDirectionalBreaker extends BlockContainerBase{
|
|||
super.onBlockPlacedBy(world, pos, state, player, stack);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected PropertyInteger getMetaProperty(){
|
||||
return META;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock(World world, BlockPos pos, IBlockState state){
|
||||
this.dropInventory(world, pos);
|
||||
|
|
|
@ -39,10 +39,6 @@ public class BlockDropper extends BlockContainerBase{
|
|||
this.setResistance(10.0F);
|
||||
this.setStepSound(soundTypeStone);
|
||||
}
|
||||
@Override
|
||||
protected PropertyInteger getMetaProperty(){
|
||||
return META;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int par2){
|
||||
|
@ -77,6 +73,11 @@ public class BlockDropper extends BlockContainerBase{
|
|||
super.onBlockPlacedBy(world, pos, state, player, stack);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected PropertyInteger getMetaProperty(){
|
||||
return META;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock(World world, BlockPos pos, IBlockState state){
|
||||
this.dropInventory(world, pos);
|
||||
|
|
|
@ -34,6 +34,11 @@ public class BlockFishingNet extends BlockContainerBase{
|
|||
return new TileEntityFishingNet();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFullCube(){
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube(){
|
||||
return false;
|
||||
|
|
|
@ -44,11 +44,6 @@ public class BlockFluidCollector extends BlockContainerBase{
|
|||
this.setStepSound(soundTypeStone);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected PropertyInteger getMetaProperty(){
|
||||
return META;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int par2){
|
||||
return this.isPlacer ? new TileEntityFluidCollector.TileEntityFluidPlacer() : new TileEntityFluidCollector();
|
||||
|
@ -82,6 +77,11 @@ public class BlockFluidCollector extends BlockContainerBase{
|
|||
super.onBlockPlacedBy(world, pos, state, player, stack);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected PropertyInteger getMetaProperty(){
|
||||
return META;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock(World world, BlockPos pos, IBlockState state){
|
||||
this.dropInventory(world, pos);
|
||||
|
|
|
@ -48,11 +48,6 @@ public class BlockFurnaceDouble extends BlockContainerBase{
|
|||
this.setTickRandomly(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected PropertyInteger getMetaProperty(){
|
||||
return META;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int par2){
|
||||
return new TileEntityFurnaceDouble();
|
||||
|
@ -135,6 +130,11 @@ public class BlockFurnaceDouble extends BlockContainerBase{
|
|||
super.onBlockPlacedBy(world, pos, state, player, stack);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected PropertyInteger getMetaProperty(){
|
||||
return META;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock(World world, BlockPos pos, IBlockState state){
|
||||
this.dropInventory(world, pos);
|
||||
|
|
|
@ -34,6 +34,11 @@ public class BlockFurnaceSolar extends BlockContainerBase{
|
|||
return new TileEntityFurnaceSolar();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFullCube(){
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube(){
|
||||
return false;
|
||||
|
|
|
@ -36,22 +36,31 @@ public class BlockGreenhouseGlass extends BlockContainerBase{
|
|||
this.setStepSound(soundTypeStone);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public EnumWorldBlockLayer getBlockLayer(){
|
||||
return EnumWorldBlockLayer.CUTOUT;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFullCube(){
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean shouldSideBeRendered(IBlockAccess worldIn, BlockPos pos, EnumFacing side){
|
||||
IBlockState state = worldIn.getBlockState(pos);
|
||||
Block block = state.getBlock();
|
||||
return worldIn.getBlockState(pos.offset(side.getOpposite())) != state || block != this && block != this && super.shouldSideBeRendered(worldIn, pos, side);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube(){
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public EnumWorldBlockLayer getBlockLayer(){
|
||||
return EnumWorldBlockLayer.CUTOUT;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumRarity getRarity(ItemStack stack){
|
||||
return EnumRarity.EPIC;
|
||||
|
@ -61,13 +70,4 @@ public class BlockGreenhouseGlass extends BlockContainerBase{
|
|||
public TileEntity createNewTileEntity(World world, int par2){
|
||||
return new TileEntityGreenhouseGlass();
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean shouldSideBeRendered(IBlockAccess worldIn, BlockPos pos, EnumFacing side){
|
||||
IBlockState state = worldIn.getBlockState(pos);
|
||||
Block block = state.getBlock();
|
||||
return worldIn.getBlockState(pos.offset(side.getOpposite())) != state || block != this && block != this && super.shouldSideBeRendered(worldIn, pos, side);
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -35,8 +35,8 @@ import java.util.Random;
|
|||
|
||||
public class BlockGrinder extends BlockContainerBase{
|
||||
|
||||
private final boolean isDouble;
|
||||
private static final PropertyInteger META = PropertyInteger.create("meta", 0, 1);
|
||||
private final boolean isDouble;
|
||||
|
||||
public BlockGrinder(boolean isDouble, String name){
|
||||
super(Material.rock, name);
|
||||
|
@ -48,11 +48,6 @@ public class BlockGrinder extends BlockContainerBase{
|
|||
this.setTickRandomly(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected PropertyInteger getMetaProperty(){
|
||||
return META;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int par2){
|
||||
return this.isDouble ? new TileEntityGrinder.TileEntityGrinderDouble() : new TileEntityGrinder();
|
||||
|
@ -95,6 +90,11 @@ public class BlockGrinder extends BlockContainerBase{
|
|||
return EnumRarity.EPIC;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected PropertyInteger getMetaProperty(){
|
||||
return META;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock(World world, BlockPos pos, IBlockState state){
|
||||
this.dropInventory(world, pos);
|
||||
|
|
|
@ -37,11 +37,6 @@ public class BlockLampPowerer extends BlockBase{
|
|||
this.setStepSound(soundTypeStone);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected PropertyInteger getMetaProperty(){
|
||||
return META;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNeighborBlockChange(World world, BlockPos pos, IBlockState state, Block neighborBlock){
|
||||
this.updateLamp(world, pos);
|
||||
|
@ -82,4 +77,9 @@ public class BlockLampPowerer extends BlockBase{
|
|||
public EnumRarity getRarity(ItemStack stack){
|
||||
return EnumRarity.RARE;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected PropertyInteger getMetaProperty(){
|
||||
return META;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -42,8 +42,8 @@ public class BlockLaserRelay extends BlockContainerBase{
|
|||
}
|
||||
|
||||
@Override
|
||||
protected PropertyInteger getMetaProperty(){
|
||||
return META;
|
||||
public boolean isFullCube(){
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -92,6 +92,11 @@ public class BlockLaserRelay extends BlockContainerBase{
|
|||
return EnumRarity.EPIC;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected PropertyInteger getMetaProperty(){
|
||||
return META;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int i){
|
||||
return new TileEntityLaserRelay();
|
||||
|
|
|
@ -42,27 +42,11 @@ public class BlockMisc extends BlockBase{
|
|||
this.setHarvestLevel("pickaxe", 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected PropertyInteger getMetaProperty(){
|
||||
return META;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int damageDropped(IBlockState state){
|
||||
return this.getMetaFromState(state);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void registerRendering(){
|
||||
ResourceLocation[] resLocs = new ResourceLocation[allMiscBlocks.length];
|
||||
for(int i = 0; i < allMiscBlocks.length; i++){
|
||||
String name = this.getBaseName()+allMiscBlocks[i].name;
|
||||
resLocs[i] = new ResourceLocation(ModUtil.MOD_ID_LOWER, name);
|
||||
ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this, 1, i), new ResourceLocation(ModUtil.MOD_ID_LOWER, name));
|
||||
}
|
||||
ActuallyAdditions.proxy.addRenderVariant(Item.getItemFromBlock(this), resLocs);
|
||||
}
|
||||
|
||||
@SuppressWarnings("all")
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubBlocks(Item item, CreativeTabs tab, List list){
|
||||
|
@ -76,11 +60,27 @@ public class BlockMisc extends BlockBase{
|
|||
return TheItemBlock.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void registerRendering(){
|
||||
ResourceLocation[] resLocs = new ResourceLocation[allMiscBlocks.length];
|
||||
for(int i = 0; i < allMiscBlocks.length; i++){
|
||||
String name = this.getBaseName()+allMiscBlocks[i].name;
|
||||
resLocs[i] = new ResourceLocation(ModUtil.MOD_ID_LOWER, name);
|
||||
ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this, 1, i), new ResourceLocation(ModUtil.MOD_ID_LOWER, name));
|
||||
}
|
||||
ActuallyAdditions.proxy.addRenderVariant(Item.getItemFromBlock(this), resLocs);
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumRarity getRarity(ItemStack stack){
|
||||
return stack.getItemDamage() >= allMiscBlocks.length ? EnumRarity.COMMON : allMiscBlocks[stack.getItemDamage()].rarity;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected PropertyInteger getMetaProperty(){
|
||||
return META;
|
||||
}
|
||||
|
||||
public static class TheItemBlock extends ItemBlockBase{
|
||||
|
||||
public TheItemBlock(Block block){
|
||||
|
|
|
@ -46,11 +46,6 @@ public class BlockOilGenerator extends BlockContainerBase{
|
|||
this.setTickRandomly(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected PropertyInteger getMetaProperty(){
|
||||
return META;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int par2){
|
||||
return new TileEntityOilGenerator();
|
||||
|
@ -83,6 +78,11 @@ public class BlockOilGenerator extends BlockContainerBase{
|
|||
return EnumRarity.RARE;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected PropertyInteger getMetaProperty(){
|
||||
return META;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock(World world, BlockPos pos, IBlockState state){
|
||||
this.dropInventory(world, pos);
|
||||
|
|
|
@ -28,7 +28,12 @@ public class BlockPhantomBooster extends BlockContainerBase{
|
|||
this.setStepSound(soundTypeStone);
|
||||
|
||||
float f = 1F/16F;
|
||||
this.setBlockBounds(3*f, 0F, 3*f, 1-3*f, 1F, 1-3*f);
|
||||
this.setBlockBounds(2*f, 0F, 2*f, 1-2*f, 1F, 1-2*f);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFullCube(){
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -31,6 +31,7 @@ import java.util.List;
|
|||
|
||||
public class BlockSlabs extends BlockBase{
|
||||
|
||||
private static final PropertyInteger META = PropertyInteger.create("meta", 0, 1);
|
||||
private Block fullBlock;
|
||||
private int meta;
|
||||
|
||||
|
@ -38,8 +39,6 @@ public class BlockSlabs extends BlockBase{
|
|||
this(name, fullBlock, 0);
|
||||
}
|
||||
|
||||
private static final PropertyInteger META = PropertyInteger.create("meta", 0, 1);
|
||||
|
||||
public BlockSlabs(String name, Block fullBlock, int meta){
|
||||
super(fullBlock.getMaterial(), name);
|
||||
this.setHardness(1.5F);
|
||||
|
@ -48,11 +47,6 @@ public class BlockSlabs extends BlockBase{
|
|||
this.meta = meta;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected PropertyInteger getMetaProperty(){
|
||||
return META;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addCollisionBoxesToList(World world, BlockPos pos, IBlockState state, AxisAlignedBB axis, List list, Entity entity){
|
||||
this.setBlockBoundsBasedOnState(world, pos);
|
||||
|
@ -98,6 +92,11 @@ public class BlockSlabs extends BlockBase{
|
|||
return EnumRarity.COMMON;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected PropertyInteger getMetaProperty(){
|
||||
return META;
|
||||
}
|
||||
|
||||
public static class TheItemBlock extends ItemBlockBase{
|
||||
|
||||
public TheItemBlock(Block block){
|
||||
|
|
|
@ -47,9 +47,16 @@ public class BlockSmileyCloud extends BlockContainerBase{
|
|||
this.setStepSound(soundTypeCloth);
|
||||
this.setTickRandomly(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected PropertyInteger getMetaProperty(){
|
||||
return META;
|
||||
public boolean isFullCube(){
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addCollisionBoxesToList(World world, BlockPos pos, IBlockState state, AxisAlignedBB axis, List list, Entity entity){
|
||||
this.setBlockBoundsBasedOnState(world, pos);
|
||||
super.addCollisionBoxesToList(world, pos, state, axis, list, entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -83,28 +90,22 @@ public class BlockSmileyCloud extends BlockContainerBase{
|
|||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addCollisionBoxesToList(World world, BlockPos pos, IBlockState state, AxisAlignedBB axis, List list, Entity entity){
|
||||
this.setBlockBoundsBasedOnState(world, pos);
|
||||
super.addCollisionBoxesToList(world, pos, state, axis, list, entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBlockBoundsBasedOnState(IBlockAccess world, BlockPos pos){
|
||||
int meta = PosUtil.getMetadata(pos, world);
|
||||
float f = 0.0625F;
|
||||
|
||||
if(meta == 0){
|
||||
this.setBlockBounds(0F, 0F, 0F, 1F, 1F, 1F-f*3F);
|
||||
}
|
||||
if(meta == 1){
|
||||
this.setBlockBounds(0F, 0F, 0F, 1F-f*3F, 1F, 1F);
|
||||
}
|
||||
if(meta == 2){
|
||||
this.setBlockBounds(0F, 0F, f*3F, 1F, 1F, 1F);
|
||||
this.setBlockBounds(0F, 0F, 0F, 1F, 1F-f*3F, 1F-f*2F);
|
||||
}
|
||||
if(meta == 3){
|
||||
this.setBlockBounds(f*3F, 0F, 0F, 1F, 1F, 1F);
|
||||
this.setBlockBounds(0F, 0F, 0F, 1F-f*2F, 1F-f*3F, 1F);
|
||||
}
|
||||
if(meta == 0){
|
||||
this.setBlockBounds(0F, 0F, f*2F, 1F, 1F-f*3F, 1F);
|
||||
}
|
||||
if(meta == 2){
|
||||
this.setBlockBounds(f*2F, 0F, 0F, 1F, 1F-f*3F, 1F);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -143,4 +144,9 @@ public class BlockSmileyCloud extends BlockContainerBase{
|
|||
|
||||
super.onBlockPlacedBy(world, pos, state, player, stack);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected PropertyInteger getMetaProperty(){
|
||||
return META;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -46,11 +46,6 @@ public class BlockTreasureChest extends BlockBase{
|
|||
this.setTickRandomly(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected PropertyInteger getMetaProperty(){
|
||||
return META;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void randomDisplayTick(World world, BlockPos pos, IBlockState state, Random rand){
|
||||
|
@ -80,11 +75,6 @@ public class BlockTreasureChest extends BlockBase{
|
|||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canSilkHarvest(World world, BlockPos pos, IBlockState state, EntityPlayer player){
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockPlacedBy(World world, BlockPos pos, IBlockState state, EntityLivingBase player, ItemStack stack){
|
||||
int rotation = MathHelper.floor_double((double)(player.rotationYaw*4.0F/360.0F)+0.5D) & 3;
|
||||
|
@ -103,6 +93,11 @@ public class BlockTreasureChest extends BlockBase{
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canSilkHarvest(World world, BlockPos pos, IBlockState state, EntityPlayer player){
|
||||
return false;
|
||||
}
|
||||
|
||||
private void dropItems(World world, BlockPos pos){
|
||||
for(int i = 0; i < MathHelper.getRandomIntegerInRange(Util.RANDOM, 3, 6); i++){
|
||||
TreasureChestLoot theReturn = WeightedRandom.getRandomItem(Util.RANDOM, ActuallyAdditionsAPI.treasureChestLoot);
|
||||
|
@ -129,4 +124,9 @@ public class BlockTreasureChest extends BlockBase{
|
|||
public EnumRarity getRarity(ItemStack stack){
|
||||
return EnumRarity.EPIC;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected PropertyInteger getMetaProperty(){
|
||||
return META;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -48,37 +48,12 @@ public class BlockWildPlant extends BlockBushBase{
|
|||
this.setStepSound(soundTypeGrass);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected PropertyInteger getMetaProperty(){
|
||||
return META;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canBlockStay(World world, BlockPos pos, IBlockState state){
|
||||
BlockPos offset = PosUtil.offset(pos, 0, -1, 0);
|
||||
return PosUtil.getMetadata(pos, world) == TheWildPlants.RICE.ordinal() ? PosUtil.getMaterial(offset, world) == Material.water : PosUtil.getBlock(offset, world).canSustainPlant(world, offset, EnumFacing.UP, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<? extends ItemBlockBase> getItemBlock(){
|
||||
return TheItemBlock.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldAddCreative(){
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumRarity getRarity(ItemStack stack){
|
||||
return stack.getItemDamage() >= allWildPlants.length ? EnumRarity.COMMON : allWildPlants[stack.getItemDamage()].rarity;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canSilkHarvest(World world, BlockPos pos, IBlockState state, EntityPlayer player){
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public Item getItem(World world, BlockPos pos){
|
||||
|
@ -94,6 +69,27 @@ public class BlockWildPlant extends BlockBushBase{
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ItemStack> getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune){
|
||||
int metadata = state.getBlock().getMetaFromState(state);
|
||||
return metadata >= allWildPlants.length ? null : allWildPlants[metadata].wildVersionOf.getDrops(world, pos, allWildPlants[metadata].wildVersionOf.getStateFromMeta(7), fortune);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canSilkHarvest(World world, BlockPos pos, IBlockState state, EntityPlayer player){
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<? extends ItemBlockBase> getItemBlock(){
|
||||
return TheItemBlock.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldAddCreative(){
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void registerRendering(){
|
||||
ResourceLocation[] resLocs = new ResourceLocation[allWildPlants.length];
|
||||
|
@ -106,9 +102,13 @@ public class BlockWildPlant extends BlockBushBase{
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<ItemStack> getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune){
|
||||
int metadata = state.getBlock().getMetaFromState(state);
|
||||
return metadata >= allWildPlants.length ? null : allWildPlants[metadata].wildVersionOf.getDrops(world, pos, allWildPlants[metadata].wildVersionOf.getStateFromMeta(7), fortune);
|
||||
public EnumRarity getRarity(ItemStack stack){
|
||||
return stack.getItemDamage() >= allWildPlants.length ? EnumRarity.COMMON : allWildPlants[stack.getItemDamage()].rarity;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected PropertyInteger getMetaProperty(){
|
||||
return META;
|
||||
}
|
||||
|
||||
public static class TheItemBlock extends ItemBlockBase{
|
||||
|
|
|
@ -44,11 +44,6 @@ public class BlockXPSolidifier extends BlockContainerBase{
|
|||
this.setStepSound(soundTypeStone);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected PropertyInteger getMetaProperty(){
|
||||
return META;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int par2){
|
||||
return new TileEntityXPSolidifier();
|
||||
|
@ -91,6 +86,11 @@ public class BlockXPSolidifier extends BlockContainerBase{
|
|||
super.onBlockPlacedBy(world, pos, state, player, stack);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected PropertyInteger getMetaProperty(){
|
||||
return META;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock(World world, BlockPos pos, IBlockState state){
|
||||
this.dropInventory(world, pos);
|
||||
|
|
|
@ -10,19 +10,13 @@
|
|||
|
||||
package de.ellpeck.actuallyadditions.mod.blocks;
|
||||
|
||||
import de.ellpeck.actuallyadditions.mod.blocks.base.BlockFluidFlowing;
|
||||
import de.ellpeck.actuallyadditions.mod.blocks.base.BlockPlant;
|
||||
import de.ellpeck.actuallyadditions.mod.blocks.base.BlockStair;
|
||||
import de.ellpeck.actuallyadditions.mod.blocks.base.BlockWallAA;
|
||||
import de.ellpeck.actuallyadditions.mod.blocks.metalists.TheMiscBlocks;
|
||||
import de.ellpeck.actuallyadditions.mod.config.values.ConfigBoolValues;
|
||||
import de.ellpeck.actuallyadditions.mod.util.CompatUtil;
|
||||
import de.ellpeck.actuallyadditions.mod.util.ModUtil;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidRegistry;
|
||||
|
||||
public class InitBlocks{
|
||||
|
||||
|
@ -52,11 +46,6 @@ public class InitBlocks{
|
|||
public static Block blockFlax;
|
||||
public static Block blockCoffee;
|
||||
|
||||
public static Fluid fluidCanolaOil;
|
||||
public static Block blockCanolaOil;
|
||||
public static Fluid fluidOil;
|
||||
public static Block blockOil;
|
||||
|
||||
public static Block blockCanolaPress;
|
||||
public static Block blockFermentingBarrel;
|
||||
|
||||
|
@ -162,7 +151,7 @@ public class InitBlocks{
|
|||
blockFermentingBarrel = new BlockFermentingBarrel("blockFermentingBarrel");
|
||||
blockRice = new BlockPlant("blockRice", 1, 2);
|
||||
CompatUtil.registerMFRPlant(blockRice);
|
||||
blockCanola = new BlockPlant("blockCanola", 5, 5);
|
||||
blockCanola = new BlockPlant("blockCanola", 2, 3);
|
||||
CompatUtil.registerMFRPlant(blockCanola);
|
||||
blockFlax = new BlockPlant("blockFlax", 2, 4);
|
||||
CompatUtil.registerMFRPlant(blockFlax);
|
||||
|
@ -199,53 +188,5 @@ public class InitBlocks{
|
|||
blockQuartzSlab = new BlockSlabs("blockQuartzSlab", blockMisc, TheMiscBlocks.QUARTZ.ordinal());
|
||||
blockChiseledQuartzSlab = new BlockSlabs("blockChiseledQuartzSlab", blockMisc, TheMiscBlocks.QUARTZ_CHISELED.ordinal());
|
||||
blockPillarQuartzSlab = new BlockSlabs("blockPillarQuartzSlab", blockMisc, TheMiscBlocks.QUARTZ_PILLAR.ordinal());
|
||||
|
||||
registerFluids();
|
||||
}
|
||||
|
||||
public static void registerFluids(){
|
||||
//Canola Fluid
|
||||
String canolaOil = "canolaoil";
|
||||
if(!FluidRegistry.isFluidRegistered(canolaOil) || ConfigBoolValues.PREVENT_CANOLA_OVERRIDE.isEnabled()){
|
||||
fluidCanolaOil = new FluidAA(canolaOil, "blockCanolaOil").setRarity(EnumRarity.UNCOMMON);
|
||||
FluidRegistry.registerFluid(fluidCanolaOil);
|
||||
}
|
||||
else{
|
||||
errorAlreadyRegistered("Canola Oil Fluid");
|
||||
}
|
||||
fluidCanolaOil = FluidRegistry.getFluid(canolaOil);
|
||||
|
||||
//Canola Block
|
||||
if(fluidCanolaOil.getBlock() == null || ConfigBoolValues.PREVENT_CANOLA_BLOCK_OVERRIDE.isEnabled()){
|
||||
blockCanolaOil = new BlockFluidFlowing(fluidCanolaOil, Material.water, "blockCanolaOil");
|
||||
}
|
||||
else{
|
||||
errorAlreadyRegistered("Canola Oil Block");
|
||||
}
|
||||
blockCanolaOil = fluidCanolaOil.getBlock();
|
||||
|
||||
//Oil Fluid
|
||||
String oil = "oil";
|
||||
if(!FluidRegistry.isFluidRegistered(oil) || ConfigBoolValues.PREVENT_OIL_OVERRIDE.isEnabled()){
|
||||
fluidOil = new FluidAA(oil, "blockOil").setRarity(EnumRarity.UNCOMMON);
|
||||
FluidRegistry.registerFluid(fluidOil);
|
||||
}
|
||||
else{
|
||||
errorAlreadyRegistered("Oil Fluid");
|
||||
}
|
||||
fluidOil = FluidRegistry.getFluid(oil);
|
||||
|
||||
//Oil Block
|
||||
if(fluidOil.getBlock() == null || ConfigBoolValues.PREVENT_OIL_BLOCK_OVERRIDE.isEnabled()){
|
||||
blockOil = new BlockFluidFlowing(fluidOil, Material.water, "blockOil");
|
||||
}
|
||||
else{
|
||||
errorAlreadyRegistered("Oil Block");
|
||||
}
|
||||
blockOil = fluidOil.getBlock();
|
||||
}
|
||||
|
||||
public static void errorAlreadyRegistered(String str){
|
||||
ModUtil.LOGGER.warn(str+" from "+ModUtil.NAME+" is not getting used as it has already been registered by another Mod! If this causes Issues (which it shouldn't!), you can turn this off in the Config File!");
|
||||
}
|
||||
}
|
|
@ -47,10 +47,6 @@ public class BlockBase extends Block{
|
|||
this.registerRendering();
|
||||
}
|
||||
|
||||
protected void registerRendering(){
|
||||
ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this), new ResourceLocation(ModUtil.MOD_ID_LOWER, this.getBaseName()));
|
||||
}
|
||||
|
||||
protected String getBaseName(){
|
||||
return this.name;
|
||||
}
|
||||
|
@ -63,13 +59,12 @@ public class BlockBase extends Block{
|
|||
return true;
|
||||
}
|
||||
|
||||
public EnumRarity getRarity(ItemStack stack){
|
||||
return EnumRarity.COMMON;
|
||||
protected void registerRendering(){
|
||||
ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this), new ResourceLocation(ModUtil.MOD_ID_LOWER, this.getBaseName()));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected BlockState createBlockState(){
|
||||
return this.getMetaProperty() == null ? super.createBlockState() : new BlockState(this, this.getMetaProperty());
|
||||
public EnumRarity getRarity(ItemStack stack){
|
||||
return EnumRarity.COMMON;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -82,6 +77,11 @@ public class BlockBase extends Block{
|
|||
return this.getMetaProperty() == null ? super.getMetaFromState(state) : state.getValue(this.getMetaProperty());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected BlockState createBlockState(){
|
||||
return this.getMetaProperty() == null ? super.createBlockState() : new BlockState(this, this.getMetaProperty());
|
||||
}
|
||||
|
||||
protected PropertyInteger getMetaProperty(){
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -46,10 +46,6 @@ public class BlockBushBase extends BlockBush{
|
|||
this.registerRendering();
|
||||
}
|
||||
|
||||
protected void registerRendering(){
|
||||
ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this), new ResourceLocation(ModUtil.MOD_ID_LOWER, this.getBaseName()));
|
||||
}
|
||||
|
||||
protected String getBaseName(){
|
||||
return this.name;
|
||||
}
|
||||
|
@ -62,13 +58,12 @@ public class BlockBushBase extends BlockBush{
|
|||
return true;
|
||||
}
|
||||
|
||||
public EnumRarity getRarity(ItemStack stack){
|
||||
return EnumRarity.COMMON;
|
||||
protected void registerRendering(){
|
||||
ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this), new ResourceLocation(ModUtil.MOD_ID_LOWER, this.getBaseName()));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected BlockState createBlockState(){
|
||||
return this.getMetaProperty() == null ? super.createBlockState() : new BlockState(this, this.getMetaProperty());
|
||||
public EnumRarity getRarity(ItemStack stack){
|
||||
return EnumRarity.COMMON;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -81,6 +76,11 @@ public class BlockBushBase extends BlockBush{
|
|||
return this.getMetaProperty() == null ? super.getMetaFromState(state) : state.getValue(this.getMetaProperty());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected BlockState createBlockState(){
|
||||
return this.getMetaProperty() == null ? super.createBlockState() : new BlockState(this, this.getMetaProperty());
|
||||
}
|
||||
|
||||
protected PropertyInteger getMetaProperty(){
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -65,10 +65,6 @@ public abstract class BlockContainerBase extends BlockContainer{
|
|||
this.registerRendering();
|
||||
}
|
||||
|
||||
protected void registerRendering(){
|
||||
ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this), new ResourceLocation(ModUtil.MOD_ID_LOWER, this.getBaseName()));
|
||||
}
|
||||
|
||||
protected String getBaseName(){
|
||||
return this.name;
|
||||
}
|
||||
|
@ -81,6 +77,10 @@ public abstract class BlockContainerBase extends BlockContainer{
|
|||
return true;
|
||||
}
|
||||
|
||||
protected void registerRendering(){
|
||||
ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this), new ResourceLocation(ModUtil.MOD_ID_LOWER, this.getBaseName()));
|
||||
}
|
||||
|
||||
public EnumRarity getRarity(ItemStack stack){
|
||||
return EnumRarity.COMMON;
|
||||
}
|
||||
|
@ -117,6 +117,45 @@ public abstract class BlockContainerBase extends BlockContainer{
|
|||
}
|
||||
}
|
||||
|
||||
public boolean tryToggleRedstone(World world, BlockPos pos, EntityPlayer player){
|
||||
ItemStack stack = player.getCurrentEquippedItem();
|
||||
if(stack != null && Block.getBlockFromItem(stack.getItem()) instanceof BlockRedstoneTorch){
|
||||
TileEntity tile = world.getTileEntity(pos);
|
||||
if(tile instanceof IRedstoneToggle){
|
||||
if(!world.isRemote){
|
||||
((IRedstoneToggle)tile).toggle(!((IRedstoneToggle)tile).isPulseMode());
|
||||
tile.markDirty();
|
||||
|
||||
if(tile instanceof TileEntityBase){
|
||||
((TileEntityBase)tile).sendUpdate();
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBlockState getStateFromMeta(int meta){
|
||||
return this.getMetaProperty() == null ? super.getStateFromMeta(meta) : this.getDefaultState().withProperty(this.getMetaProperty(), meta);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetaFromState(IBlockState state){
|
||||
return this.getMetaProperty() == null ? super.getMetaFromState(state) : state.getValue(this.getMetaProperty());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateTick(World world, BlockPos pos, IBlockState state, Random random){
|
||||
if(!world.isRemote){
|
||||
TileEntity tile = world.getTileEntity(pos);
|
||||
if(tile instanceof IRedstoneToggle && ((IRedstoneToggle)tile).isPulseMode()){
|
||||
((IRedstoneToggle)tile).activateOnPulse();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNeighborBlockChange(World world, BlockPos pos, IBlockState state, Block neighborBlock){
|
||||
this.updateRedstoneState(world, pos);
|
||||
|
@ -142,13 +181,8 @@ public abstract class BlockContainerBase extends BlockContainer{
|
|||
}
|
||||
|
||||
@Override
|
||||
public void updateTick(World world, BlockPos pos, IBlockState state, Random random){
|
||||
if(!world.isRemote){
|
||||
TileEntity tile = world.getTileEntity(pos);
|
||||
if(tile instanceof IRedstoneToggle && ((IRedstoneToggle)tile).isPulseMode()){
|
||||
((IRedstoneToggle)tile).activateOnPulse();
|
||||
}
|
||||
}
|
||||
public void onBlockAdded(World world, BlockPos pos, IBlockState state){
|
||||
this.updateRedstoneState(world, pos);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -203,6 +237,11 @@ public abstract class BlockContainerBase extends BlockContainer{
|
|||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected BlockState createBlockState(){
|
||||
return this.getMetaProperty() == null ? super.createBlockState() : new BlockState(this, this.getMetaProperty());
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<ItemStack> getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune){
|
||||
ArrayList<ItemStack> drops = new ArrayList<ItemStack>();
|
||||
|
@ -246,45 +285,6 @@ public abstract class BlockContainerBase extends BlockContainer{
|
|||
return drops;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockAdded(World world, BlockPos pos, IBlockState state){
|
||||
this.updateRedstoneState(world, pos);
|
||||
}
|
||||
|
||||
public boolean tryToggleRedstone(World world, BlockPos pos, EntityPlayer player){
|
||||
ItemStack stack = player.getCurrentEquippedItem();
|
||||
if(stack != null && Block.getBlockFromItem(stack.getItem()) instanceof BlockRedstoneTorch){
|
||||
TileEntity tile = world.getTileEntity(pos);
|
||||
if(tile instanceof IRedstoneToggle){
|
||||
if(!world.isRemote){
|
||||
((IRedstoneToggle)tile).toggle(!((IRedstoneToggle)tile).isPulseMode());
|
||||
tile.markDirty();
|
||||
|
||||
if(tile instanceof TileEntityBase){
|
||||
((TileEntityBase)tile).sendUpdate();
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected BlockState createBlockState(){
|
||||
return this.getMetaProperty() == null ? super.createBlockState() : new BlockState(this, this.getMetaProperty());
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBlockState getStateFromMeta(int meta){
|
||||
return this.getMetaProperty() == null ? super.getStateFromMeta(meta) : this.getDefaultState().withProperty(this.getMetaProperty(), meta);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetaFromState(IBlockState state){
|
||||
return this.getMetaProperty() == null ? super.getMetaFromState(state) : state.getValue(this.getMetaProperty());
|
||||
}
|
||||
|
||||
protected PropertyInteger getMetaProperty(){
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -47,27 +47,6 @@ public class BlockPlant extends BlockCrops{
|
|||
this.register();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumFacing facing, float hitX, float hitY, float hitZ){
|
||||
if(getMetaFromState(state) >= 7){
|
||||
if(!world.isRemote){
|
||||
|
||||
List<ItemStack> drops = getDrops(world, pos, state, 0);
|
||||
for(ItemStack stack : drops){
|
||||
if(stack != null && stack.getItem() == this.getSeed()){
|
||||
stack.stackSize--;
|
||||
}
|
||||
EntityItem entity = new EntityItem(world, pos.getX()+.5, pos.getY()+.5, pos.getZ()+.5, stack);
|
||||
world.spawnEntityInWorld(entity);
|
||||
}
|
||||
|
||||
world.setBlockState(pos, getStateFromMeta(0));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private void register(){
|
||||
this.setUnlocalizedName(ModUtil.MOD_ID_LOWER+"."+this.getBaseName());
|
||||
GameRegistry.registerBlock(this, this.getItemBlock(), this.getBaseName());
|
||||
|
@ -81,10 +60,6 @@ public class BlockPlant extends BlockCrops{
|
|||
this.registerRendering();
|
||||
}
|
||||
|
||||
protected void registerRendering(){
|
||||
ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this), new ResourceLocation(ModUtil.MOD_ID_LOWER, this.getBaseName()));
|
||||
}
|
||||
|
||||
protected String getBaseName(){
|
||||
return this.name;
|
||||
}
|
||||
|
@ -97,6 +72,10 @@ public class BlockPlant extends BlockCrops{
|
|||
return false;
|
||||
}
|
||||
|
||||
protected void registerRendering(){
|
||||
ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this), new ResourceLocation(ModUtil.MOD_ID_LOWER, this.getBaseName()));
|
||||
}
|
||||
|
||||
public EnumRarity getRarity(ItemStack stack){
|
||||
return EnumRarity.RARE;
|
||||
}
|
||||
|
@ -106,33 +85,64 @@ public class BlockPlant extends BlockCrops{
|
|||
return EnumPlantType.Crop;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getSeed(){
|
||||
return this.seedItem;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getCrop(){
|
||||
return this.returnItem;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItemDropped(IBlockState state, Random rand, int par3){
|
||||
return this.getMetaFromState(state) >= 7 ? this.getCrop() : this.getSeed();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int damageDropped(IBlockState state){
|
||||
return this.getMetaFromState(state) >= 7 ? this.returnMeta : 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumFacing facing, float hitX, float hitY, float hitZ){
|
||||
if(getMetaFromState(state) >= 7){
|
||||
if(!world.isRemote){
|
||||
|
||||
List<ItemStack> drops = getDrops(world, pos, state, 0);
|
||||
boolean deductedSeedSize = false;
|
||||
for(ItemStack stack : drops){
|
||||
if(stack != null){
|
||||
if(stack.getItem() == this.seedItem && !deductedSeedSize){
|
||||
stack.stackSize--;
|
||||
deductedSeedSize = true;
|
||||
}
|
||||
|
||||
if(stack.stackSize > 0){
|
||||
EntityItem entity = new EntityItem(world, pos.getX()+0.5, pos.getY()+0.5, pos.getZ()+0.5, stack);
|
||||
world.spawnEntityInWorld(entity);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
world.setBlockState(pos, getStateFromMeta(0));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDamageValue(World world, BlockPos pos){
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getSeed(){
|
||||
return this.seedItem;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int quantityDropped(IBlockState state, int fortune, Random random){
|
||||
return this.getMetaFromState(state) >= 7 ? random.nextInt(addDropAmount)+minDropAmount : super.quantityDropped(state, fortune, random);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getCrop(){
|
||||
return this.returnItem;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Item getItemDropped(IBlockState state, Random rand, int par3){
|
||||
return this.getMetaFromState(state) >= 7 ? this.getCrop() : this.getSeed();
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -50,10 +50,6 @@ public class BlockStair extends BlockStairs{
|
|||
this.registerRendering();
|
||||
}
|
||||
|
||||
protected void registerRendering(){
|
||||
ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this), new ResourceLocation(ModUtil.MOD_ID_LOWER, this.getBaseName()));
|
||||
}
|
||||
|
||||
protected String getBaseName(){
|
||||
return this.name;
|
||||
}
|
||||
|
@ -66,6 +62,10 @@ public class BlockStair extends BlockStairs{
|
|||
return true;
|
||||
}
|
||||
|
||||
protected void registerRendering(){
|
||||
ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this), new ResourceLocation(ModUtil.MOD_ID_LOWER, this.getBaseName()));
|
||||
}
|
||||
|
||||
public EnumRarity getRarity(ItemStack stack){
|
||||
return EnumRarity.COMMON;
|
||||
}
|
||||
|
|
|
@ -49,16 +49,9 @@ public class BlockWallAA extends BlockBase{
|
|||
this.setDefaultState(this.blockState.getBaseState().withProperty(BlockWall.UP, false).withProperty(BlockWall.NORTH, false).withProperty(BlockWall.EAST, false).withProperty(BlockWall.SOUTH, false).withProperty(BlockWall.WEST, false));
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubBlocks(Item item, CreativeTabs tab, List list){
|
||||
list.add(new ItemStack(item, 1, 0));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int damageDropped(IBlockState state){
|
||||
return meta;
|
||||
public IBlockState getActualState(IBlockState state, IBlockAccess worldIn, BlockPos pos){
|
||||
return state.withProperty(BlockWall.UP, !worldIn.isAirBlock(pos.up())).withProperty(BlockWall.NORTH, this.canConnectTo(worldIn, pos.north())).withProperty(BlockWall.EAST, this.canConnectTo(worldIn, pos.east())).withProperty(BlockWall.SOUTH, this.canConnectTo(worldIn, pos.south())).withProperty(BlockWall.WEST, this.canConnectTo(worldIn, pos.west()));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -71,11 +64,29 @@ public class BlockWallAA extends BlockBase{
|
|||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean shouldSideBeRendered(IBlockAccess worldIn, BlockPos pos, EnumFacing side){
|
||||
return side != EnumFacing.DOWN || super.shouldSideBeRendered(worldIn, pos, side);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getCollisionBoundingBox(World worldIn, BlockPos pos, IBlockState state){
|
||||
this.setBlockBoundsBasedOnState(worldIn, pos);
|
||||
this.maxY = 1.5D;
|
||||
return super.getCollisionBoundingBox(worldIn, pos, state);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube(){
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int damageDropped(IBlockState state){
|
||||
return meta;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBlockBoundsBasedOnState(IBlockAccess worldIn, BlockPos pos){
|
||||
boolean flag = this.canConnectTo(worldIn, pos.north());
|
||||
|
@ -115,11 +126,11 @@ public class BlockWallAA extends BlockBase{
|
|||
this.setBlockBounds(f, 0.0F, f2, f1, f4, f3);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public AxisAlignedBB getCollisionBoundingBox(World worldIn, BlockPos pos, IBlockState state){
|
||||
this.setBlockBoundsBasedOnState(worldIn, pos);
|
||||
this.maxY = 1.5D;
|
||||
return super.getCollisionBoundingBox(worldIn, pos, state);
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubBlocks(Item item, CreativeTabs tab, List list){
|
||||
list.add(new ItemStack(item, 1, 0));
|
||||
}
|
||||
|
||||
public boolean canConnectTo(IBlockAccess worldIn, BlockPos pos){
|
||||
|
@ -127,22 +138,6 @@ public class BlockWallAA extends BlockBase{
|
|||
return block != Blocks.barrier && (!(block != this && !(block instanceof BlockFenceGate)) || ((block.getMaterial().isOpaque() && block.isFullCube()) && block.getMaterial() != Material.gourd));
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean shouldSideBeRendered(IBlockAccess worldIn, BlockPos pos, EnumFacing side){
|
||||
return side != EnumFacing.DOWN || super.shouldSideBeRendered(worldIn, pos, side);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBlockState getActualState(IBlockState state, IBlockAccess worldIn, BlockPos pos){
|
||||
return state.withProperty(BlockWall.UP, !worldIn.isAirBlock(pos.up())).withProperty(BlockWall.NORTH, this.canConnectTo(worldIn, pos.north())).withProperty(BlockWall.EAST, this.canConnectTo(worldIn, pos.east())).withProperty(BlockWall.SOUTH, this.canConnectTo(worldIn, pos.south())).withProperty(BlockWall.WEST, this.canConnectTo(worldIn, pos.west()));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected BlockState createBlockState(){
|
||||
return new BlockState(this, BlockWall.UP, BlockWall.NORTH, BlockWall.EAST, BlockWall.WEST, BlockWall.SOUTH);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBlockState getStateFromMeta(int meta){
|
||||
return this.getDefaultState();
|
||||
|
@ -152,4 +147,9 @@ public class BlockWallAA extends BlockBase{
|
|||
public int getMetaFromState(IBlockState state){
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected BlockState createBlockState(){
|
||||
return new BlockState(this, BlockWall.UP, BlockWall.NORTH, BlockWall.EAST, BlockWall.WEST, BlockWall.SOUTH);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -91,11 +91,6 @@ public class GuiBooklet extends GuiScreen implements IBookletGui{
|
|||
this.saveOnClose = saveOnClose;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawHoveringText(List list, int x, int y){
|
||||
super.drawHoveringText(list, x, y);
|
||||
}
|
||||
|
||||
public FontRenderer getFontRenderer(){
|
||||
return this.fontRendererObj;
|
||||
}
|
||||
|
@ -197,6 +192,11 @@ public class GuiBooklet extends GuiScreen implements IBookletGui{
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawHoveringText(List list, int x, int y){
|
||||
super.drawHoveringText(list, x, y);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void mouseClicked(int par1, int par2, int par3) throws IOException{
|
||||
this.searchField.mouseClicked(par1, par2, par3);
|
||||
|
|
|
@ -50,7 +50,7 @@ public class InitBooklet{
|
|||
ActuallyAdditionsAPI.entryMisc = new BookletEntry("misc");
|
||||
ActuallyAdditionsAPI.allAndSearch = new BookletEntryAllSearch("allAndSearch").setSpecial();
|
||||
}
|
||||
|
||||
|
||||
public static void postInit(){
|
||||
initChapters();
|
||||
}
|
||||
|
@ -65,7 +65,7 @@ public class InitBooklet{
|
|||
new BookletChapter("rf", ActuallyAdditionsAPI.entryGettingStarted, new ItemStack(Items.redstone), new PageTextOnly(1));
|
||||
|
||||
//Miscellaneous
|
||||
new BookletChapter("reconstructorLenses", ActuallyAdditionsAPI.entryMisc, new ItemStack(InitItems.itemMisc, 1, TheMiscItems.LENS.ordinal()), new PageTextOnly(1), new PageCrafting(2, ItemCrafting.recipeLens).setNoText(), new PageReconstructor(3, LensNoneRecipeHandler.recipeColorLens), new PageReconstructor(4, LensNoneRecipeHandler.recipeExplosionLens), new PageReconstructor(5, LensNoneRecipeHandler.recipeDamageLens), new PageReconstructor(6, LensNoneRecipeHandler.recipeSoulSand).setNoText(), new PageReconstructor(7, LensNoneRecipeHandler.recipeLeather).setNoText()).setImportant();
|
||||
new BookletChapter("reconstructorLenses", ActuallyAdditionsAPI.entryMisc, new ItemStack(InitItems.itemMisc, 1, TheMiscItems.LENS.ordinal()), new PageTextOnly(1), new PageCrafting(2, ItemCrafting.recipeLens).setNoText(), new PageReconstructor(3, LensNoneRecipeHandler.recipeColorLens), new PageReconstructor(4, LensNoneRecipeHandler.recipeExplosionLens), new PageReconstructor(5, LensNoneRecipeHandler.recipeDamageLens), new PageReconstructor(6, LensNoneRecipeHandler.recipeSoulSand).setNoText(), new PageReconstructor(7, LensNoneRecipeHandler.recipeLeather).setNoText(), new PageReconstructor(8, LensNoneRecipeHandler.recipeNetherWart).setNoText()).setImportant();
|
||||
new BookletChapter("miscDecorStuffsAndThings", ActuallyAdditionsAPI.entryMisc, new ItemStack(InitBlocks.blockTestifiBucksGreenWall), new PageTextOnly(1), new PageReconstructor(2, LensNoneRecipeHandler.recipeWhiteWall).setNoText(), new PageReconstructor(3, LensNoneRecipeHandler.recipeGreenWall).setNoText());
|
||||
new BookletChapter("quartz", ActuallyAdditionsAPI.entryMisc, new ItemStack(InitItems.itemMisc, 1, TheMiscItems.QUARTZ.ordinal()), new PageTextOnly(1).setStack(new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.ORE_QUARTZ.ordinal())).addTextReplacement("<lowest>", OreGen.QUARTZ_MIN).addTextReplacement("<highest>", OreGen.QUARTZ_MAX), new PageTextOnly(2).setStack(new ItemStack(InitItems.itemMisc, 1, TheMiscItems.QUARTZ.ordinal())), new PageCrafting(3, BlockCrafting.recipeQuartzBlock).setNoText(), new PageCrafting(4, BlockCrafting.recipeQuartzPillar).setNoText(), new PageCrafting(5, BlockCrafting.recipeQuartzChiseled).setNoText());
|
||||
new BookletChapter("cloud", ActuallyAdditionsAPI.entryMisc, new ItemStack(InitBlocks.blockSmileyCloud), new PageTextOnly(1), new PageCrafting(2, BlockCrafting.recipeSmileyCloud).setNoText().setPageStacksWildcard()).setSpecial().setIncomplete();
|
||||
|
@ -87,7 +87,7 @@ public class InitBooklet{
|
|||
new BookletChapter("dropper", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(InitBlocks.blockDropper), new PageTextOnly(1), new PageCrafting(2, BlockCrafting.recipeDropper).setNoText());
|
||||
new BookletChapter("phantomfaces", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(InitBlocks.blockPhantomLiquiface), new PageTextOnly(1).addTextReplacement("<range>", TileEntityPhantomface.RANGE), new PageTextOnly(2), new PageCrafting(3, BlockCrafting.recipePhantomface), new PageCrafting(4, BlockCrafting.recipeLiquiface), new PageCrafting(5, BlockCrafting.recipeEnergyface), new PageCrafting(6, ItemCrafting.recipePhantomConnector).setNoText(), new PageCrafting(7, BlockCrafting.recipePhantomBooster)).setImportant();
|
||||
new BookletChapter("phantomBreaker", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(InitBlocks.blockPhantomBreaker), new PageTextOnly(1).addTextReplacement("<range>", TileEntityPhantomPlacer.RANGE), new PageCrafting(2, BlockCrafting.recipePhantomPlacer).setNoText(), new PageCrafting(3, BlockCrafting.recipePhantomBreaker).setNoText());
|
||||
new BookletChapter("esd", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(InitBlocks.blockInputterAdvanced), new PageTextOnly(1), new PageCrafting(2, BlockCrafting.recipeESD).setNoText(), new PageCrafting(3, BlockCrafting.recipeAdvancedESD).setNoText()).setSpecial();
|
||||
new BookletChapter("esd", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(InitBlocks.blockInputterAdvanced), new PageTextOnly(1), new PageCrafting(2, BlockCrafting.recipeESD).setNoText(), new PageCrafting(3, BlockCrafting.recipeAdvancedESD).setNoText()).setSpecial().setIncomplete();
|
||||
new BookletChapter("xpSolidifier", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(InitBlocks.blockXPSolidifier), new PageTextOnly(1).setStack(new ItemStack(InitItems.itemSolidifiedExperience)), new PageCrafting(2, BlockCrafting.recipeSolidifier).setNoText()).setSpecial().setIncomplete();
|
||||
new BookletChapter("greenhouseGlass", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(InitBlocks.blockGreenhouseGlass), new PageTextOnly(1), new PageCrafting(2, BlockCrafting.recipeGlass));
|
||||
new BookletChapter("fishingNet", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(InitBlocks.blockFishingNet), new PageTextOnly(1), new PageCrafting(2, BlockCrafting.recipeFisher).setNoText());
|
||||
|
@ -111,7 +111,7 @@ public class InitBooklet{
|
|||
//RF Generating Blocks
|
||||
new BookletChapter("solarPanel", ActuallyAdditionsAPI.entryGeneratingRF, new ItemStack(InitBlocks.blockFurnaceSolar), new PageTextOnly(1).addTextReplacement("<rf>", TileEntityFurnaceSolar.PRODUCE), new PageCrafting(2, BlockCrafting.recipeSolar).setNoText());
|
||||
new BookletChapter("heatCollector", ActuallyAdditionsAPI.entryGeneratingRF, new ItemStack(InitBlocks.blockHeatCollector), new PageTextOnly(1).addTextReplacement("<rf>", TileEntityHeatCollector.ENERGY_PRODUCE).addTextReplacement("<min>", TileEntityHeatCollector.BLOCKS_NEEDED), new PageCrafting(2, BlockCrafting.recipeHeatCollector).setNoText());
|
||||
new BookletChapter("canola", ActuallyAdditionsAPI.entryGeneratingRF, new ItemStack(InitBlocks.blockFermentingBarrel), new PageTextOnly(1).setStack(new ItemStack(InitItems.itemMisc, 1, TheMiscItems.CANOLA.ordinal())).addTextReplacement("<pressRF>", TileEntityCanolaPress.ENERGY_USE).addTextReplacement("<canola>", TileEntityCanolaPress.PRODUCE).addTextReplacement("<rf>", TileEntityOilGenerator.ENERGY_PRODUCED), new PageCrafting(2, BlockCrafting.recipeCanolaPress).setNoText(), new PageCrafting(3, BlockCrafting.recipeFermentingBarrel).setNoText(), new PageCrafting(4, BlockCrafting.recipeOilGen).setNoText());
|
||||
new BookletChapter("canola", ActuallyAdditionsAPI.entryGeneratingRF, new ItemStack(InitBlocks.blockFermentingBarrel), new PageTextOnly(1).setStack(new ItemStack(InitItems.itemMisc, 1, TheMiscItems.CANOLA.ordinal())).addTextReplacement("<pressRF>", TileEntityCanolaPress.ENERGY_USE).addTextReplacement("<canola>", TileEntityCanolaPress.PRODUCE).addTextReplacement("<rf>", TileEntityOilGenerator.ENERGY_PRODUCED), new PageCrafting(2, BlockCrafting.recipeCanolaPress).setNoText(), new PageCrafting(3, BlockCrafting.recipeFermentingBarrel).setNoText(), new PageCrafting(4, BlockCrafting.recipeOilGen).setNoText().setPageStacksWildcard());
|
||||
new BookletChapter("leafGen", ActuallyAdditionsAPI.entryGeneratingRF, new ItemStack(InitBlocks.blockLeafGenerator), new PageTextOnly(1).addTextReplacement("<rf>", TileEntityLeafGenerator.ENERGY_PRODUCED).addTextReplacement("<range>", TileEntityLeafGenerator.RANGE), new PageCrafting(2, BlockCrafting.recipeLeafGen)).setImportant();
|
||||
|
||||
//No RF Using Items
|
||||
|
|
|
@ -50,11 +50,6 @@ public class BookletChapter implements IBookletChapter{
|
|||
return this.pages;
|
||||
}
|
||||
|
||||
public BookletChapter setIncomplete(){
|
||||
this.isIncomplete = true;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName(){
|
||||
return this.unlocalizedName;
|
||||
|
@ -80,6 +75,11 @@ public class BookletChapter implements IBookletChapter{
|
|||
return this.displayStack;
|
||||
}
|
||||
|
||||
public BookletChapter setIncomplete(){
|
||||
this.isIncomplete = true;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BookletChapter setImportant(){
|
||||
this.color = EnumChatFormatting.DARK_GREEN;
|
||||
return this;
|
||||
|
|
|
@ -33,29 +33,19 @@ public class BookletEntry implements IBookletEntry{
|
|||
this.color = EnumChatFormatting.RESET;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName(){
|
||||
return this.unlocalizedName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<IBookletChapter> getChapters(){
|
||||
return this.chapters;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getLocalizedNameWithFormatting(){
|
||||
return this.color+this.getLocalizedName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setChapters(List<IBookletChapter> chapters){
|
||||
this.chapters = chapters;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addChapter(IBookletChapter chapter){
|
||||
this.chapters.add(chapter);
|
||||
public String getUnlocalizedName(){
|
||||
return this.unlocalizedName;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -63,6 +53,16 @@ public class BookletEntry implements IBookletEntry{
|
|||
return StringUtil.localize("booklet."+ModUtil.MOD_ID_LOWER+".indexEntry."+this.unlocalizedName+".name");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getLocalizedNameWithFormatting(){
|
||||
return this.color+this.getLocalizedName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addChapter(IBookletChapter chapter){
|
||||
this.chapters.add(chapter);
|
||||
}
|
||||
|
||||
public BookletEntry setImportant(){
|
||||
this.color = EnumChatFormatting.DARK_GREEN;
|
||||
return this;
|
||||
|
|
|
@ -23,16 +23,16 @@ public class BookletEntryAllSearch extends BookletEntry{
|
|||
super(unlocalizedName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setChapters(List<IBookletChapter> chapters){
|
||||
this.allChapters = (ArrayList<IBookletChapter>)chapters;
|
||||
this.chapters = (ArrayList<IBookletChapter>)this.allChapters.clone();
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public void addChapter(IBookletChapter chapter){
|
||||
this.allChapters.add(chapter);
|
||||
this.chapters = (ArrayList<IBookletChapter>)this.allChapters.clone();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setChapters(List<IBookletChapter> chapters){
|
||||
this.allChapters = (ArrayList<IBookletChapter>)chapters;
|
||||
this.chapters = (ArrayList<IBookletChapter>)this.allChapters.clone();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -32,26 +32,11 @@ public class BookletPageAA extends BookletPage{
|
|||
this.localizationKey = localizationKey;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack[] getItemStacksForPage(){
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getClickToSeeRecipeString(){
|
||||
return EnumChatFormatting.GOLD+StringUtil.localize("booklet."+ModUtil.MOD_ID_LOWER+".clickToSeeRecipe");
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getID(){
|
||||
return Util.arrayContains(this.chapter.getPages(), this)+1;
|
||||
}
|
||||
|
||||
public BookletPage setNoText(){
|
||||
this.hasNoText = true;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public final String getText(){
|
||||
if(this.hasNoText){
|
||||
|
@ -74,12 +59,12 @@ public class BookletPageAA extends BookletPage{
|
|||
}
|
||||
|
||||
@Override
|
||||
public void render(IBookletGui gui, int mouseX, int mouseY, int ticksElapsed, boolean mousePressed){
|
||||
public void renderPre(IBookletGui gui, int mouseX, int mouseY, int ticksElapsed, boolean mousePressed){
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderPre(IBookletGui gui, int mouseX, int mouseY, int ticksElapsed, boolean mousePressed){
|
||||
public void render(IBookletGui gui, int mouseX, int mouseY, int ticksElapsed, boolean mousePressed){
|
||||
|
||||
}
|
||||
|
||||
|
@ -88,6 +73,21 @@ public class BookletPageAA extends BookletPage{
|
|||
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack[] getItemStacksForPage(){
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getClickToSeeRecipeString(){
|
||||
return EnumChatFormatting.GOLD+StringUtil.localize("booklet."+ModUtil.MOD_ID_LOWER+".clickToSeeRecipe");
|
||||
}
|
||||
|
||||
public BookletPage setNoText(){
|
||||
this.hasNoText = true;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BookletPageAA addTextReplacement(String text, int replacement){
|
||||
return this.addTextReplacement(text, Integer.toString(replacement));
|
||||
}
|
||||
|
|
|
@ -48,30 +48,6 @@ public class PageCrafting extends BookletPageAA{
|
|||
this.addToPagesWithItemStackData();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack[] getItemStacksForPage(){
|
||||
if(this.recipes != null){
|
||||
ItemStack[] stacks = new ItemStack[this.recipes.length];
|
||||
for(int i = 0; i < this.recipes.length; i++){
|
||||
if(this.recipes[i] != null){
|
||||
ItemStack output = this.recipes[i].getRecipeOutput();
|
||||
if(output != null){
|
||||
if(!this.arePageStacksWildcard){
|
||||
stacks[i] = output;
|
||||
}
|
||||
else{
|
||||
ItemStack wildcardOutput = output.copy();
|
||||
wildcardOutput.setItemDamage(Util.WILDCARD);
|
||||
stacks[i] = wildcardOutput;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return stacks;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void renderPre(IBookletGui gui, int mouseX, int mouseY, int ticksElapsed, boolean mousePressed){
|
||||
|
@ -187,4 +163,28 @@ public class PageCrafting extends BookletPageAA{
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack[] getItemStacksForPage(){
|
||||
if(this.recipes != null){
|
||||
ItemStack[] stacks = new ItemStack[this.recipes.length];
|
||||
for(int i = 0; i < this.recipes.length; i++){
|
||||
if(this.recipes[i] != null){
|
||||
ItemStack output = this.recipes[i].getRecipeOutput();
|
||||
if(output != null){
|
||||
if(!this.arePageStacksWildcard){
|
||||
stacks[i] = output;
|
||||
}
|
||||
else{
|
||||
ItemStack wildcardOutput = output.copy();
|
||||
wildcardOutput.setItemDamage(Util.WILDCARD);
|
||||
stacks[i] = wildcardOutput;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return stacks;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -39,11 +39,6 @@ public class PageCrusherRecipe extends BookletPageAA{
|
|||
this.addToPagesWithItemStackData();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack[] getItemStacksForPage(){
|
||||
return this.recipe == null ? new ItemStack[0] : this.recipe.getRecipeOutputOnes().toArray(new ItemStack[this.recipe.getRecipeOutputOnes().size()]);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void renderPre(IBookletGui gui, int mouseX, int mouseY, int ticksElapsed, boolean mousePressed){
|
||||
|
@ -129,4 +124,9 @@ public class PageCrusherRecipe extends BookletPageAA{
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack[] getItemStacksForPage(){
|
||||
return this.recipe == null ? new ItemStack[0] : this.recipe.getRecipeOutputOnes().toArray(new ItemStack[this.recipe.getRecipeOutputOnes().size()]);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -42,11 +42,6 @@ public class PageFurnace extends BookletPageAA{
|
|||
this.addToPagesWithItemStackData();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack[] getItemStacksForPage(){
|
||||
return this.result == null ? new ItemStack[0] : new ItemStack[]{this.result};
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void renderPre(IBookletGui gui, int mouseX, int mouseY, int ticksElapsed, boolean mousePressed){
|
||||
|
@ -98,6 +93,11 @@ public class PageFurnace extends BookletPageAA{
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack[] getItemStacksForPage(){
|
||||
return this.result == null ? new ItemStack[0] : new ItemStack[]{this.result};
|
||||
}
|
||||
|
||||
private ItemStack getInputForOutput(ItemStack output){
|
||||
for(Map.Entry o : FurnaceRecipes.instance().getSmeltingList().entrySet()){
|
||||
ItemStack stack = (ItemStack)(o).getValue();
|
||||
|
|
|
@ -43,20 +43,6 @@ public class PageReconstructor extends BookletPageAA{
|
|||
this.addToPagesWithItemStackData();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack[] getItemStacksForPage(){
|
||||
if(this.recipes != null){
|
||||
ArrayList<ItemStack> stacks = new ArrayList<ItemStack>();
|
||||
for(LensNoneRecipe recipe : this.recipes){
|
||||
if(recipe != null){
|
||||
stacks.addAll(recipe.getOutputs());
|
||||
}
|
||||
}
|
||||
return stacks.toArray(new ItemStack[stacks.size()]);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void renderPre(IBookletGui gui, int mouseX, int mouseY, int ticksElapsed, boolean mousePressed){
|
||||
|
@ -125,4 +111,18 @@ public class PageReconstructor extends BookletPageAA{
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack[] getItemStacksForPage(){
|
||||
if(this.recipes != null){
|
||||
ArrayList<ItemStack> stacks = new ArrayList<ItemStack>();
|
||||
for(LensNoneRecipe recipe : this.recipes){
|
||||
if(recipe != null){
|
||||
stacks.addAll(recipe.getOutputs());
|
||||
}
|
||||
}
|
||||
return stacks.toArray(new ItemStack[stacks.size()]);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -31,11 +31,6 @@ public class PageTextOnly extends BookletPageAA{
|
|||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack[] getItemStacksForPage(){
|
||||
return this.stack == null ? new ItemStack[0] : new ItemStack[]{this.stack};
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void renderPre(IBookletGui gui, int mouseX, int mouseY, int ticksElapsed, boolean mousePressed){
|
||||
|
@ -44,4 +39,9 @@ public class PageTextOnly extends BookletPageAA{
|
|||
StringUtil.drawSplitString(Minecraft.getMinecraft().fontRendererObj, text, gui.getGuiLeft()+14, gui.getGuiTop()+9, 115, 0, false);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack[] getItemStacksForPage(){
|
||||
return this.stack == null ? new ItemStack[0] : new ItemStack[]{this.stack};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,6 +12,7 @@ package de.ellpeck.actuallyadditions.mod.config;
|
|||
|
||||
public enum ConfigCategories{
|
||||
|
||||
PERFORMANCE("PERFORMANCE", "Performance Settings"),
|
||||
FOOD_CRAFTING("Food Crafting", "Crafting Recipes for Food Items"),
|
||||
BLOCKS_CRAFTING("Block Crafting", "Crafting Recipes for Blocks"),
|
||||
ITEMS_CRAFTING("Item Crafting", "Crafting Recipes for Items"),
|
||||
|
|
|
@ -33,6 +33,10 @@ public class ConfigValues{
|
|||
public static String[] minerExtraWhitelist;
|
||||
public static String[] minerBlacklist;
|
||||
|
||||
public static boolean lessSound;
|
||||
public static boolean lessParticles;
|
||||
public static boolean lessBlockBreakingEffects;
|
||||
|
||||
public static void defineConfigValues(Configuration config){
|
||||
|
||||
for(ConfigCrafting currConf : craftingConfig){
|
||||
|
@ -53,5 +57,9 @@ public class ConfigValues{
|
|||
plantDimensionBlacklist = config.get(ConfigCategories.WORLD_GEN.name, "Plant Blacklist", new int[0], "The IDs of the dimensions that Actually Additions Plants (Rice for example) are banned in").getIntList();
|
||||
minerExtraWhitelist = config.get(ConfigCategories.MACHINE_VALUES.name, "Vertical Digger Extra Whitelist", new String[0], "By default, the Vertical Digger mines everything that starts with 'ore' in the OreDictionary. If there is one that it can't mine, but should be able to, put its REGISTRY NAME here. These are the actual registered Item Names, the ones you use, for example, when using the /give Command. This Config Option only applies if the miner is in Ores Only Mode.").getStringList();
|
||||
minerBlacklist = config.get(ConfigCategories.MACHINE_VALUES.name, "Vertical Digger Blacklist", new String[0], "By default, the Vertical Digger mines everything that starts with 'ore' in the OreDictionary. If there is one that it can mine, but shouldn't be able to, put its REGISTRY NAME here. These are the actual registered Item Names, the ones you use, for example, when using the /give Command. This Config Option will apply in both modes.").getStringList();
|
||||
|
||||
lessSound = config.get(ConfigCategories.PERFORMANCE.name, "Less Sound", false, "If blocks in Actually Additions should have less sounds").getBoolean();
|
||||
lessParticles = config.get(ConfigCategories.PERFORMANCE.name, "Less Particles", false, "If blocks in Actually Additions should have less particles").getBoolean();
|
||||
lessBlockBreakingEffects = config.get(ConfigCategories.PERFORMANCE.name, "Less Block Breaking Effects", false, "If there should not be a sound effect and particles when a block is being destroyed by a breaker or similar").getBoolean();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,8 +15,6 @@ import de.ellpeck.actuallyadditions.mod.config.ConfigurationHandler;
|
|||
|
||||
public enum ConfigBoolValues{
|
||||
|
||||
LEAF_BLOWER_SOUND("Leaf Blower: Sound", ConfigCategories.TOOL_VALUES, true, "If the Leaf Blower makes Sounds"),
|
||||
|
||||
JAM_VILLAGER_EXISTS("Jam Villager: Existence", ConfigCategories.WORLD_GEN, true, "If the Jam Villager and his House exist"),
|
||||
CROP_FIELD_EXISTS("Crop Field: Existence", ConfigCategories.WORLD_GEN, true, "If the Custom Crop Fields exist"),
|
||||
|
||||
|
@ -53,7 +51,6 @@ public enum ConfigBoolValues{
|
|||
GIVE_BOOKLET_ON_FIRST_CRAFT("Give Booklet on First Craft", ConfigCategories.OTHER, true, "If the booklet should be given to the player when he first crafts something from the Mod"),
|
||||
|
||||
ENABLE_SEASONAL("Seasonal Mode", ConfigCategories.OTHER, true, "If Seasonal Mode is enabled"),
|
||||
LESS_LASER_RELAY_PARTICLES("Laser Relay: Particles", ConfigCategories.MACHINE_VALUES, false, "If the Laser Relay should have less laser particles to prevent lag"),
|
||||
|
||||
DUNGEON_LOOT("Dungeon Loot", ConfigCategories.OTHER, true, "Should Actually Additions Loot spawn in Dungeons");
|
||||
|
||||
|
|
|
@ -260,7 +260,7 @@ public class BlockCrafting{
|
|||
if(ConfigCrafting.ENDER_CASING.isEnabled()){
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.ENDER_CASING.ordinal()),
|
||||
"WSW", "SRS", "WSW",
|
||||
'W', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.ENDERPEARL_BLOCK.ordinal()),
|
||||
'W', new ItemStack(Items.ender_pearl),
|
||||
'R', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.QUARTZ.ordinal()),
|
||||
'S', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.DIAMOND.ordinal())));
|
||||
recipeEnderCase = Util.GetRecipes.lastIRecipe();
|
||||
|
|
|
@ -191,7 +191,7 @@ public class CreativeTab extends CreativeTabs{
|
|||
add(InitItems.itemPaxelCrystalGreen);
|
||||
add(InitItems.itemPaxelCrystalWhite);
|
||||
InitForeignPaxels.addToCreativeTab();
|
||||
|
||||
|
||||
add(InitBlocks.blockCrystal);
|
||||
add(InitItems.itemCrystal);
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
package de.ellpeck.actuallyadditions.mod.event;
|
||||
|
||||
|
||||
import de.ellpeck.actuallyadditions.mod.blocks.InitBlocks;
|
||||
import de.ellpeck.actuallyadditions.mod.fluids.InitFluids;
|
||||
import de.ellpeck.actuallyadditions.mod.items.InitItems;
|
||||
import de.ellpeck.actuallyadditions.mod.util.PosUtil;
|
||||
import net.minecraft.block.Block;
|
||||
|
@ -25,8 +25,8 @@ public class BucketFillEvent{
|
|||
|
||||
@SubscribeEvent
|
||||
public void onBucketFilled(FillBucketEvent event){
|
||||
this.fillBucket(event, InitItems.itemBucketOil, InitBlocks.blockOil);
|
||||
this.fillBucket(event, InitItems.itemBucketCanolaOil, InitBlocks.blockCanolaOil);
|
||||
this.fillBucket(event, InitItems.itemBucketOil, InitFluids.blockOil);
|
||||
this.fillBucket(event, InitItems.itemBucketCanolaOil, InitFluids.blockCanolaOil);
|
||||
}
|
||||
|
||||
private void fillBucket(FillBucketEvent event, Item item, Block fluid){
|
||||
|
|
|
@ -28,6 +28,19 @@ import java.util.Locale;
|
|||
|
||||
public class PlayerObtainEvents{
|
||||
|
||||
public static void checkAchievements(ItemStack gotten, EntityPlayer player, InitAchievements.Type type){
|
||||
for(int i = 0; i < TheAchievements.values().length; i++){
|
||||
TheAchievements ach = TheAchievements.values()[i];
|
||||
if(ach.type == type){
|
||||
if(gotten != null && ach.ach.theItemStack != null && gotten.getItem() == ach.ach.theItemStack.getItem()){
|
||||
if(gotten.getItemDamage() == ach.ach.theItemStack.getItemDamage()){
|
||||
player.addStat(ach.ach, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onCraftedEvent(PlayerEvent.ItemCraftedEvent event){
|
||||
checkAchievements(event.crafting, event.player, InitAchievements.Type.CRAFTING);
|
||||
|
@ -51,19 +64,6 @@ public class PlayerObtainEvents{
|
|||
}
|
||||
}
|
||||
|
||||
public static void checkAchievements(ItemStack gotten, EntityPlayer player, InitAchievements.Type type){
|
||||
for(int i = 0; i < TheAchievements.values().length; i++){
|
||||
TheAchievements ach = TheAchievements.values()[i];
|
||||
if(ach.type == type){
|
||||
if(gotten != null && ach.ach.theItemStack != null && gotten.getItem() == ach.ach.theItemStack.getItem()){
|
||||
if(gotten.getItemDamage() == ach.ach.theItemStack.getItemDamage()){
|
||||
player.addStat(ach.ach, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onSmeltedEvent(PlayerEvent.ItemSmeltedEvent event){
|
||||
checkAchievements(event.smelting, event.player, InitAchievements.Type.SMELTING);
|
||||
|
|
|
@ -16,11 +16,14 @@ import de.ellpeck.actuallyadditions.mod.util.ModUtil;
|
|||
import de.ellpeck.actuallyadditions.mod.util.StringUtil;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraftforge.event.entity.player.ItemTooltipEvent;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class TooltipEvent{
|
||||
|
||||
private static final String ADVANCED_INFO_TEXT_PRE = EnumChatFormatting.DARK_GRAY+" ";
|
||||
|
@ -58,6 +61,11 @@ public class TooltipEvent{
|
|||
event.toolTip.add(ADVANCED_INFO_TEXT_PRE+baseName);
|
||||
}
|
||||
|
||||
//Metadata
|
||||
int meta = event.itemStack.getItemDamage();
|
||||
event.toolTip.add(ADVANCED_INFO_HEADER_PRE+StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".meta.desc")+":");
|
||||
event.toolTip.add(ADVANCED_INFO_TEXT_PRE+meta);
|
||||
|
||||
//Unlocalized Name
|
||||
String metaName = event.itemStack.getItem().getUnlocalizedName(event.itemStack);
|
||||
if(metaName != null && baseName != null && !metaName.equals(baseName)){
|
||||
|
@ -65,8 +73,24 @@ public class TooltipEvent{
|
|||
event.toolTip.add(ADVANCED_INFO_TEXT_PRE+metaName);
|
||||
}
|
||||
|
||||
//NBT
|
||||
NBTTagCompound compound = event.itemStack.getTagCompound();
|
||||
if(compound != null && !compound.hasNoTags()){
|
||||
event.toolTip.add(ADVANCED_INFO_HEADER_PRE+StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".nbt.desc")+":");
|
||||
if(KeyUtil.isShiftPressed()){
|
||||
List<String> strgList = Minecraft.getMinecraft().fontRendererObj.listFormattedStringToWidth(compound.toString(), 200);
|
||||
for(String strg : strgList){
|
||||
event.toolTip.add(ADVANCED_INFO_TEXT_PRE+strg);
|
||||
}
|
||||
}
|
||||
else{
|
||||
event.toolTip.add(ADVANCED_INFO_TEXT_PRE+EnumChatFormatting.ITALIC+"["+StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".pressShift.desc")+"]");
|
||||
}
|
||||
}
|
||||
|
||||
//Disabling Info
|
||||
event.toolTip.addAll(Minecraft.getMinecraft().fontRendererObj.listFormattedStringToWidth(EnumChatFormatting.ITALIC+StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".disablingInfo.desc"), 200));
|
||||
|
||||
}
|
||||
else{
|
||||
if(ConfigBoolValues.CTRL_INFO_FOR_EXTRA_INFO.isEnabled()){
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
* © 2016 Ellpeck
|
||||
*/
|
||||
|
||||
package de.ellpeck.actuallyadditions.mod.blocks;
|
||||
package de.ellpeck.actuallyadditions.mod.fluids;
|
||||
|
||||
import de.ellpeck.actuallyadditions.mod.util.ModUtil;
|
||||
import net.minecraft.util.ResourceLocation;
|
|
@ -0,0 +1,75 @@
|
|||
/*
|
||||
* This file ("InitFluids.java") is part of the Actually Additions Mod for Minecraft.
|
||||
* It is created and owned by Ellpeck and distributed
|
||||
* under the Actually Additions License to be found at
|
||||
* http://ellpeck.de/actaddlicense/
|
||||
* View the source code at https://github.com/Ellpeck/ActuallyAdditions
|
||||
*
|
||||
* © 2016 Ellpeck
|
||||
*/
|
||||
|
||||
package de.ellpeck.actuallyadditions.mod.fluids;
|
||||
|
||||
import de.ellpeck.actuallyadditions.mod.blocks.base.BlockFluidFlowing;
|
||||
import de.ellpeck.actuallyadditions.mod.config.values.ConfigBoolValues;
|
||||
import de.ellpeck.actuallyadditions.mod.util.ModUtil;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidRegistry;
|
||||
|
||||
public class InitFluids{
|
||||
|
||||
public static Fluid fluidCanolaOil;
|
||||
public static Fluid fluidOil;
|
||||
|
||||
public static Block blockCanolaOil;
|
||||
public static Block blockOil;
|
||||
|
||||
public static void init(){
|
||||
//Canola Fluid
|
||||
String canolaOil = "canolaoil";
|
||||
if(!FluidRegistry.isFluidRegistered(canolaOil) || ConfigBoolValues.PREVENT_CANOLA_OVERRIDE.isEnabled()){
|
||||
fluidCanolaOil = new FluidAA(canolaOil, "blockCanolaOil").setRarity(EnumRarity.UNCOMMON);
|
||||
FluidRegistry.registerFluid(fluidCanolaOil);
|
||||
}
|
||||
else{
|
||||
errorAlreadyRegistered("Canola Oil Fluid");
|
||||
}
|
||||
fluidCanolaOil = FluidRegistry.getFluid(canolaOil);
|
||||
|
||||
//Canola Block
|
||||
if(fluidCanolaOil.getBlock() == null || ConfigBoolValues.PREVENT_CANOLA_BLOCK_OVERRIDE.isEnabled()){
|
||||
blockCanolaOil = new BlockFluidFlowing(fluidCanolaOil, Material.water, "blockCanolaOil");
|
||||
}
|
||||
else{
|
||||
errorAlreadyRegistered("Canola Oil Block");
|
||||
}
|
||||
blockCanolaOil = fluidCanolaOil.getBlock();
|
||||
|
||||
//Oil Fluid
|
||||
String oil = "oil";
|
||||
if(!FluidRegistry.isFluidRegistered(oil) || ConfigBoolValues.PREVENT_OIL_OVERRIDE.isEnabled()){
|
||||
fluidOil = new FluidAA(oil, "blockOil").setRarity(EnumRarity.UNCOMMON);
|
||||
FluidRegistry.registerFluid(fluidOil);
|
||||
}
|
||||
else{
|
||||
errorAlreadyRegistered("Oil Fluid");
|
||||
}
|
||||
fluidOil = FluidRegistry.getFluid(oil);
|
||||
|
||||
//Oil Block
|
||||
if(fluidOil.getBlock() == null || ConfigBoolValues.PREVENT_OIL_BLOCK_OVERRIDE.isEnabled()){
|
||||
blockOil = new BlockFluidFlowing(fluidOil, Material.water, "blockOil");
|
||||
}
|
||||
else{
|
||||
errorAlreadyRegistered("Oil Block");
|
||||
}
|
||||
blockOil = fluidOil.getBlock();
|
||||
}
|
||||
|
||||
public static void errorAlreadyRegistered(String str){
|
||||
ModUtil.LOGGER.warn(str+" from "+ModUtil.NAME+" is not getting used as it has already been registered by another Mod! If this causes Issues (which it shouldn't!), you can turn this off in the Config File!");
|
||||
}
|
||||
}
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
package de.ellpeck.actuallyadditions.mod.inventory;
|
||||
|
||||
import de.ellpeck.actuallyadditions.mod.blocks.InitBlocks;
|
||||
import de.ellpeck.actuallyadditions.mod.fluids.InitFluids;
|
||||
import de.ellpeck.actuallyadditions.mod.inventory.slot.SlotOutput;
|
||||
import de.ellpeck.actuallyadditions.mod.items.InitItems;
|
||||
import de.ellpeck.actuallyadditions.mod.items.metalists.TheMiscItems;
|
||||
|
@ -68,7 +68,7 @@ public class ContainerCanolaPress extends Container{
|
|||
return null;
|
||||
}
|
||||
}
|
||||
else if(FluidContainerRegistry.getContainerCapacity(new FluidStack(InitBlocks.fluidCanolaOil, 1), newStack) > 0){
|
||||
else if(FluidContainerRegistry.getContainerCapacity(new FluidStack(InitFluids.fluidCanolaOil, 1), newStack) > 0){
|
||||
if(!this.mergeItemStack(newStack, 1, 2, false)){
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
package de.ellpeck.actuallyadditions.mod.inventory;
|
||||
|
||||
import de.ellpeck.actuallyadditions.mod.blocks.InitBlocks;
|
||||
import de.ellpeck.actuallyadditions.mod.fluids.InitFluids;
|
||||
import de.ellpeck.actuallyadditions.mod.inventory.slot.SlotOutput;
|
||||
import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase;
|
||||
import de.ellpeck.actuallyadditions.mod.tile.TileEntityFermentingBarrel;
|
||||
|
@ -62,12 +62,12 @@ public class ContainerFermentingBarrel extends Container{
|
|||
//Other Slots in Inventory excluded
|
||||
if(slot >= inventoryStart){
|
||||
//Shift from Inventory
|
||||
if(FluidContainerRegistry.containsFluid(newStack, new FluidStack(InitBlocks.fluidCanolaOil, 1))){
|
||||
if(FluidContainerRegistry.containsFluid(newStack, new FluidStack(InitFluids.fluidCanolaOil, 1))){
|
||||
if(!this.mergeItemStack(newStack, 0, 1, false)){
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else if(FluidContainerRegistry.getContainerCapacity(new FluidStack(InitBlocks.fluidOil, 1), newStack) > 0){
|
||||
else if(FluidContainerRegistry.getContainerCapacity(new FluidStack(InitFluids.fluidOil, 1), newStack) > 0){
|
||||
if(!this.mergeItemStack(newStack, 2, 3, false)){
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
package de.ellpeck.actuallyadditions.mod.inventory;
|
||||
|
||||
import de.ellpeck.actuallyadditions.mod.blocks.InitBlocks;
|
||||
import de.ellpeck.actuallyadditions.mod.fluids.InitFluids;
|
||||
import de.ellpeck.actuallyadditions.mod.inventory.slot.SlotOutput;
|
||||
import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase;
|
||||
import de.ellpeck.actuallyadditions.mod.tile.TileEntityOilGenerator;
|
||||
|
@ -60,7 +60,7 @@ public class ContainerOilGenerator extends Container{
|
|||
//Other Slots in Inventory excluded
|
||||
if(slot >= inventoryStart){
|
||||
//Shift from Inventory
|
||||
if(FluidContainerRegistry.containsFluid(newStack, new FluidStack(InitBlocks.fluidOil, 1))){
|
||||
if(FluidContainerRegistry.containsFluid(newStack, new FluidStack(InitFluids.fluidOil, 1))){
|
||||
if(!this.mergeItemStack(newStack, 0, 1, false)){
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -84,6 +84,7 @@ public class GuiGrinder extends GuiContainer{
|
|||
}
|
||||
|
||||
public static class GuiGrinderDouble extends GuiGrinder{
|
||||
|
||||
public GuiGrinderDouble(InventoryPlayer inventory, TileEntityBase tile){
|
||||
super(inventory, tile, true);
|
||||
}
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
package de.ellpeck.actuallyadditions.mod.items;
|
||||
|
||||
import de.ellpeck.actuallyadditions.mod.blocks.InitBlocks;
|
||||
import de.ellpeck.actuallyadditions.mod.fluids.InitFluids;
|
||||
import de.ellpeck.actuallyadditions.mod.items.base.*;
|
||||
import de.ellpeck.actuallyadditions.mod.items.lens.ItemLens;
|
||||
import de.ellpeck.actuallyadditions.mod.items.lens.Lenses;
|
||||
|
@ -170,7 +171,7 @@ public class InitItems{
|
|||
public static Item itemPantsCrystalLightBlue;
|
||||
public static Item itemBootsCrystalLightBlue;
|
||||
public static Item itemPaxelCrystalLightBlue;
|
||||
|
||||
|
||||
public static Item itemPickaxeCrystalBlack;
|
||||
public static Item itemAxeCrystalBlack;
|
||||
public static Item itemShovelCrystalBlack;
|
||||
|
@ -203,7 +204,7 @@ public class InitItems{
|
|||
public static Item itemPantsCrystalWhite;
|
||||
public static Item itemBootsCrystalWhite;
|
||||
public static Item itemPaxelCrystalWhite;
|
||||
|
||||
|
||||
public static void init(){
|
||||
ModUtil.LOGGER.info("Initializing Items...");
|
||||
|
||||
|
@ -248,10 +249,10 @@ public class InitItems{
|
|||
itemDrillUpgradeThreeByThree = new ItemDrillUpgrade(ItemDrillUpgrade.UpgradeType.THREE_BY_THREE, "itemDrillUpgradeThreeByThree");
|
||||
itemDrillUpgradeFiveByFive = new ItemDrillUpgrade(ItemDrillUpgrade.UpgradeType.FIVE_BY_FIVE, "itemDrillUpgradeFiveByFive");
|
||||
itemDrillUpgradeBlockPlacing = new ItemDrillUpgrade(ItemDrillUpgrade.UpgradeType.PLACER, "itemDrillUpgradeBlockPlacing");
|
||||
itemBucketOil = new ItemBucketAA(InitBlocks.blockOil, "itemBucketOil");
|
||||
FluidContainerRegistry.registerFluidContainer(InitBlocks.fluidOil, new ItemStack(itemBucketOil), FluidContainerRegistry.EMPTY_BUCKET);
|
||||
itemBucketCanolaOil = new ItemBucketAA(InitBlocks.blockCanolaOil, "itemBucketCanolaOil");
|
||||
FluidContainerRegistry.registerFluidContainer(InitBlocks.fluidCanolaOil, new ItemStack(itemBucketCanolaOil), FluidContainerRegistry.EMPTY_BUCKET);
|
||||
itemBucketOil = new ItemBucketAA(InitFluids.blockOil, "itemBucketOil");
|
||||
FluidContainerRegistry.registerFluidContainer(InitFluids.fluidOil, new ItemStack(itemBucketOil), FluidContainerRegistry.EMPTY_BUCKET);
|
||||
itemBucketCanolaOil = new ItemBucketAA(InitFluids.blockCanolaOil, "itemBucketCanolaOil");
|
||||
FluidContainerRegistry.registerFluidContainer(InitFluids.fluidCanolaOil, new ItemStack(itemBucketCanolaOil), FluidContainerRegistry.EMPTY_BUCKET);
|
||||
itemFertilizer = new ItemFertilizer("itemFertilizer");
|
||||
itemCoffee = new ItemCoffee("itemCoffee");
|
||||
itemPhantomConnector = new ItemPhantomConnector("itemPhantomConnector");
|
||||
|
|
|
@ -52,16 +52,6 @@ public class ItemBooklet extends ItemBase implements IHudDisplay{
|
|||
this.setMaxDamage(0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player){
|
||||
player.openGui(ActuallyAdditions.instance, GuiHandler.GuiTypes.BOOK.ordinal(), world, (int)player.posX, (int)player.posY, (int)player.posZ);
|
||||
|
||||
if(!world.isRemote){
|
||||
player.triggerAchievement(TheAchievements.OPEN_BOOKLET.ach);
|
||||
}
|
||||
return stack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumFacing face, float hitX, float hitY, float hitZ){
|
||||
if(player.isSneaking()){
|
||||
|
@ -81,6 +71,16 @@ public class ItemBooklet extends ItemBase implements IHudDisplay{
|
|||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player){
|
||||
player.openGui(ActuallyAdditions.instance, GuiHandler.GuiTypes.BOOK.ordinal(), world, (int)player.posX, (int)player.posY, (int)player.posZ);
|
||||
|
||||
if(!world.isRemote){
|
||||
player.triggerAchievement(TheAchievements.OPEN_BOOKLET.ach);
|
||||
}
|
||||
return stack;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean bool){
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
package de.ellpeck.actuallyadditions.mod.items;
|
||||
|
||||
import de.ellpeck.actuallyadditions.mod.blocks.InitBlocks;
|
||||
import de.ellpeck.actuallyadditions.mod.config.ConfigValues;
|
||||
import de.ellpeck.actuallyadditions.mod.items.base.ItemBase;
|
||||
import de.ellpeck.actuallyadditions.mod.tile.TileEntityGiantChest;
|
||||
import de.ellpeck.actuallyadditions.mod.util.PosUtil;
|
||||
|
@ -51,7 +52,9 @@ public class ItemChestToCrateUpgrade extends ItemBase{
|
|||
}
|
||||
|
||||
//Set New Block
|
||||
world.playAuxSFX(2001, pos, Block.getIdFromBlock(block)+(PosUtil.getMetadata(pos, world) << 12));
|
||||
if(!ConfigValues.lessBlockBreakingEffects){
|
||||
world.playAuxSFX(2001, pos, Block.getStateId(world.getBlockState(pos)));
|
||||
}
|
||||
PosUtil.setBlock(pos, world, InitBlocks.blockGiantChest, 0, 2);
|
||||
|
||||
//Copy Items into new Chest
|
||||
|
|
|
@ -72,6 +72,15 @@ public class ItemCoffee extends ItemFoodBase{
|
|||
return null;
|
||||
}
|
||||
|
||||
public static void applyPotionEffectsFromStack(ItemStack stack, EntityPlayer player){
|
||||
PotionEffect[] effects = CoffeeBrewing.getEffectsFromStack(stack);
|
||||
if(effects != null && effects.length > 0){
|
||||
for(PotionEffect effect : effects){
|
||||
player.addPotionEffect(new PotionEffect(effect.getPotionID(), effect.getDuration()*20, effect.getAmplifier()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemUseFinish(ItemStack stack, World world, EntityPlayer player){
|
||||
ItemStack theStack = stack.copy();
|
||||
|
@ -86,15 +95,6 @@ public class ItemCoffee extends ItemFoodBase{
|
|||
}
|
||||
}
|
||||
|
||||
public static void applyPotionEffectsFromStack(ItemStack stack, EntityPlayer player){
|
||||
PotionEffect[] effects = CoffeeBrewing.getEffectsFromStack(stack);
|
||||
if(effects != null && effects.length > 0){
|
||||
for(PotionEffect effect : effects){
|
||||
player.addPotionEffect(new PotionEffect(effect.getPotionID(), effect.getDuration()*20, effect.getAmplifier()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumAction getItemUseAction(ItemStack stack){
|
||||
return EnumAction.DRINK;
|
||||
|
|
|
@ -48,6 +48,14 @@ public class ItemCrystal extends ItemBase{
|
|||
return stack.getItemDamage() >= BlockCrystal.allCrystals.length ? EnumRarity.COMMON : BlockCrystal.allCrystals[stack.getItemDamage()].rarity;
|
||||
}
|
||||
|
||||
@SuppressWarnings("all")
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs tab, List list){
|
||||
for(int j = 0; j < BlockCrystal.allCrystals.length; j++){
|
||||
list.add(new ItemStack(this, 1, j));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void registerRendering(){
|
||||
ResourceLocation[] resLocs = new ResourceLocation[BlockCrystal.allCrystals.length];
|
||||
|
@ -58,12 +66,4 @@ public class ItemCrystal extends ItemBase{
|
|||
}
|
||||
ActuallyAdditions.proxy.addRenderVariant(this, resLocs);
|
||||
}
|
||||
|
||||
@SuppressWarnings("all")
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs tab, List list){
|
||||
for(int j = 0; j < BlockCrystal.allCrystals.length; j++){
|
||||
list.add(new ItemStack(this, 1, j));
|
||||
}
|
||||
}
|
||||
}
|
|
@ -107,17 +107,6 @@ public class ItemDrill extends ItemEnergy{
|
|||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void registerRendering(){
|
||||
ResourceLocation[] resLocs = new ResourceLocation[16];
|
||||
for(int i = 0; i < 16; i++){
|
||||
String name = this.getBaseName()+TheColoredLampColors.values()[i].name;
|
||||
resLocs[i] = new ResourceLocation(ModUtil.MOD_ID_LOWER, name);
|
||||
ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this, 1, i), new ResourceLocation(ModUtil.MOD_ID_LOWER, name));
|
||||
}
|
||||
ActuallyAdditions.proxy.addRenderVariant(this, resLocs);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if a certain Upgrade is installed and returns it as an ItemStack
|
||||
*
|
||||
|
@ -342,6 +331,17 @@ public class ItemDrill extends ItemEnergy{
|
|||
return this.getHasUpgradeAsStack(stack, upgrade) != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void registerRendering(){
|
||||
ResourceLocation[] resLocs = new ResourceLocation[16];
|
||||
for(int i = 0; i < 16; i++){
|
||||
String name = this.getBaseName()+TheColoredLampColors.values()[i].name;
|
||||
resLocs[i] = new ResourceLocation(ModUtil.MOD_ID_LOWER, name);
|
||||
ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this, 1, i), new ResourceLocation(ModUtil.MOD_ID_LOWER, name));
|
||||
}
|
||||
ActuallyAdditions.proxy.addRenderVariant(this, resLocs);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
@SideOnly(Side.CLIENT)
|
||||
|
|
|
@ -24,6 +24,7 @@ public class ItemKnife extends ItemBase{
|
|||
this.setMaxDamage(100);
|
||||
this.setMaxStackSize(1);
|
||||
this.setContainerItem(this);
|
||||
this.setNoRepair();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
package de.ellpeck.actuallyadditions.mod.items;
|
||||
|
||||
import de.ellpeck.actuallyadditions.mod.config.values.ConfigBoolValues;
|
||||
import de.ellpeck.actuallyadditions.mod.config.ConfigValues;
|
||||
import de.ellpeck.actuallyadditions.mod.items.base.ItemBase;
|
||||
import de.ellpeck.actuallyadditions.mod.util.PosUtil;
|
||||
import net.minecraft.block.Block;
|
||||
|
@ -66,7 +66,7 @@ public class ItemLeafBlower extends ItemBase{
|
|||
//Breaks the Blocks
|
||||
this.breakStuff(player.worldObj, MathHelper.floor_double(player.posX), MathHelper.floor_double(player.posY), MathHelper.floor_double(player.posZ));
|
||||
//Plays a Minecart sounds (It really sounds like a Leaf Blower!)
|
||||
if(ConfigBoolValues.LEAF_BLOWER_SOUND.isEnabled()){
|
||||
if(!ConfigValues.lessSound){
|
||||
player.worldObj.playSoundAtEntity(player, "minecart.base", 0.3F, 0.001F);
|
||||
}
|
||||
}
|
||||
|
@ -106,14 +106,16 @@ public class ItemLeafBlower extends ItemBase{
|
|||
Block theBlock = PosUtil.getBlock(theCoord, world);
|
||||
|
||||
ArrayList<ItemStack> drops = new ArrayList<ItemStack>();
|
||||
int meta = PosUtil.getMetadata(theCoord, world);
|
||||
//Gets all of the Drops the Block should have
|
||||
drops.addAll(theBlock.getDrops(world, theCoord, world.getBlockState(theCoord), 0));
|
||||
|
||||
//Plays the Breaking Sound
|
||||
if(!ConfigValues.lessBlockBreakingEffects){
|
||||
world.playAuxSFX(2001, theCoord, Block.getStateId(world.getBlockState(theCoord)));
|
||||
}
|
||||
|
||||
//Deletes the Block
|
||||
world.setBlockToAir(theCoord);
|
||||
//Plays the Breaking Sound
|
||||
world.playAuxSFX(2001, theCoord, Block.getIdFromBlock(theBlock)+(meta << 12));
|
||||
|
||||
for(ItemStack theDrop : drops){
|
||||
//Drops the Items into the World
|
||||
|
|
|
@ -39,6 +39,45 @@ public class ItemPhantomConnector extends ItemBase{
|
|||
this.setMaxStackSize(1);
|
||||
}
|
||||
|
||||
public static World getStoredWorld(ItemStack stack){
|
||||
NBTTagCompound tag = stack.getTagCompound();
|
||||
if(tag != null){
|
||||
return DimensionManager.getWorld(tag.getInteger("WorldOfTileStored"));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static BlockPos getStoredPosition(ItemStack stack){
|
||||
NBTTagCompound tag = stack.getTagCompound();
|
||||
if(tag != null){
|
||||
int x = tag.getInteger("XCoordOfTileStored");
|
||||
int y = tag.getInteger("YCoordOfTileStored");
|
||||
int z = tag.getInteger("ZCoordOfTileStored");
|
||||
if(!(x == 0 && y == 0 && z == 0)){
|
||||
return new BlockPos(x, y, z);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static void clearStorage(ItemStack stack){
|
||||
stack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
|
||||
public static void storeConnection(ItemStack stack, int x, int y, int z, World world){
|
||||
NBTTagCompound tag = stack.getTagCompound();
|
||||
if(tag == null){
|
||||
tag = new NBTTagCompound();
|
||||
}
|
||||
|
||||
tag.setInteger("XCoordOfTileStored", x);
|
||||
tag.setInteger("YCoordOfTileStored", y);
|
||||
tag.setInteger("ZCoordOfTileStored", z);
|
||||
tag.setInteger("WorldOfTileStored", world.provider.getDimensionId());
|
||||
|
||||
stack.setTagCompound(tag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumFacing par7, float par8, float par9, float par10){
|
||||
if(!world.isRemote){
|
||||
|
@ -79,45 +118,6 @@ public class ItemPhantomConnector extends ItemBase{
|
|||
}
|
||||
}
|
||||
|
||||
public static BlockPos getStoredPosition(ItemStack stack){
|
||||
NBTTagCompound tag = stack.getTagCompound();
|
||||
if(tag != null){
|
||||
int x = tag.getInteger("XCoordOfTileStored");
|
||||
int y = tag.getInteger("YCoordOfTileStored");
|
||||
int z = tag.getInteger("ZCoordOfTileStored");
|
||||
if(!(x == 0 && y == 0 && z == 0)){
|
||||
return new BlockPos(x, y, z);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static World getStoredWorld(ItemStack stack){
|
||||
NBTTagCompound tag = stack.getTagCompound();
|
||||
if(tag != null){
|
||||
return DimensionManager.getWorld(tag.getInteger("WorldOfTileStored"));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static void clearStorage(ItemStack stack){
|
||||
stack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
|
||||
public static void storeConnection(ItemStack stack, int x, int y, int z, World world){
|
||||
NBTTagCompound tag = stack.getTagCompound();
|
||||
if(tag == null){
|
||||
tag = new NBTTagCompound();
|
||||
}
|
||||
|
||||
tag.setInteger("XCoordOfTileStored", x);
|
||||
tag.setInteger("YCoordOfTileStored", y);
|
||||
tag.setInteger("ZCoordOfTileStored", z);
|
||||
tag.setInteger("WorldOfTileStored", world.provider.getDimensionId());
|
||||
|
||||
stack.setTagCompound(tag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getShareTag(){
|
||||
return true;
|
||||
|
|
|
@ -47,6 +47,11 @@ public class ItemAllToolAA extends ItemTool{
|
|||
private ItemStack repairItem;
|
||||
private String repairOredict;
|
||||
|
||||
public ItemAllToolAA(ToolMaterial toolMat, String repairItem, String unlocalizedName, EnumRarity rarity, int color){
|
||||
this(toolMat, (ItemStack)null, unlocalizedName, rarity, color);
|
||||
this.repairOredict = repairItem;
|
||||
}
|
||||
|
||||
public ItemAllToolAA(ToolMaterial toolMat, ItemStack repairItem, String unlocalizedName, EnumRarity rarity, int color){
|
||||
super(4.0F, toolMat, new HashSet<Block>());
|
||||
|
||||
|
@ -60,11 +65,6 @@ public class ItemAllToolAA extends ItemTool{
|
|||
this.register();
|
||||
}
|
||||
|
||||
public ItemAllToolAA(ToolMaterial toolMat, String repairItem, String unlocalizedName, EnumRarity rarity, int color){
|
||||
this(toolMat, (ItemStack)null, unlocalizedName, rarity, color);
|
||||
this.repairOredict = repairItem;
|
||||
}
|
||||
|
||||
private void register(){
|
||||
this.setUnlocalizedName(ModUtil.MOD_ID_LOWER+"."+this.getBaseName());
|
||||
GameRegistry.registerItem(this, this.getBaseName());
|
||||
|
@ -79,11 +79,6 @@ public class ItemAllToolAA extends ItemTool{
|
|||
this.registerRendering();
|
||||
}
|
||||
|
||||
protected void registerRendering(){
|
||||
ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this), new ResourceLocation(ModUtil.MOD_ID_LOWER, "itemPaxel"));
|
||||
ActuallyAdditions.proxy.addRenderVariant(this, new ResourceLocation(ModUtil.MOD_ID_LOWER, "itemPaxel"));
|
||||
}
|
||||
|
||||
protected String getBaseName(){
|
||||
return this.name;
|
||||
}
|
||||
|
@ -92,6 +87,11 @@ public class ItemAllToolAA extends ItemTool{
|
|||
return true;
|
||||
}
|
||||
|
||||
protected void registerRendering(){
|
||||
ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this), new ResourceLocation(ModUtil.MOD_ID_LOWER, "itemPaxel"));
|
||||
ActuallyAdditions.proxy.addRenderVariant(this, new ResourceLocation(ModUtil.MOD_ID_LOWER, "itemPaxel"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onItemUse(ItemStack stack, EntityPlayer playerIn, World worldIn, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ){
|
||||
if(!playerIn.canPlayerEdit(pos.offset(side), side, stack)){
|
||||
|
|
|
@ -26,6 +26,10 @@ public class ItemArmorAA extends ItemArmor{
|
|||
private String name;
|
||||
private EnumRarity rarity;
|
||||
|
||||
public ItemArmorAA(String name, ArmorMaterial material, int type, ItemStack repairItem, String textureBase){
|
||||
this(name, material, type, repairItem, textureBase, EnumRarity.RARE);
|
||||
}
|
||||
|
||||
public ItemArmorAA(String name, ArmorMaterial material, int type, ItemStack repairItem, String textureBase, EnumRarity rarity){
|
||||
super(material, 0, type);
|
||||
this.repairItem = repairItem;
|
||||
|
@ -35,10 +39,6 @@ public class ItemArmorAA extends ItemArmor{
|
|||
this.register();
|
||||
}
|
||||
|
||||
public ItemArmorAA(String name, ArmorMaterial material, int type, ItemStack repairItem, String textureBase){
|
||||
this(name, material, type, repairItem, textureBase, EnumRarity.RARE);
|
||||
}
|
||||
|
||||
private void register(){
|
||||
this.setUnlocalizedName(ModUtil.MOD_ID_LOWER+"."+this.getBaseName());
|
||||
GameRegistry.registerItem(this, this.getBaseName());
|
||||
|
@ -52,10 +52,6 @@ public class ItemArmorAA extends ItemArmor{
|
|||
this.registerRendering();
|
||||
}
|
||||
|
||||
protected void registerRendering(){
|
||||
ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this), new ResourceLocation(ModUtil.MOD_ID_LOWER, this.getBaseName()));
|
||||
}
|
||||
|
||||
protected String getBaseName(){
|
||||
return this.name;
|
||||
}
|
||||
|
@ -64,6 +60,10 @@ public class ItemArmorAA extends ItemArmor{
|
|||
return true;
|
||||
}
|
||||
|
||||
protected void registerRendering(){
|
||||
ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this), new ResourceLocation(ModUtil.MOD_ID_LOWER, this.getBaseName()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumRarity getRarity(ItemStack stack){
|
||||
return this.rarity;
|
||||
|
|
|
@ -49,10 +49,6 @@ public class ItemAxeAA extends ItemAxe{
|
|||
this.registerRendering();
|
||||
}
|
||||
|
||||
protected void registerRendering(){
|
||||
ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this), new ResourceLocation(ModUtil.MOD_ID_LOWER, this.getBaseName()));
|
||||
}
|
||||
|
||||
protected String getBaseName(){
|
||||
return this.name;
|
||||
}
|
||||
|
@ -61,6 +57,10 @@ public class ItemAxeAA extends ItemAxe{
|
|||
return true;
|
||||
}
|
||||
|
||||
protected void registerRendering(){
|
||||
ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this), new ResourceLocation(ModUtil.MOD_ID_LOWER, this.getBaseName()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getIsRepairable(ItemStack itemToRepair, ItemStack stack){
|
||||
return ItemUtil.areItemsEqual(this.repairItem, stack, false);
|
||||
|
|
|
@ -42,10 +42,6 @@ public class ItemBase extends Item{
|
|||
this.registerRendering();
|
||||
}
|
||||
|
||||
protected void registerRendering(){
|
||||
ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this), new ResourceLocation(ModUtil.MOD_ID_LOWER, this.getBaseName()));
|
||||
}
|
||||
|
||||
protected String getBaseName(){
|
||||
return this.name;
|
||||
}
|
||||
|
@ -53,4 +49,8 @@ public class ItemBase extends Item{
|
|||
public boolean shouldAddCreative(){
|
||||
return true;
|
||||
}
|
||||
|
||||
protected void registerRendering(){
|
||||
ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this), new ResourceLocation(ModUtil.MOD_ID_LOWER, this.getBaseName()));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -46,10 +46,6 @@ public class ItemBucketAA extends ItemBucket{
|
|||
this.registerRendering();
|
||||
}
|
||||
|
||||
protected void registerRendering(){
|
||||
ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this), new ResourceLocation(ModUtil.MOD_ID_LOWER, this.getBaseName()));
|
||||
}
|
||||
|
||||
protected String getBaseName(){
|
||||
return this.name;
|
||||
}
|
||||
|
@ -58,6 +54,10 @@ public class ItemBucketAA extends ItemBucket{
|
|||
return true;
|
||||
}
|
||||
|
||||
protected void registerRendering(){
|
||||
ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this), new ResourceLocation(ModUtil.MOD_ID_LOWER, this.getBaseName()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumRarity getRarity(ItemStack stack){
|
||||
return EnumRarity.UNCOMMON;
|
||||
|
|
|
@ -53,10 +53,6 @@ public abstract class ItemEnergy extends ItemEnergyContainer{
|
|||
this.registerRendering();
|
||||
}
|
||||
|
||||
protected void registerRendering(){
|
||||
ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this), new ResourceLocation(ModUtil.MOD_ID_LOWER, this.getBaseName()));
|
||||
}
|
||||
|
||||
protected String getBaseName(){
|
||||
return this.name;
|
||||
}
|
||||
|
@ -65,6 +61,10 @@ public abstract class ItemEnergy extends ItemEnergyContainer{
|
|||
return true;
|
||||
}
|
||||
|
||||
protected void registerRendering(){
|
||||
ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this), new ResourceLocation(ModUtil.MOD_ID_LOWER, this.getBaseName()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getShareTag(){
|
||||
return true;
|
||||
|
@ -81,6 +81,12 @@ public abstract class ItemEnergy extends ItemEnergyContainer{
|
|||
list.add(this.getEnergyStored(stack)+"/"+this.getMaxEnergyStored(stack)+" RF");
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean hasEffect(ItemStack stack){
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
@SideOnly(Side.CLIENT)
|
||||
|
@ -106,12 +112,6 @@ public abstract class ItemEnergy extends ItemEnergyContainer{
|
|||
return energyDif/maxAmount;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean hasEffect(ItemStack stack){
|
||||
return false;
|
||||
}
|
||||
|
||||
public void setEnergy(ItemStack stack, int energy){
|
||||
NBTTagCompound compound = stack.getTagCompound();
|
||||
if(compound == null){
|
||||
|
|
|
@ -43,10 +43,6 @@ public class ItemFoodBase extends ItemFood{
|
|||
this.registerRendering();
|
||||
}
|
||||
|
||||
protected void registerRendering(){
|
||||
ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this), new ResourceLocation(ModUtil.MOD_ID_LOWER, this.getBaseName()));
|
||||
}
|
||||
|
||||
protected String getBaseName(){
|
||||
return this.name;
|
||||
}
|
||||
|
@ -54,4 +50,8 @@ public class ItemFoodBase extends ItemFood{
|
|||
public boolean shouldAddCreative(){
|
||||
return true;
|
||||
}
|
||||
|
||||
protected void registerRendering(){
|
||||
ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this), new ResourceLocation(ModUtil.MOD_ID_LOWER, this.getBaseName()));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -50,10 +50,6 @@ public class ItemHoeAA extends ItemHoe{
|
|||
this.registerRendering();
|
||||
}
|
||||
|
||||
protected void registerRendering(){
|
||||
ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this), new ResourceLocation(ModUtil.MOD_ID_LOWER, this.getBaseName()));
|
||||
}
|
||||
|
||||
protected String getBaseName(){
|
||||
return this.name;
|
||||
}
|
||||
|
@ -62,6 +58,10 @@ public class ItemHoeAA extends ItemHoe{
|
|||
return true;
|
||||
}
|
||||
|
||||
protected void registerRendering(){
|
||||
ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this), new ResourceLocation(ModUtil.MOD_ID_LOWER, this.getBaseName()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumRarity getRarity(ItemStack stack){
|
||||
return this.rarity;
|
||||
|
|
|
@ -49,10 +49,6 @@ public class ItemPickaxeAA extends ItemPickaxe{
|
|||
this.registerRendering();
|
||||
}
|
||||
|
||||
protected void registerRendering(){
|
||||
ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this), new ResourceLocation(ModUtil.MOD_ID_LOWER, this.getBaseName()));
|
||||
}
|
||||
|
||||
protected String getBaseName(){
|
||||
return this.name;
|
||||
}
|
||||
|
@ -61,6 +57,10 @@ public class ItemPickaxeAA extends ItemPickaxe{
|
|||
return true;
|
||||
}
|
||||
|
||||
protected void registerRendering(){
|
||||
ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this), new ResourceLocation(ModUtil.MOD_ID_LOWER, this.getBaseName()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getIsRepairable(ItemStack itemToRepair, ItemStack stack){
|
||||
return ItemUtil.areItemsEqual(this.repairItem, stack, false);
|
||||
|
|
|
@ -57,10 +57,6 @@ public class ItemSeed extends ItemSeeds{
|
|||
this.registerRendering();
|
||||
}
|
||||
|
||||
protected void registerRendering(){
|
||||
ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this), new ResourceLocation(ModUtil.MOD_ID_LOWER, this.getBaseName()));
|
||||
}
|
||||
|
||||
protected String getBaseName(){
|
||||
return this.name;
|
||||
}
|
||||
|
@ -69,6 +65,10 @@ public class ItemSeed extends ItemSeeds{
|
|||
return true;
|
||||
}
|
||||
|
||||
protected void registerRendering(){
|
||||
ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this), new ResourceLocation(ModUtil.MOD_ID_LOWER, this.getBaseName()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumRarity getRarity(ItemStack stack){
|
||||
return EnumRarity.RARE;
|
||||
|
|
|
@ -50,10 +50,6 @@ public class ItemShovelAA extends ItemSpade{
|
|||
this.registerRendering();
|
||||
}
|
||||
|
||||
protected void registerRendering(){
|
||||
ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this), new ResourceLocation(ModUtil.MOD_ID_LOWER, this.getBaseName()));
|
||||
}
|
||||
|
||||
protected String getBaseName(){
|
||||
return this.name;
|
||||
}
|
||||
|
@ -62,6 +58,10 @@ public class ItemShovelAA extends ItemSpade{
|
|||
return true;
|
||||
}
|
||||
|
||||
protected void registerRendering(){
|
||||
ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this), new ResourceLocation(ModUtil.MOD_ID_LOWER, this.getBaseName()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getIsRepairable(ItemStack itemToRepair, ItemStack stack){
|
||||
return ItemUtil.areItemsEqual(this.repairItem, stack, false);
|
||||
|
|
|
@ -50,10 +50,6 @@ public class ItemSwordAA extends ItemSword{
|
|||
this.registerRendering();
|
||||
}
|
||||
|
||||
protected void registerRendering(){
|
||||
ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this), new ResourceLocation(ModUtil.MOD_ID_LOWER, this.getBaseName()));
|
||||
}
|
||||
|
||||
protected String getBaseName(){
|
||||
return this.name;
|
||||
}
|
||||
|
@ -62,6 +58,10 @@ public class ItemSwordAA extends ItemSword{
|
|||
return true;
|
||||
}
|
||||
|
||||
protected void registerRendering(){
|
||||
ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this), new ResourceLocation(ModUtil.MOD_ID_LOWER, this.getBaseName()));
|
||||
}
|
||||
|
||||
protected Class<? extends ItemBlockBase> getItemBlock(){
|
||||
return ItemBlockBase.class;
|
||||
}
|
||||
|
|
|
@ -14,6 +14,7 @@ package de.ellpeck.actuallyadditions.mod.items.lens;
|
|||
import de.ellpeck.actuallyadditions.api.internal.IAtomicReconstructor;
|
||||
import de.ellpeck.actuallyadditions.api.lens.Lens;
|
||||
import de.ellpeck.actuallyadditions.api.recipe.LensNoneRecipe;
|
||||
import de.ellpeck.actuallyadditions.mod.config.ConfigValues;
|
||||
import de.ellpeck.actuallyadditions.mod.util.PosUtil;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
|
@ -45,7 +46,9 @@ public class LensNone extends Lens{
|
|||
if(outputs != null && !outputs.isEmpty()){
|
||||
ItemStack output = outputs.get(0);
|
||||
if(output.getItem() instanceof ItemBlock){
|
||||
tile.getWorldObject().playAuxSFX(2001, pos, Block.getIdFromBlock(PosUtil.getBlock(pos, tile.getWorldObject()))+(PosUtil.getMetadata(pos, tile.getWorldObject()) << 12));
|
||||
if(!ConfigValues.lessBlockBreakingEffects){
|
||||
tile.getWorldObject().playAuxSFX(2001, pos, Block.getStateId(tile.getWorldObject().getBlockState(pos)));
|
||||
}
|
||||
PosUtil.setBlock(pos, tile.getWorldObject(), Block.getBlockFromItem(output.getItem()), output.getItemDamage(), 2);
|
||||
}
|
||||
else{
|
||||
|
|
|
@ -35,6 +35,7 @@ public class LensNoneRecipeHandler{
|
|||
public static LensNoneRecipe recipeExplosionLens;
|
||||
public static LensNoneRecipe recipeDamageLens;
|
||||
public static LensNoneRecipe recipeLeather;
|
||||
public static LensNoneRecipe recipeNetherWart;
|
||||
|
||||
public static void init(){
|
||||
//Crystal Blocks
|
||||
|
@ -86,6 +87,9 @@ public class LensNoneRecipeHandler{
|
|||
recipeSoulSand = Util.GetRecipes.lastReconstructorRecipe();
|
||||
ActuallyAdditionsAPI.addReconstructorLensNoneRecipe(new ItemStack(Items.rotten_flesh), new ItemStack(Items.leather), 8000);
|
||||
recipeLeather = Util.GetRecipes.lastReconstructorRecipe();
|
||||
|
||||
ActuallyAdditionsAPI.addReconstructorLensNoneRecipe(new ItemStack(Blocks.red_mushroom), new ItemStack(Items.nether_wart), 150000);
|
||||
recipeNetherWart = Util.GetRecipes.lastReconstructorRecipe();
|
||||
}
|
||||
|
||||
ActuallyAdditionsAPI.addReconstructorLensNoneRecipe(new ItemStack(Blocks.quartz_block), new ItemStack(InitBlocks.blockTestifiBucksWhiteWall), 10);
|
||||
|
|
|
@ -14,8 +14,8 @@ import de.ellpeck.actuallyadditions.api.lens.Lens;
|
|||
|
||||
public class Lenses{
|
||||
|
||||
public static final Lens LENS_NONE = new LensNone().register();
|
||||
public static final Lens LENS_DETONATION = new LensDetonation().register();
|
||||
public static final Lens LENS_DEATH = new LensDeath().register();
|
||||
public static final Lens LENS_COLOR = new LensColor().register();
|
||||
public static final Lens LENS_NONE = new LensNone();
|
||||
public static final Lens LENS_DETONATION = new LensDetonation();
|
||||
public static final Lens LENS_DEATH = new LensDeath();
|
||||
public static final Lens LENS_COLOR = new LensColor();
|
||||
}
|
||||
|
|
|
@ -11,11 +11,24 @@
|
|||
package de.ellpeck.actuallyadditions.mod.jei;
|
||||
|
||||
import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI;
|
||||
import de.ellpeck.actuallyadditions.mod.blocks.InitBlocks;
|
||||
import de.ellpeck.actuallyadditions.mod.inventory.gui.GuiCoffeeMachine;
|
||||
import de.ellpeck.actuallyadditions.mod.inventory.gui.GuiFurnaceDouble;
|
||||
import de.ellpeck.actuallyadditions.mod.inventory.gui.GuiGrinder;
|
||||
import de.ellpeck.actuallyadditions.mod.items.InitItems;
|
||||
import de.ellpeck.actuallyadditions.mod.jei.booklet.BookletRecipeCategory;
|
||||
import de.ellpeck.actuallyadditions.mod.jei.booklet.BookletRecipeHandler;
|
||||
import de.ellpeck.actuallyadditions.mod.jei.coffee.CoffeeMachineRecipeCategory;
|
||||
import de.ellpeck.actuallyadditions.mod.jei.coffee.CoffeeMachineRecipeHandler;
|
||||
import de.ellpeck.actuallyadditions.mod.jei.crusher.CrusherRecipeCategory;
|
||||
import de.ellpeck.actuallyadditions.mod.jei.crusher.CrusherRecipeHandler;
|
||||
import de.ellpeck.actuallyadditions.mod.jei.reconstructor.ReconstructorRecipeCategory;
|
||||
import de.ellpeck.actuallyadditions.mod.jei.reconstructor.ReconstructorRecipeHandler;
|
||||
import de.ellpeck.actuallyadditions.mod.nei.NEICoffeeMachineRecipe;
|
||||
import de.ellpeck.actuallyadditions.mod.util.Util;
|
||||
import mezz.jei.api.*;
|
||||
import mezz.jei.api.recipe.VanillaRecipeCategoryUid;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
@JEIPlugin
|
||||
public class JEIActuallyAdditionsPlugin implements IModPlugin{
|
||||
|
@ -36,20 +49,56 @@ public class JEIActuallyAdditionsPlugin implements IModPlugin{
|
|||
public void register(IModRegistry registry){
|
||||
registry.addRecipeCategories(
|
||||
new BookletRecipeCategory(this.helpers.getGuiHelper()),
|
||||
new CoffeeMachineRecipeCategory(this.helpers.getGuiHelper())
|
||||
new CoffeeMachineRecipeCategory(this.helpers.getGuiHelper()),
|
||||
new CrusherRecipeCategory(this.helpers.getGuiHelper()),
|
||||
new ReconstructorRecipeCategory(this.helpers.getGuiHelper())
|
||||
);
|
||||
|
||||
registry.addRecipeHandlers(
|
||||
new BookletRecipeHandler(),
|
||||
new CoffeeMachineRecipeHandler()
|
||||
new CoffeeMachineRecipeHandler(),
|
||||
new CrusherRecipeHandler(),
|
||||
new ReconstructorRecipeHandler()
|
||||
);
|
||||
|
||||
registry.addRecipes(ActuallyAdditionsAPI.bookletPagesWithItemStackData);
|
||||
registry.addRecipes(ActuallyAdditionsAPI.coffeeMachineIngredients);
|
||||
registry.addRecipes(ActuallyAdditionsAPI.crusherRecipes);
|
||||
registry.addRecipes(ActuallyAdditionsAPI.reconstructorLensNoneRecipes);
|
||||
|
||||
registry.addRecipeClickArea(GuiCoffeeMachine.class, 53, 42, 22, 16, NEICoffeeMachineRecipe.NAME);
|
||||
registry.addRecipeClickArea(GuiGrinder.class, 80, 40, 24, 22, CrusherRecipeCategory.NAME);
|
||||
registry.addRecipeClickArea(GuiGrinder.GuiGrinderDouble.class, 51, 40, 74, 22, CrusherRecipeCategory.NAME);
|
||||
registry.addRecipeClickArea(GuiFurnaceDouble.class, 51, 40, 74, 22, VanillaRecipeCategoryUid.SMELTING);
|
||||
|
||||
INbtIgnoreList ignoreList = this.helpers.getNbtIgnoreList();
|
||||
ignoreList.ignoreNbtTagNames(InitItems.itemDrill, "Energy");
|
||||
ignoreList.ignoreNbtTagNames(InitItems.itemTeleStaff, "Energy");
|
||||
ignoreList.ignoreNbtTagNames(InitItems.itemGrowthRing, "Energy");
|
||||
ignoreList.ignoreNbtTagNames(InitItems.itemMagnetRing, "Energy");
|
||||
ignoreList.ignoreNbtTagNames(InitItems.itemWaterRemovalRing, "Energy");
|
||||
ignoreList.ignoreNbtTagNames(InitItems.itemBattery, "Energy");
|
||||
ignoreList.ignoreNbtTagNames(InitItems.itemBatteryDouble, "Energy");
|
||||
ignoreList.ignoreNbtTagNames(InitItems.itemBatteryTriple, "Energy");
|
||||
ignoreList.ignoreNbtTagNames(InitItems.itemBatteryQuadruple, "Energy");
|
||||
ignoreList.ignoreNbtTagNames(InitItems.itemBatteryQuintuple, "Energy");
|
||||
|
||||
IItemBlacklist blacklist = this.helpers.getItemBlacklist();
|
||||
blacklist.addItemToBlacklist(new ItemStack(InitBlocks.blockRice));
|
||||
blacklist.addItemToBlacklist(new ItemStack(InitBlocks.blockCanola));
|
||||
blacklist.addItemToBlacklist(new ItemStack(InitBlocks.blockFlax));
|
||||
blacklist.addItemToBlacklist(new ItemStack(InitBlocks.blockCoffee));
|
||||
blacklist.addItemToBlacklist(new ItemStack(InitBlocks.blockWildPlant, 1, Util.WILDCARD));
|
||||
blacklist.addItemToBlacklist(new ItemStack(InitBlocks.blockColoredLampOn, 1, Util.WILDCARD));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRecipeRegistryAvailable(IRecipeRegistry recipeRegistry){
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRuntimeAvailable(IJeiRuntime jeiRuntime){
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -36,6 +36,10 @@ public abstract class RecipeWrapperWithButton{
|
|||
};
|
||||
}
|
||||
|
||||
public abstract int getButtonX();
|
||||
|
||||
public abstract int getButtonY();
|
||||
|
||||
public boolean handleClick(Minecraft mc, int mouseX, int mouseY){
|
||||
if(this.theButton.mousePressed(mc, mouseX, mouseY)){
|
||||
this.theButton.playPressSound(mc.getSoundHandler());
|
||||
|
@ -52,12 +56,9 @@ public abstract class RecipeWrapperWithButton{
|
|||
return false;
|
||||
}
|
||||
|
||||
public abstract BookletPage getPage();
|
||||
|
||||
public void updateButton(Minecraft mc, int mouseX, int mouseY){
|
||||
this.theButton.drawButton(mc, mouseX, mouseY);
|
||||
}
|
||||
|
||||
public abstract BookletPage getPage();
|
||||
|
||||
public abstract int getButtonX();
|
||||
public abstract int getButtonY();
|
||||
}
|
||||
|
|
|
@ -10,7 +10,6 @@
|
|||
|
||||
package de.ellpeck.actuallyadditions.mod.jei.booklet;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import de.ellpeck.actuallyadditions.api.booklet.BookletPage;
|
||||
import de.ellpeck.actuallyadditions.api.booklet.IBookletChapter;
|
||||
import de.ellpeck.actuallyadditions.mod.booklet.page.PagePicture;
|
||||
|
@ -24,6 +23,7 @@ import net.minecraftforge.fluids.FluidStack;
|
|||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
|
@ -47,12 +47,12 @@ public class BookletRecipeWrapper extends RecipeWrapperWithButton implements IRe
|
|||
|
||||
@Override
|
||||
public List<FluidStack> getFluidInputs(){
|
||||
return ImmutableList.of();
|
||||
return new ArrayList<FluidStack>();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FluidStack> getFluidOutputs(){
|
||||
return ImmutableList.of();
|
||||
return new ArrayList<FluidStack>();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -96,11 +96,6 @@ public class BookletRecipeWrapper extends RecipeWrapperWithButton implements IRe
|
|||
return this.handleClick(minecraft, mouseX, mouseY);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BookletPage getPage(){
|
||||
return this.thePage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getButtonX(){
|
||||
return 0;
|
||||
|
@ -110,4 +105,9 @@ public class BookletRecipeWrapper extends RecipeWrapperWithButton implements IRe
|
|||
public int getButtonY(){
|
||||
return 84;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BookletPage getPage(){
|
||||
return this.thePage;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,7 +10,6 @@
|
|||
|
||||
package de.ellpeck.actuallyadditions.mod.jei.coffee;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import de.ellpeck.actuallyadditions.api.booklet.BookletPage;
|
||||
import de.ellpeck.actuallyadditions.api.recipe.coffee.CoffeeBrewing;
|
||||
import de.ellpeck.actuallyadditions.api.recipe.coffee.CoffeeIngredient;
|
||||
|
@ -62,29 +61,31 @@ public class CoffeeMachineRecipeWrapper extends RecipeWrapperWithButton implemen
|
|||
|
||||
@Override
|
||||
public List<FluidStack> getFluidInputs(){
|
||||
return ImmutableList.of();
|
||||
return new ArrayList<FluidStack>();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FluidStack> getFluidOutputs(){
|
||||
return ImmutableList.of();
|
||||
return new ArrayList<FluidStack>();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawInfo(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight){
|
||||
if(this.theIngredient.getExtraText() != null){
|
||||
Minecraft.getMinecraft().fontRendererObj.drawString(StringUtil.localize("container.nei."+ModUtil.MOD_ID_LOWER+".coffee.special")+":", 2, 4, StringUtil.DECIMAL_COLOR_GRAY_TEXT, false);
|
||||
Minecraft.getMinecraft().fontRendererObj.drawString(this.theIngredient.getExtraText(), 2, 16, StringUtil.DECIMAL_COLOR_GRAY_TEXT, false);
|
||||
}
|
||||
|
||||
if(this.theIngredient.maxAmplifier > 0){
|
||||
Minecraft.getMinecraft().fontRendererObj.drawString(StringUtil.localize("container.nei."+ModUtil.MOD_ID_LOWER+".coffee.maxAmount")+": "+this.theIngredient.maxAmplifier, 2, 28, StringUtil.DECIMAL_COLOR_GRAY_TEXT, false);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawInfo(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight, int mouseX, int mouseY){
|
||||
this.updateButton(minecraft, mouseX, mouseY);
|
||||
|
||||
if(this.theIngredient.getExtraText() != null){
|
||||
minecraft.fontRendererObj.drawString(StringUtil.localize("container.nei."+ModUtil.MOD_ID_LOWER+".coffee.special")+":", 2, 4, StringUtil.DECIMAL_COLOR_GRAY_TEXT, false);
|
||||
minecraft.fontRendererObj.drawString(this.theIngredient.getExtraText(), 2, 16, StringUtil.DECIMAL_COLOR_GRAY_TEXT, false);
|
||||
}
|
||||
|
||||
if(this.theIngredient.maxAmplifier > 0){
|
||||
minecraft.fontRendererObj.drawString(StringUtil.localize("container.nei."+ModUtil.MOD_ID_LOWER+".coffee.maxAmount")+": "+this.theIngredient.maxAmplifier, 2, 28, StringUtil.DECIMAL_COLOR_GRAY_TEXT, false);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -103,11 +104,6 @@ public class CoffeeMachineRecipeWrapper extends RecipeWrapperWithButton implemen
|
|||
return this.handleClick(minecraft, mouseX, mouseY);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BookletPage getPage(){
|
||||
return BookletUtils.getFirstPageForStack(new ItemStack(InitBlocks.blockCoffeeMachine));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getButtonX(){
|
||||
return 0;
|
||||
|
@ -117,4 +113,9 @@ public class CoffeeMachineRecipeWrapper extends RecipeWrapperWithButton implemen
|
|||
public int getButtonY(){
|
||||
return 70;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BookletPage getPage(){
|
||||
return BookletUtils.getFirstPageForStack(new ItemStack(InitBlocks.blockCoffeeMachine));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,82 @@
|
|||
/*
|
||||
* This file ("CrusherRecipeCategor.java") is part of the Actually Additions Mod for Minecraft.
|
||||
* It is created and owned by Ellpeck and distributed
|
||||
* under the Actually Additions License to be found at
|
||||
* http://ellpeck.de/actaddlicense/
|
||||
* View the source code at https://github.com/Ellpeck/ActuallyAdditions
|
||||
*
|
||||
* © 2016 Ellpeck
|
||||
*/
|
||||
|
||||
package de.ellpeck.actuallyadditions.mod.jei.crusher;
|
||||
|
||||
import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
|
||||
import de.ellpeck.actuallyadditions.mod.util.StringUtil;
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.gui.IDrawable;
|
||||
import mezz.jei.api.gui.IRecipeLayout;
|
||||
import mezz.jei.api.recipe.IRecipeCategory;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.List;
|
||||
|
||||
public class CrusherRecipeCategory implements IRecipeCategory{
|
||||
|
||||
public static final String NAME = "actuallyadditions.crushing";
|
||||
|
||||
private IDrawable background;
|
||||
|
||||
public CrusherRecipeCategory(IGuiHelper helper){
|
||||
this.background = helper.createDrawable(AssetUtil.getGuiLocation("guiGrinder"), 60, 13, 56, 79);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getUid(){
|
||||
return NAME;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getTitle(){
|
||||
return StringUtil.localize("container.nei."+NAME+".name");
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IDrawable getBackground(){
|
||||
return this.background;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawExtras(Minecraft minecraft){
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawAnimations(Minecraft minecraft){
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IRecipeWrapper recipeWrapper){
|
||||
if(recipeWrapper instanceof CrusherRecipeWrapper){
|
||||
CrusherRecipeWrapper wrapper = (CrusherRecipeWrapper)recipeWrapper;
|
||||
|
||||
recipeLayout.getItemStacks().init(0, true, 19, 7);
|
||||
recipeLayout.getItemStacks().set(0, wrapper.theRecipe.getRecipeInputs());
|
||||
|
||||
recipeLayout.getItemStacks().init(1, true, 7, 55);
|
||||
recipeLayout.getItemStacks().set(1, wrapper.theRecipe.getRecipeOutputOnes());
|
||||
|
||||
List<ItemStack> outputTwos = wrapper.theRecipe.getRecipeOutputTwos();
|
||||
if(outputTwos != null && !outputTwos.isEmpty()){
|
||||
recipeLayout.getItemStacks().init(2, true, 31, 55);
|
||||
recipeLayout.getItemStacks().set(2, outputTwos);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,43 @@
|
|||
/*
|
||||
* This file ("CrusherRecipeHandler.java") is part of the Actually Additions Mod for Minecraft.
|
||||
* It is created and owned by Ellpeck and distributed
|
||||
* under the Actually Additions License to be found at
|
||||
* http://ellpeck.de/actaddlicense/
|
||||
* View the source code at https://github.com/Ellpeck/ActuallyAdditions
|
||||
*
|
||||
* © 2016 Ellpeck
|
||||
*/
|
||||
|
||||
package de.ellpeck.actuallyadditions.mod.jei.crusher;
|
||||
|
||||
import de.ellpeck.actuallyadditions.api.recipe.CrusherRecipe;
|
||||
import mezz.jei.api.recipe.IRecipeHandler;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class CrusherRecipeHandler implements IRecipeHandler<CrusherRecipe>{
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public Class getRecipeClass(){
|
||||
return CrusherRecipe.class;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getRecipeCategoryUid(){
|
||||
return CrusherRecipeCategory.NAME;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IRecipeWrapper getRecipeWrapper(@Nonnull CrusherRecipe recipe){
|
||||
return new CrusherRecipeWrapper(recipe);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRecipeValid(@Nonnull CrusherRecipe recipe){
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,110 @@
|
|||
/*
|
||||
* This file ("CrusherRecipeWrapper.java") is part of the Actually Additions Mod for Minecraft.
|
||||
* It is created and owned by Ellpeck and distributed
|
||||
* under the Actually Additions License to be found at
|
||||
* http://ellpeck.de/actaddlicense/
|
||||
* View the source code at https://github.com/Ellpeck/ActuallyAdditions
|
||||
*
|
||||
* © 2016 Ellpeck
|
||||
*/
|
||||
|
||||
package de.ellpeck.actuallyadditions.mod.jei.crusher;
|
||||
|
||||
import de.ellpeck.actuallyadditions.api.booklet.BookletPage;
|
||||
import de.ellpeck.actuallyadditions.api.recipe.CrusherRecipe;
|
||||
import de.ellpeck.actuallyadditions.mod.blocks.InitBlocks;
|
||||
import de.ellpeck.actuallyadditions.mod.booklet.BookletUtils;
|
||||
import de.ellpeck.actuallyadditions.mod.jei.RecipeWrapperWithButton;
|
||||
import de.ellpeck.actuallyadditions.mod.util.StringUtil;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class CrusherRecipeWrapper extends RecipeWrapperWithButton implements IRecipeWrapper{
|
||||
|
||||
public CrusherRecipe theRecipe;
|
||||
|
||||
public CrusherRecipeWrapper(CrusherRecipe recipe){
|
||||
this.theRecipe = recipe;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List getInputs(){
|
||||
return this.theRecipe.getRecipeInputs();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List getOutputs(){
|
||||
List list = new ArrayList();
|
||||
list.addAll(this.theRecipe.getRecipeOutputOnes());
|
||||
|
||||
List<ItemStack> outputTwos = this.theRecipe.getRecipeOutputTwos();
|
||||
if(outputTwos != null && !outputTwos.isEmpty()){
|
||||
list.addAll(outputTwos);
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FluidStack> getFluidInputs(){
|
||||
return new ArrayList<FluidStack>();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FluidStack> getFluidOutputs(){
|
||||
return new ArrayList<FluidStack>();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawInfo(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight){
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawInfo(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight, int mouseX, int mouseY){
|
||||
this.updateButton(minecraft, mouseX, mouseY);
|
||||
|
||||
List<ItemStack> outputTwos = this.theRecipe.getRecipeOutputTwos();
|
||||
if(outputTwos != null && !outputTwos.isEmpty()){
|
||||
minecraft.fontRendererObj.drawString(this.theRecipe.outputTwoChance+"%", 60, 60, StringUtil.DECIMAL_COLOR_GRAY_TEXT, false);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawAnimations(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight){
|
||||
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public List<String> getTooltipStrings(int mouseX, int mouseY){
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean handleClick(@Nonnull Minecraft minecraft, int mouseX, int mouseY, int mouseButton){
|
||||
return this.handleClick(minecraft, mouseX, mouseY);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getButtonX(){
|
||||
return -5;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getButtonY(){
|
||||
return 26;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BookletPage getPage(){
|
||||
return BookletUtils.getFirstPageForStack(new ItemStack(InitBlocks.blockGrinder));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,77 @@
|
|||
/*
|
||||
* This file ("ReconstructorRecipeCategory.java") is part of the Actually Additions Mod for Minecraft.
|
||||
* It is created and owned by Ellpeck and distributed
|
||||
* under the Actually Additions License to be found at
|
||||
* http://ellpeck.de/actaddlicense/
|
||||
* View the source code at https://github.com/Ellpeck/ActuallyAdditions
|
||||
*
|
||||
* © 2016 Ellpeck
|
||||
*/
|
||||
|
||||
package de.ellpeck.actuallyadditions.mod.jei.reconstructor;
|
||||
|
||||
import de.ellpeck.actuallyadditions.mod.blocks.InitBlocks;
|
||||
import de.ellpeck.actuallyadditions.mod.nei.NEIReconstructorRecipe;
|
||||
import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
|
||||
import de.ellpeck.actuallyadditions.mod.util.StringUtil;
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.gui.IDrawable;
|
||||
import mezz.jei.api.gui.IRecipeLayout;
|
||||
import mezz.jei.api.recipe.IRecipeCategory;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class ReconstructorRecipeCategory implements IRecipeCategory{
|
||||
|
||||
private static final ItemStack RECONSTRUCTOR = new ItemStack(InitBlocks.blockAtomicReconstructor);
|
||||
private IDrawable background;
|
||||
|
||||
public ReconstructorRecipeCategory(IGuiHelper helper){
|
||||
this.background = helper.createDrawable(AssetUtil.getGuiLocation("guiNEIAtomicReconstructor"), 0, 0, 96, 60);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getUid(){
|
||||
return NEIReconstructorRecipe.NAME;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getTitle(){
|
||||
return StringUtil.localize("container.nei."+NEIReconstructorRecipe.NAME+".name");
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IDrawable getBackground(){
|
||||
return this.background;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawExtras(Minecraft minecraft){
|
||||
AssetUtil.renderStackToGui(RECONSTRUCTOR, 34, 19, 1.0F);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawAnimations(Minecraft minecraft){
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IRecipeWrapper recipeWrapper){
|
||||
if(recipeWrapper instanceof ReconstructorRecipeWrapper){
|
||||
ReconstructorRecipeWrapper wrapper = (ReconstructorRecipeWrapper)recipeWrapper;
|
||||
|
||||
recipeLayout.getItemStacks().init(0, true, 4, 18);
|
||||
recipeLayout.getItemStacks().set(0, wrapper.theRecipe.getInputs());
|
||||
|
||||
recipeLayout.getItemStacks().init(1, true, 66, 18);
|
||||
recipeLayout.getItemStacks().set(1, wrapper.theRecipe.getOutputs());
|
||||
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,44 @@
|
|||
/*
|
||||
* This file ("ReconstructorRecipeHandler.java") is part of the Actually Additions Mod for Minecraft.
|
||||
* It is created and owned by Ellpeck and distributed
|
||||
* under the Actually Additions License to be found at
|
||||
* http://ellpeck.de/actaddlicense/
|
||||
* View the source code at https://github.com/Ellpeck/ActuallyAdditions
|
||||
*
|
||||
* © 2016 Ellpeck
|
||||
*/
|
||||
|
||||
package de.ellpeck.actuallyadditions.mod.jei.reconstructor;
|
||||
|
||||
import de.ellpeck.actuallyadditions.api.recipe.LensNoneRecipe;
|
||||
import de.ellpeck.actuallyadditions.mod.nei.NEIReconstructorRecipe;
|
||||
import mezz.jei.api.recipe.IRecipeHandler;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class ReconstructorRecipeHandler implements IRecipeHandler<LensNoneRecipe>{
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public Class getRecipeClass(){
|
||||
return LensNoneRecipe.class;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getRecipeCategoryUid(){
|
||||
return NEIReconstructorRecipe.NAME;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IRecipeWrapper getRecipeWrapper(@Nonnull LensNoneRecipe recipe){
|
||||
return new ReconstructorRecipeWrapper(recipe);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRecipeValid(@Nonnull LensNoneRecipe recipe){
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,96 @@
|
|||
/*
|
||||
* This file ("ReconstructorRecipeWrapper.java") is part of the Actually Additions Mod for Minecraft.
|
||||
* It is created and owned by Ellpeck and distributed
|
||||
* under the Actually Additions License to be found at
|
||||
* http://ellpeck.de/actaddlicense/
|
||||
* View the source code at https://github.com/Ellpeck/ActuallyAdditions
|
||||
*
|
||||
* © 2016 Ellpeck
|
||||
*/
|
||||
|
||||
package de.ellpeck.actuallyadditions.mod.jei.reconstructor;
|
||||
|
||||
import de.ellpeck.actuallyadditions.api.booklet.BookletPage;
|
||||
import de.ellpeck.actuallyadditions.api.recipe.LensNoneRecipe;
|
||||
import de.ellpeck.actuallyadditions.mod.blocks.InitBlocks;
|
||||
import de.ellpeck.actuallyadditions.mod.booklet.BookletUtils;
|
||||
import de.ellpeck.actuallyadditions.mod.jei.RecipeWrapperWithButton;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class ReconstructorRecipeWrapper extends RecipeWrapperWithButton implements IRecipeWrapper{
|
||||
|
||||
public LensNoneRecipe theRecipe;
|
||||
|
||||
public ReconstructorRecipeWrapper(LensNoneRecipe recipe){
|
||||
this.theRecipe = recipe;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List getInputs(){
|
||||
return this.theRecipe.getInputs();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List getOutputs(){
|
||||
return this.theRecipe.getOutputs();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FluidStack> getFluidInputs(){
|
||||
return new ArrayList<FluidStack>();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FluidStack> getFluidOutputs(){
|
||||
return new ArrayList<FluidStack>();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawInfo(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight){
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawInfo(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight, int mouseX, int mouseY){
|
||||
this.updateButton(minecraft, mouseX, mouseY);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawAnimations(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight){
|
||||
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public List<String> getTooltipStrings(int mouseX, int mouseY){
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean handleClick(@Nonnull Minecraft minecraft, int mouseX, int mouseY, int mouseButton){
|
||||
return this.handleClick(minecraft, mouseX, mouseY);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getButtonX(){
|
||||
return 3;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getButtonY(){
|
||||
return 40;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BookletPage getPage(){
|
||||
return BookletUtils.getFirstPageForStack(new ItemStack(InitBlocks.blockAtomicReconstructor));
|
||||
}
|
||||
}
|
|
@ -30,7 +30,6 @@ public class InitArmorMaterials{
|
|||
public static void init(){
|
||||
ModUtil.LOGGER.info("Initializing Armor Materials...");
|
||||
|
||||
//TODO Fix armor textures
|
||||
armorMaterialEmerald = EnumHelper.addArmorMaterial("armorMaterialEmerald", ModUtil.MOD_ID_LOWER+":armorEmerald", 50, new int[]{5, 9, 8, 5}, 15);
|
||||
armorMaterialObsidian = EnumHelper.addArmorMaterial("armorMaterialObsidian", ModUtil.MOD_ID_LOWER+":armorObsidian", 120, new int[]{3, 4, 3, 1}, 10);
|
||||
armorMaterialQuartz = EnumHelper.addArmorMaterial("armorMaterialQuartz", ModUtil.MOD_ID_LOWER+":armorQuartz", 20, new int[]{3, 6, 5, 3}, 8);
|
||||
|
|
|
@ -26,7 +26,6 @@ import java.util.Calendar;
|
|||
|
||||
public class RenderSpecial{
|
||||
|
||||
private double lastTimeForBobbing;
|
||||
private ItemStack theThingToRender;
|
||||
|
||||
public RenderSpecial(ItemStack stack){
|
||||
|
@ -46,13 +45,8 @@ public class RenderSpecial{
|
|||
float size = isBlock ? 0.5F : 0.4F;
|
||||
double offsetUp = isBlock ? 0D : 0.1875D;
|
||||
|
||||
double bobHeight = 70;
|
||||
double theTime = Minecraft.getSystemTime();
|
||||
double time = theTime/50;
|
||||
|
||||
if(time-bobHeight >= lastTimeForBobbing){
|
||||
this.lastTimeForBobbing = time;
|
||||
}
|
||||
double bobHeight = 0.3;
|
||||
double boop = Minecraft.getSystemTime()/1000D;
|
||||
|
||||
GlStateManager.pushMatrix();
|
||||
|
||||
|
@ -60,18 +54,14 @@ public class RenderSpecial{
|
|||
Vec3 playerPos = player.getPositionEyes(partialTicks);
|
||||
GlStateManager.translate(playerPos.xCoord-currentPos.xCoord, playerPos.yCoord-currentPos.yCoord-(player.isSneaking() || Minecraft.getMinecraft().thePlayer.isSneaking() ? 0.125D : 0D), playerPos.zCoord-currentPos.zCoord);
|
||||
|
||||
GlStateManager.translate(0D, 2.535D+offsetUp, 0D);
|
||||
GlStateManager.translate(0D, 2.435D+offsetUp, 0D);
|
||||
GlStateManager.rotate(180F, 1.0F, 0.0F, 1.0F);
|
||||
GlStateManager.scale(size, size, size);
|
||||
|
||||
if(time-(bobHeight/2) >= lastTimeForBobbing){
|
||||
GlStateManager.translate(0D, (time-this.lastTimeForBobbing)/100D, 0D);
|
||||
}
|
||||
else{
|
||||
GlStateManager.translate(0D, -(time-lastTimeForBobbing)/100D+bobHeight/100D, 0D);
|
||||
}
|
||||
|
||||
GlStateManager.rotate((float)(theTime/20), 0, 1, 0);
|
||||
//Make the floaty stuff look nice using sine waves \o/ -xdjackiexd
|
||||
//Peck edit: What do you mean by "nice" you jackass? >_>
|
||||
GlStateManager.translate(0D, Math.sin(boop%(2*Math.PI))*bobHeight, 0D);
|
||||
GlStateManager.rotate((float)(((boop*40D)%360)), 0, 1, 0);
|
||||
|
||||
GlStateManager.disableLighting();
|
||||
if(this.theThingToRender != null){
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue