Skip to content
Permalink
Browse files

Clean Up and Bug Fixes

  • Loading branch information
Nedelosk committed Jan 23, 2016
1 parent 6390a0c commit 02ec97b031afe44c03b4762bbbe03345a028cf60
Showing with 539 additions and 452 deletions.
  1. +30 −48 src/main/java/forestry/apiculture/blocks/BlockAlveary.java
  2. +2 −4 src/main/java/forestry/apiculture/blocks/BlockCandle.java
  3. +2 −2 src/main/java/forestry/apiculture/items/ItemBlockCandle.java
  4. +2 −2 src/main/java/forestry/apiculture/multiblock/TileAlveary.java
  5. +1 −1 src/main/java/forestry/apiculture/multiblock/TileAlvearyHygroregulator.java
  6. +2 −2 src/main/java/forestry/apiculture/multiblock/TileAlvearyPlain.java
  7. +1 −1 src/main/java/forestry/apiculture/multiblock/TileAlvearySieve.java
  8. +1 −1 src/main/java/forestry/apiculture/multiblock/TileAlvearySwarmer.java
  9. +9 −5 src/main/java/forestry/arboriculture/blocks/BlockForestryLeaves.java
  10. +6 −2 src/main/java/forestry/arboriculture/items/ItemBlockLeaves.java
  11. +1 −1 src/main/java/forestry/arboriculture/items/ItemBlockWood.java
  12. +1 −1 src/main/java/forestry/arboriculture/proxy/ProxyArboricultureClient.java
  13. +32 −72 src/main/java/forestry/arboriculture/render/ModelLeaves.java
  14. +2 −2 src/main/java/forestry/arboriculture/tiles/TileLeaves.java
  15. +1 −1 src/main/java/forestry/core/{render/model → models}/BlockModelIndex.java
  16. +9 −9 src/main/java/forestry/core/{render/model → models}/ModelBaker.java
  17. +4 −4 src/main/java/forestry/core/{render/model → models}/ModelBakerFace.java
  18. +1 −1 src/main/java/forestry/core/{render/model → models}/ModelBakerModel.java
  19. +44 −36 src/main/java/forestry/core/{render/model → models}/ModelBlockOverlay.java
  20. +1 −1 src/main/java/forestry/core/{render/model → models}/ModelCrate.java
  21. +1 −1 src/main/java/forestry/core/{render/model → models}/ModelEscritoire.java
  22. +1 −1 src/main/java/forestry/core/{render/model → models}/ModelIndex.java
  23. +1 −1 src/main/java/forestry/core/{render/model → models}/ModelManager.java
  24. +1 −1 src/main/java/forestry/core/{render/model → models}/RenderHandler.java
  25. +1 −0 src/main/java/forestry/core/multiblock/MultiblockControllerBase.java
  26. +2 −2 src/main/java/forestry/core/proxy/ProxyRender.java
  27. +4 −4 src/main/java/forestry/core/proxy/ProxyRenderClient.java
  28. +1 −1 src/main/java/forestry/core/render/ParticleHelper.java
  29. +1 −1 src/main/java/forestry/core/render/RenderEscritoire.java
  30. +0 −1 src/main/java/forestry/factory/recipes/jei/fabricator/FabricatorRecipeCategory.java
  31. +0 −2 src/main/java/forestry/factory/recipes/jei/squeezer/SqueezerContainerRecipeWrapper.java
  32. +0 −1 src/main/java/forestry/factory/recipes/jei/squeezer/SqueezerRecipeCategory.java
  33. +0 −5 src/main/java/forestry/factory/recipes/jei/squeezer/SqueezerRecipeMaker.java
  34. +9 −7 src/main/java/forestry/farming/blocks/BlockFarm.java
  35. +0 −21 src/main/java/forestry/farming/blocks/EnumBlockFarmType.java
  36. +84 −0 src/main/java/forestry/farming/blocks/EnumFarmBlockType.java
  37. +1 −2 src/main/java/forestry/farming/items/ItemBlockFarm.java
  38. +1 −61 src/main/java/forestry/farming/{render → models}/EnumFarmBlockTexture.java
  39. +102 −0 src/main/java/forestry/farming/models/ModelFarmBlock.java
  40. +2 −2 src/main/java/forestry/farming/proxy/ProxyFarmingClient.java
  41. +0 −117 src/main/java/forestry/farming/render/ModelFarmBlock.java
  42. +8 −3 src/main/java/forestry/farming/tiles/TileFarm.java
  43. +7 −7 src/main/java/forestry/plugins/PluginApiculture.java
  44. +1 −1 src/main/java/forestry/plugins/PluginCore.java
  45. +8 −8 src/main/java/forestry/plugins/PluginFarming.java
  46. +1 −1 src/main/java/forestry/storage/proxy/ProxyStorageClient.java
  47. +1 −1 src/main/java/uristqwerty/CraftGuide/api/LiquidFilter.java
  48. +1 −1 src/main/java/uristqwerty/CraftGuide/api/LiquidSlot.java
  49. +3 −3 src/main/resources/assets/forestry/blockstates/apiculture/alveary_plain.json
  50. +9 −0 src/main/resources/assets/forestry/blockstates/stump.json
  51. 0 ...sources/assets/forestry/models/block/apiculture/{alveary_plain_up.json → alveary_plain_left.json}
  52. 0 ...rces/assets/forestry/models/block/apiculture/{alveary_plain_down.json → alveary_plain_right.json}
  53. +6 −0 src/main/resources/assets/forestry/models/block/candle.json
  54. +6 −0 src/main/resources/assets/forestry/models/block/candle_up.json
  55. +70 −0 src/main/resources/assets/forestry/models/block/stump.json
  56. +54 −0 src/main/resources/assets/forestry/models/block/stump_up.json
@@ -50,9 +50,9 @@
import forestry.core.proxy.Proxies;

public class BlockAlveary extends BlockStructure implements IStateMapperRegister {
private static final PropertyEnum TYPE = PropertyEnum.create("alveary", Type.class);
private static final PropertyEnum TYPE = PropertyEnum.create("alveary", AlvearyType.class);
private static final PropertyEnum STATE = PropertyEnum.create("state", State.class);
private static final PropertyEnum LEVEL = PropertyEnum.create("type", Level.class);
private static final PropertyEnum LEVEL = PropertyEnum.create("type", AlvearyLevel.class);

private enum State implements IStringSerializable {
ON, OFF;
@@ -63,16 +63,16 @@ public String getName() {
}
}

private enum Level implements IStringSerializable {
BOTTOM, LEFT, RIGHT;
private enum AlvearyLevel implements IStringSerializable {
MIDDLE, LEFT, RIGHT;

@Override
public String getName() {
return name().toLowerCase();
}
}

public enum Type implements IStringSerializable {
public enum AlvearyType implements IStringSerializable {
PLAIN,
ENTRANCE,
SWARMER,
@@ -82,7 +82,7 @@ public String getName() {
STABILISER,
SIEVE;

public static final Type[] VALUES = values();
public static final AlvearyType[] VALUES = values();

@Override
public String getName() {
@@ -95,7 +95,8 @@ public BlockAlveary() {
setHardness(1.0f);
setCreativeTab(Tabs.tabApiculture);
setHarvestLevel("axe", 0);
setDefaultState(this.blockState.getBaseState().withProperty(TYPE, Type.PLAIN).withProperty(STATE, State.OFF).withProperty(LEVEL, Level.BOTTOM));
setStepSound(soundTypeWood);
setDefaultState(this.blockState.getBaseState().withProperty(TYPE, AlvearyType.PLAIN).withProperty(STATE, State.OFF).withProperty(LEVEL, AlvearyLevel.MIDDLE));
}

@SuppressWarnings({"rawtypes", "unchecked"})
@@ -137,11 +138,11 @@ public boolean isFullCube() {
@Override
public TileEntity createTileEntity(World world, IBlockState state) {
int metadata = getMetaFromState(state);
if (metadata < 0 || metadata > Type.VALUES.length) {
if (metadata < 0 || metadata > AlvearyType.VALUES.length) {
return null;
}

Type type = Type.VALUES[metadata];
AlvearyType type = AlvearyType.VALUES[metadata];
switch (type) {
case SWARMER:
return new TileAlvearySwarmer();
@@ -183,12 +184,12 @@ public void registerModel(Item item, IModelManager manager) {
/* STATES */
@Override
public IBlockState getStateFromMeta(int meta) {
return getDefaultState().withProperty(TYPE, Type.values()[meta]);
return getDefaultState().withProperty(TYPE, AlvearyType.values()[meta]);
}

@Override
public int getMetaFromState(IBlockState state) {
return ((Type) state.getValue(TYPE)).ordinal();
return ((AlvearyType) state.getValue(TYPE)).ordinal();
}

@Override
@@ -217,33 +218,30 @@ public IBlockState getActualState(IBlockState state, IBlockAccess world, BlockPo
}
}

int meta = ((Type) state.getValue(TYPE)).ordinal();
IBlockState stateXP = world.getBlockState(new BlockPos(pos.getX() + 1, pos.getY(), pos.getZ()));
IBlockState stateXM = world.getBlockState(new BlockPos(pos.getX() - 1, pos.getY(), pos.getZ()));
Block blockXP = stateXP.getBlock();
Block blockXM = stateXM.getBlock();

Block blockXP = world.getBlockState(new BlockPos(pos.getX() + 1, pos.getY(), pos.getZ())).getBlock();
Block blockXM = world.getBlockState(new BlockPos(pos.getX() - 1, pos.getY(), pos.getZ())).getBlock();

state = state.withProperty(LEVEL, Level.BOTTOM);
state = state.withProperty(LEVEL, AlvearyLevel.MIDDLE);

if (blockXP == this && blockXM != this) {

IBlockState stateNeighbor = world.getBlockState(new BlockPos(pos.getX() + 1, pos.getY(), pos.getZ()));
if (stateNeighbor.getBlock().getMetaFromState(stateNeighbor) == 1) {
if (stateXP.getValue(TYPE) == AlvearyType.ENTRANCE) {

if (world.getBlockState(new BlockPos(pos.getX(), pos.getY(), pos.getZ() + 1)).getBlock() != this) {
switchForSide(state, world, pos);
state = state.withProperty(LEVEL, AlvearyLevel.RIGHT);
} else {
switchForSide(state, world, pos);
state = state.withProperty(LEVEL, AlvearyLevel.LEFT);
}

}
} else if (blockXP != this && blockXM == this) {
IBlockState stateNeighbor = world.getBlockState(new BlockPos(pos.getX() - 1, pos.getY(), pos.getZ()));
if (stateNeighbor.getBlock().getMetaFromState(stateNeighbor) == 1) {
if (stateXM.getValue(TYPE) == AlvearyType.ENTRANCE) {

if (world.getBlockState(new BlockPos(pos.getX(), pos.getY(), pos.getZ() + 1)).getBlock() != this) {
switchForSide(state, world, pos);
state = state.withProperty(LEVEL, AlvearyLevel.LEFT);
} else {
switchForSide(state, world, pos);
state = state.withProperty(LEVEL, AlvearyLevel.RIGHT);
}

}
@@ -252,22 +250,6 @@ public IBlockState getActualState(IBlockState state, IBlockAccess world, BlockPo
return super.getActualState(state, world, pos);
}

private void switchForSide(IBlockState state, IBlockAccess world, BlockPos pos) {

Block blockX = world.getBlockState(new BlockPos(pos.getX() + 1, pos.getY(), pos.getZ())).getBlock();
Block blockY = world.getBlockState(new BlockPos(pos.getX(), pos.getY() + 1, pos.getZ())).getBlock();
if (blockX != this && blockY == this) {
state = state.withProperty(LEVEL, Level.LEFT);
} else if (blockX == this && blockY == this) {
state = state.withProperty(LEVEL, Level.RIGHT);
} else if (blockX == this && blockY != this) {
state = state.withProperty(LEVEL, Level.LEFT);
} else if (blockX != this && blockY != this) {
state = state.withProperty(LEVEL, Level.RIGHT);
}

}

@Override
public void registerStateMapper() {
Proxies.render.registerStateMapper(this, new AlvearyStateMapper());
@@ -279,14 +261,14 @@ public void registerStateMapper() {
@Override
protected ModelResourceLocation getModelResourceLocation(IBlockState state) {
LinkedHashMap linkedhashmap = Maps.newLinkedHashMap(state.getProperties());
if (linkedhashmap.get(TYPE) != Type.PLAIN) {
if (linkedhashmap.get(TYPE) != AlvearyType.PLAIN) {
linkedhashmap.remove(LEVEL);
}
if (linkedhashmap.get(TYPE) == Type.SIEVE
|| linkedhashmap.get(TYPE) == Type.ENTRANCE
|| linkedhashmap.get(TYPE) == Type.STABILISER
|| linkedhashmap.get(TYPE) == Type.HYGRO
|| linkedhashmap.get(TYPE) == Type.PLAIN) {
if (linkedhashmap.get(TYPE) == AlvearyType.SIEVE
|| linkedhashmap.get(TYPE) == AlvearyType.ENTRANCE
|| linkedhashmap.get(TYPE) == AlvearyType.STABILISER
|| linkedhashmap.get(TYPE) == AlvearyType.HYGRO
|| linkedhashmap.get(TYPE) == AlvearyType.PLAIN) {
linkedhashmap.remove(STATE);
}
String s = String.format("%s:%s",
@@ -311,7 +293,7 @@ public void onNeighborBlockChange(World world, BlockPos pos, IBlockState state,
}
}

public ItemStack get(Type type) {
public ItemStack get(AlvearyType type) {
return new ItemStack(this, 1, type.ordinal());
}
}
@@ -128,6 +128,7 @@ public TileEntity createTileEntity(World world, IBlockState state) {
@Override
public void registerModel(Item item, IModelManager manager) {
manager.registerItemModel(item, 0, "candle");
manager.registerItemModel(item, 1, "candle");
}

@Override
@@ -141,10 +142,7 @@ public int getLightValue(IBlockAccess world, BlockPos pos) {

@Override
public int colorMultiplier(IBlockAccess worldIn, BlockPos pos, int renderPass) {
if(renderPass < 3){
return ((TileCandle)worldIn.getTileEntity(pos)).getColour();
}
return 16777215;
return ((TileCandle)worldIn.getTileEntity(pos)).getColour();
}

@SuppressWarnings({"rawtypes", "unchecked"})
@@ -30,8 +30,8 @@ public int getColorFromItemStack(ItemStack stack, int pass) {
int value = 0xffffff;
if (pass == 1 && stack.hasTagCompound()) {
NBTTagCompound tag = stack.getTagCompound();
if (tag.hasKey("colour")) {
value = tag.getInteger("colour");
if (tag.hasKey(BlockCandle.colourTagName)) {
value = tag.getInteger(BlockCandle.colourTagName);
}
}
return value;
@@ -48,10 +48,10 @@
private final String unlocalizedTitle;

protected TileAlveary() {
this(BlockAlveary.Type.PLAIN);
this(BlockAlveary.AlvearyType.PLAIN);
}

protected TileAlveary(BlockAlveary.Type type) {
protected TileAlveary(BlockAlveary.AlvearyType type) {
super(new MultiblockLogicAlveary());
this.unlocalizedTitle = "tile.for.alveary." + type.ordinal() + ".name";
}
@@ -44,7 +44,7 @@
private int transferTime;

public TileAlvearyHygroregulator() {
super(BlockAlveary.Type.HYGRO);
super(BlockAlveary.AlvearyType.HYGRO);

this.inventory = new InventoryHygroregulator(this);

@@ -37,7 +37,7 @@ public void onMachineAssembled(IMultiblockController multiblockController, Block
// set alveary entrance block meta
if (getPos().getY() == maxCoord.getY()) {
if ((getPos().getX() > minCoord.getX() && getPos().getX() < maxCoord.getX()) || (getPos().getZ() > minCoord.getZ() && getPos().getZ() < maxCoord.getZ())) {
this.worldObj.setBlockState(getPos(), getBlockType().getStateFromMeta(BlockAlveary.Type.ENTRANCE.ordinal()), 2);
this.worldObj.setBlockState(getPos(), getBlockType().getStateFromMeta(BlockAlveary.AlvearyType.ENTRANCE.ordinal()), 2);
}
}
}
@@ -49,7 +49,7 @@ public void onMachineBroken() {

if (!worldObj.isRemote) {
// set alveary entrance block meta back to normal
this.worldObj.setBlockState(getPos(), getBlockType().getStateFromMeta(BlockAlveary.Type.PLAIN.ordinal()), 2);
this.worldObj.setBlockState(getPos(), getBlockType().getStateFromMeta(BlockAlveary.AlvearyType.PLAIN.ordinal()), 2);
}
}

@@ -33,7 +33,7 @@
private final InventoryAlvearySieve inventory;

public TileAlvearySieve() {
super(BlockAlveary.Type.SIEVE);
super(BlockAlveary.AlvearyType.SIEVE);
this.inventory = new InventoryAlvearySieve(this);
this.beeListener = new AlvearySieveBeeListener(inventory);
}
@@ -45,7 +45,7 @@
private boolean active;

public TileAlvearySwarmer() {
super(BlockAlveary.Type.SWARMER);
super(BlockAlveary.AlvearyType.SWARMER);
this.inventory = new InventorySwarmer(this);
}

@@ -279,14 +279,18 @@ public int colorMultiplier(IBlockAccess world, BlockPos pos, int renderPass) {

TileLeaves leaves = getLeafTile(world,pos);
if (leaves == null) {
return super.colorMultiplier(world, pos);
return super.colorMultiplier(world, pos, 0);
}
int colour = super.colorMultiplier(world, pos, 0);
if(renderPass == 0){
colour = leaves.getFoliageColour(Proxies.common.getClientInstance().thePlayer);
if (colour == PluginArboriculture.proxy.getFoliageColorBasic()) {
return super.colorMultiplier(world, pos, 0);
}

int colour = leaves.getFoliageColour(Proxies.common.getClientInstance().thePlayer);
if (colour == PluginArboriculture.proxy.getFoliageColorBasic()) {
colour = super.colorMultiplier(world, pos);
}else{
colour = leaves.getFruitColour();
}

return colour;
}

@@ -62,8 +62,12 @@ public int getColorFromItemStack(ItemStack itemStack, int renderPass) {

TileLeaves tileLeaves = new TileLeaves();
tileLeaves.readFromNBT(itemStack.getTagCompound());

return tileLeaves.getFoliageColour(Proxies.common.getPlayer());

if(renderPass == 1){
return tileLeaves.getFruitColour();
}else{
return tileLeaves.getFoliageColour(Proxies.common.getPlayer());
}
}

@Override
@@ -35,7 +35,7 @@
import forestry.arboriculture.tiles.TileWood;
import forestry.core.config.Constants;
import forestry.core.items.ItemBlockForestry;
import forestry.core.render.model.ModelManager;
import forestry.core.models.ModelManager;
import forestry.core.utils.BlockUtil;
import forestry.core.utils.StringUtil;

@@ -14,8 +14,8 @@
import net.minecraft.world.ColorizerFoliage;

import forestry.arboriculture.render.ModelLeaves;
import forestry.core.models.BlockModelIndex;
import forestry.core.proxy.Proxies;
import forestry.core.render.model.BlockModelIndex;
import forestry.plugins.PluginArboriculture;

public class ProxyArboricultureClient extends ProxyArboriculture {

0 comments on commit 02ec97b

Please sign in to comment.
You can’t perform that action at this time.