mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-24 22:04:34 +00:00
Clean Up and Bug Fixes
This commit is contained in:
1 parent
6390a0cd11
commit
02ec97b031
56 files changed
+538
-451
No files matched your search
@@ -49,7 +49,7 @@ import forestry.core.render.ParticleHelper;
|
||||
import forestry.core.render.ParticleHelper.DefaultCallback;
|
||||
import forestry.core.utils.BlockUtil;
|
||||
import forestry.core.utils.ItemStackUtil;
|
||||
import forestry.farming.render.EnumFarmBlockTexture;
|
||||
import forestry.farming.models.EnumFarmBlockTexture;
|
||||
import forestry.farming.tiles.TileFarm;
|
||||
import forestry.farming.tiles.TileFarmControl;
|
||||
import forestry.farming.tiles.TileFarmGearbox;
|
||||
@@ -61,25 +61,25 @@ public class BlockFarm extends BlockStructure {
|
||||
|
||||
private final ParticleHelper.Callback particleCallback;
|
||||
|
||||
public static final PropertyEnum META = PropertyEnum.create("meta", EnumBlockFarmType.class);
|
||||
public static final PropertyEnum META = PropertyEnum.create("meta", EnumFarmBlockType.class);
|
||||
|
||||
public BlockFarm() {
|
||||
super(Material.rock);
|
||||
setHardness(1.0f);
|
||||
setHarvestLevel("pickaxe", 0);
|
||||
this.particleCallback = new FarmCallback(this);
|
||||
setDefaultState(blockState.getBaseState().withProperty(META, EnumBlockFarmType.BASIC));
|
||||
setDefaultState(blockState.getBaseState().withProperty(META, EnumFarmBlockType.PLAIN));
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public IBlockState getStateFromMeta(int meta) {
|
||||
return getDefaultState().withProperty(META, EnumBlockFarmType.values()[meta]);
|
||||
return getDefaultState().withProperty(META, EnumFarmBlockType.values()[meta]);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetaFromState(IBlockState state) {
|
||||
return ((EnumBlockFarmType) state.getValue(META)).ordinal();
|
||||
return ((EnumFarmBlockType) state.getValue(META)).ordinal();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -230,7 +230,9 @@ public class BlockFarm extends BlockStructure {
|
||||
@Override
|
||||
protected void setTexture(EntityDiggingFX fx, BlockPos pos, IBlockState state) {
|
||||
IExtendedBlockState extend = (IExtendedBlockState) state;
|
||||
fx.setParticleIcon(EnumFarmBlockTexture.getSprite(EnumFarmBlockTexture.BRICK, 0));
|
||||
TileFarm farm = (TileFarm) fx.getEntityWorld().getTileEntity(pos);
|
||||
|
||||
fx.setParticleIcon(EnumFarmBlockTexture.getSprite(farm.getFarmBlockTexture(), 2));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -240,7 +242,7 @@ public class BlockFarm extends BlockStructure {
|
||||
return getMetaFromState(world.getBlockState(pos)) == 5;
|
||||
}
|
||||
|
||||
public ItemStack get(EnumBlockFarmType type, int amount) {
|
||||
public ItemStack get(EnumFarmBlockType type, int amount) {
|
||||
return new ItemStack(this, amount, type.ordinal());
|
||||
}
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
package forestry.farming.blocks;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
import net.minecraft.util.IStringSerializable;
|
||||
|
||||
public enum EnumBlockFarmType implements IStringSerializable {
|
||||
BASIC,
|
||||
BAND,
|
||||
GEARBOX,
|
||||
HATCH,
|
||||
VALVE,
|
||||
CONTROL;
|
||||
|
||||
public static final EnumBlockFarmType[] VALUES = values();
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return name().toLowerCase(Locale.ENGLISH);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
package forestry.farming.blocks;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
import forestry.core.render.TextureManager;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.util.IStringSerializable;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
public enum EnumFarmBlockType implements IStringSerializable {
|
||||
PLAIN,
|
||||
BAND,
|
||||
GEARBOX,
|
||||
HATCH,
|
||||
VALVE,
|
||||
CONTROL;
|
||||
|
||||
public static final EnumFarmBlockType[] VALUES = values();
|
||||
|
||||
private static final int TYPE_PLAIN = 0;
|
||||
private static final int TYPE_REVERSE = 1;
|
||||
private static final int TYPE_TOP = 2;
|
||||
private static final int TYPE_BAND = 3;
|
||||
private static final int TYPE_GEARS = 4;
|
||||
private static final int TYPE_HATCH = 5;
|
||||
private static final int TYPE_VALVE = 6;
|
||||
private static final int TYPE_CONTROL = 7;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private static List<TextureAtlasSprite> sprites;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public static void registerSprites() {
|
||||
sprites = Arrays.asList(
|
||||
TextureManager.registerSprite("blocks/farm/plain"),
|
||||
TextureManager.registerSprite("blocks/farm/reverse"),
|
||||
TextureManager.registerSprite("blocks/farm/top"),
|
||||
TextureManager.registerSprite("blocks/farm/band"),
|
||||
TextureManager.registerSprite("blocks/farm/gears"),
|
||||
TextureManager.registerSprite("blocks/farm/hatch"),
|
||||
TextureManager.registerSprite("blocks/farm/valve"),
|
||||
TextureManager.registerSprite("blocks/farm/control")
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return The texture sprite from the type of the farm block
|
||||
*/
|
||||
@SideOnly(Side.CLIENT)
|
||||
public static TextureAtlasSprite getSprite(EnumFarmBlockType type, int side) {
|
||||
switch (type) {
|
||||
case PLAIN: {
|
||||
if (side == 2) {
|
||||
return sprites.get(TYPE_REVERSE);
|
||||
} else if (side == 0 || side == 1) {
|
||||
return sprites.get(TYPE_TOP);
|
||||
} else {
|
||||
return sprites.get(TYPE_PLAIN);
|
||||
}
|
||||
}
|
||||
case BAND:
|
||||
return sprites.get(TYPE_BAND);
|
||||
case GEARBOX:
|
||||
return sprites.get(TYPE_GEARS);
|
||||
case HATCH:
|
||||
return sprites.get(TYPE_HATCH);
|
||||
case VALVE:
|
||||
return sprites.get(TYPE_VALVE);
|
||||
case CONTROL:
|
||||
return sprites.get(TYPE_CONTROL);
|
||||
default:
|
||||
return sprites.get(TYPE_PLAIN);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return name().toLowerCase(Locale.ENGLISH);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -12,13 +12,12 @@ package forestry.farming.items;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import forestry.farming.models.EnumFarmBlockTexture;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import forestry.farming.render.EnumFarmBlockTexture;
|
||||
|
||||
public class ItemBlockFarm extends ItemBlock {
|
||||
|
||||
public ItemBlockFarm(Block block) {
|
||||
|
||||
+1
-61
@@ -8,10 +8,7 @@
|
||||
* Various Contributors including, but not limited to:
|
||||
* SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges
|
||||
******************************************************************************/
|
||||
package forestry.farming.render;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
package forestry.farming.models;
|
||||
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.init.Blocks;
|
||||
@@ -20,7 +17,6 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import forestry.core.render.TextureManager;
|
||||
import forestry.farming.blocks.EnumBlockFarmType;
|
||||
|
||||
public enum EnumFarmBlockTexture {
|
||||
BRICK_STONE(new ItemStack(Blocks.stonebrick, 1, 0)),
|
||||
@@ -35,68 +31,12 @@ public enum EnumFarmBlockTexture {
|
||||
QUARTZ_CHISELED(new ItemStack(Blocks.quartz_block, 1, 1)),
|
||||
QUARTZ_LINES(new ItemStack(Blocks.quartz_block, 1, 2));
|
||||
|
||||
private static final int TYPE_PLAIN = 0;
|
||||
private static final int TYPE_REVERSE = 1;
|
||||
private static final int TYPE_TOP = 2;
|
||||
private static final int TYPE_BAND = 3;
|
||||
private static final int TYPE_GEARS = 4;
|
||||
private static final int TYPE_HATCH = 5;
|
||||
private static final int TYPE_VALVE = 6;
|
||||
private static final int TYPE_CONTROL = 7;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private static List<TextureAtlasSprite> sprites;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public static void registerSprites() {
|
||||
sprites = Arrays.asList(
|
||||
TextureManager.registerSprite("blocks/farm/plain"),
|
||||
TextureManager.registerSprite("blocks/farm/reverse"),
|
||||
TextureManager.registerSprite("blocks/farm/top"),
|
||||
TextureManager.registerSprite("blocks/farm/band"),
|
||||
TextureManager.registerSprite("blocks/farm/gears"),
|
||||
TextureManager.registerSprite("blocks/farm/hatch"),
|
||||
TextureManager.registerSprite("blocks/farm/valve"),
|
||||
TextureManager.registerSprite("blocks/farm/control")
|
||||
);
|
||||
}
|
||||
|
||||
private final ItemStack base;
|
||||
|
||||
EnumFarmBlockTexture(ItemStack base) {
|
||||
this.base = base;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return The texture sprite from the type of the farm block
|
||||
*/
|
||||
@SideOnly(Side.CLIENT)
|
||||
public static TextureAtlasSprite getSprite(EnumBlockFarmType type, int side) {
|
||||
switch (type) {
|
||||
case BASIC: {
|
||||
if (side == 2) {
|
||||
return sprites.get(TYPE_REVERSE);
|
||||
} else if (side == 0 || side == 1) {
|
||||
return sprites.get(TYPE_TOP);
|
||||
} else {
|
||||
return sprites.get(TYPE_PLAIN);
|
||||
}
|
||||
}
|
||||
case BAND:
|
||||
return sprites.get(TYPE_BAND);
|
||||
case GEARBOX:
|
||||
return sprites.get(TYPE_GEARS);
|
||||
case HATCH:
|
||||
return sprites.get(TYPE_HATCH);
|
||||
case VALVE:
|
||||
return sprites.get(TYPE_VALVE);
|
||||
case CONTROL:
|
||||
return sprites.get(TYPE_CONTROL);
|
||||
default:
|
||||
return sprites.get(TYPE_PLAIN);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return The texture sprite from the material of the farm block
|
||||
*/
|
||||
@@ -0,0 +1,102 @@
|
||||
package forestry.farming.models;
|
||||
|
||||
import forestry.api.core.IModelBaker;
|
||||
import forestry.core.models.ModelBlockOverlay;
|
||||
import forestry.farming.blocks.BlockFarm;
|
||||
import forestry.farming.blocks.EnumFarmBlockType;
|
||||
import forestry.farming.tiles.TileFarm;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
public class ModelFarmBlock extends ModelBlockOverlay<BlockFarm> {
|
||||
|
||||
@Override
|
||||
public void renderInventory(BlockFarm blockFarm, ItemStack item, IModelBaker backer) {
|
||||
if (blockFarm == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
EnumFarmBlockTexture type = EnumFarmBlockTexture.getFromCompound(item.getTagCompound());
|
||||
|
||||
TextureAtlasSprite[] sprites = getSprites(type);
|
||||
TextureAtlasSprite[] overlaySprites = getOverlaySprites(EnumFarmBlockType.VALUES[item.getItemDamage()]);
|
||||
|
||||
backer.renderFaceYNeg(null, sprites[0]);
|
||||
backer.renderFaceYNeg(null, overlaySprites[0]);
|
||||
|
||||
backer.renderFaceYPos(null, sprites[1]);
|
||||
backer.renderFaceYPos(null, overlaySprites[1]);
|
||||
|
||||
backer.renderFaceZNeg(null, sprites[2]);
|
||||
backer.renderFaceZNeg(null, overlaySprites[2]);
|
||||
|
||||
backer.renderFaceZPos(null, sprites[3]);
|
||||
backer.renderFaceZPos(null, overlaySprites[3]);
|
||||
|
||||
backer.renderFaceXNeg(null, sprites[4]);
|
||||
backer.renderFaceXNeg(null, overlaySprites[4]);
|
||||
|
||||
backer.renderFaceXPos(null, sprites[5]);
|
||||
backer.renderFaceXPos(null, overlaySprites[5]);
|
||||
|
||||
blockFarm.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderInWorld(BlockFarm blockFarm, IBlockAccess world, BlockPos pos, IModelBaker backer) {
|
||||
|
||||
TileFarm farm = (TileFarm) world.getTileEntity(pos);
|
||||
|
||||
TextureAtlasSprite[] textures = getSprites(farm.getFarmBlockTexture());
|
||||
TextureAtlasSprite[] texturesOverlay = getOverlaySprites(farm.getFarmBlockType());
|
||||
|
||||
// Render the plain block.
|
||||
backer.renderStandardBlock(blockFarm, pos, textures);
|
||||
renderFarmOverlay(world, blockFarm, pos, backer, texturesOverlay);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private void renderFarmOverlay(IBlockAccess world, BlockFarm block, BlockPos pos, IModelBaker renderer, TextureAtlasSprite[] overlaySprites) {
|
||||
renderBottomFace(world, block, pos, renderer, overlaySprites[0], 0);
|
||||
renderTopFace(world, block, pos, renderer, overlaySprites[1], 0);
|
||||
renderEastFace(world, block, pos, renderer, overlaySprites[2], 0);
|
||||
renderWestFace(world, block, pos, renderer, overlaySprites[3], 0);
|
||||
renderNorthFace(world, block, pos, renderer, overlaySprites[4], 0);
|
||||
renderSouthFace(world, block, pos, renderer, overlaySprites[5], 0);
|
||||
}
|
||||
|
||||
private static TextureAtlasSprite[] getSprites(EnumFarmBlockTexture texture) {
|
||||
TextureAtlasSprite[] textures = new TextureAtlasSprite[6];
|
||||
textures[0] = EnumFarmBlockTexture.getSprite(texture, 0);
|
||||
textures[1] = EnumFarmBlockTexture.getSprite(texture, 1);
|
||||
textures[2] = EnumFarmBlockTexture.getSprite(texture, 2);
|
||||
textures[3] = EnumFarmBlockTexture.getSprite(texture, 3);
|
||||
textures[4] = EnumFarmBlockTexture.getSprite(texture, 4);
|
||||
textures[5] = EnumFarmBlockTexture.getSprite(texture, 5);
|
||||
return textures;
|
||||
}
|
||||
|
||||
private static TextureAtlasSprite[] getOverlaySprites(EnumFarmBlockType farmType) {
|
||||
TextureAtlasSprite[] textures = new TextureAtlasSprite[6];
|
||||
textures[0] = getOverlaySprite(farmType, 0);
|
||||
textures[1] = getOverlaySprite(farmType, 1);
|
||||
textures[2] = getOverlaySprite(farmType, 2);
|
||||
textures[3] = getOverlaySprite(farmType, 3);
|
||||
textures[4] = getOverlaySprite(farmType, 4);
|
||||
textures[5] = getOverlaySprite(farmType, 5);
|
||||
return textures;
|
||||
}
|
||||
|
||||
private static TextureAtlasSprite getOverlaySprite(EnumFarmBlockType texture, int side) {
|
||||
return EnumFarmBlockType.getSprite(texture, side);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TextureAtlasSprite getParticleTexture() {
|
||||
return getSprites(EnumFarmBlockTexture.BRICK)[0];
|
||||
}
|
||||
|
||||
}
|
||||
@@ -11,9 +11,9 @@
|
||||
package forestry.farming.proxy;
|
||||
|
||||
import net.minecraft.client.resources.model.ModelResourceLocation;
|
||||
import forestry.core.models.BlockModelIndex;
|
||||
import forestry.core.proxy.Proxies;
|
||||
import forestry.core.render.model.BlockModelIndex;
|
||||
import forestry.farming.render.ModelFarmBlock;
|
||||
import forestry.farming.models.ModelFarmBlock;
|
||||
import forestry.plugins.PluginFarming;
|
||||
|
||||
public class ProxyFarmingClient extends ProxyFarming {
|
||||
|
||||
@@ -1,117 +0,0 @@
|
||||
package forestry.farming.render;
|
||||
|
||||
import forestry.api.core.IModelBaker;
|
||||
import forestry.core.render.model.ModelBlockOverlay;
|
||||
import forestry.farming.blocks.BlockFarm;
|
||||
import forestry.farming.blocks.EnumBlockFarmType;
|
||||
import forestry.farming.tiles.TileFarm;
|
||||
import forestry.plugins.PluginFarming;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
public class ModelFarmBlock extends ModelBlockOverlay {
|
||||
|
||||
@Override
|
||||
public void renderInventory(Block block, ItemStack item, IModelBaker renderer) {
|
||||
if (block == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
EnumFarmBlockTexture type = EnumFarmBlockTexture.getFromCompound(item.getTagCompound());
|
||||
|
||||
TextureAtlasSprite[] textures = getSprites(type);
|
||||
TextureAtlasSprite[] texturesOverlay = getOverlaySprites(EnumBlockFarmType.VALUES[item.getItemDamage()]);
|
||||
|
||||
block.setBlockBoundsForItemRender();
|
||||
renderer.setRenderBoundsFromBlock(block);
|
||||
|
||||
// GL11.glTranslatef(translateX, translateY, translateZ);
|
||||
renderer.renderFaceYNeg(null, textures[0]);
|
||||
renderer.renderFaceYNeg(null, texturesOverlay[0]);
|
||||
|
||||
renderer.renderFaceYPos(null, textures[1]);
|
||||
renderer.renderFaceYPos(null, texturesOverlay[1]);
|
||||
|
||||
renderer.renderFaceZNeg(null, textures[2]);
|
||||
renderer.renderFaceZNeg(null, texturesOverlay[2]);
|
||||
|
||||
renderer.renderFaceZPos(null, textures[3]);
|
||||
renderer.renderFaceZPos(null, texturesOverlay[3]);
|
||||
|
||||
renderer.renderFaceXNeg(null, textures[4]);
|
||||
renderer.renderFaceXNeg(null, texturesOverlay[4]);
|
||||
|
||||
renderer.renderFaceXPos(null, textures[5]);
|
||||
renderer.renderFaceXPos(null, texturesOverlay[5]);
|
||||
|
||||
// GL11.glTranslatef(0.5F, 0.5F, 0.5F);
|
||||
|
||||
block.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderInWorld(Block block, IBlockAccess world, BlockPos pos, IModelBaker renderer) {
|
||||
|
||||
TileFarm farm = (TileFarm) world.getTileEntity(pos);
|
||||
|
||||
TextureAtlasSprite[] textures = getSprites(farm.getFarmBlockTexture());
|
||||
TextureAtlasSprite[] texturesOverlay = getOverlaySprites(EnumBlockFarmType.VALUES[farm.getBlockMetadata()]);
|
||||
|
||||
// Render the plain block.
|
||||
renderer.renderStandardBlock(block, pos, textures);
|
||||
renderFarmOverlay(world, PluginFarming.blocks.farm, pos, renderer, texturesOverlay);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private static void renderFarmOverlay(IBlockAccess world, BlockFarm block, BlockPos pos, IModelBaker renderer,
|
||||
TextureAtlasSprite[] texturesOverlay) {
|
||||
int mixedBrightness = block.getMixedBrightnessForBlock(world, pos);
|
||||
|
||||
float adjR = 0.5f;
|
||||
float adjG = 0.5f;
|
||||
float adjB = 0.5f;
|
||||
|
||||
renderBottomFace(world, block, pos, renderer, texturesOverlay[0], mixedBrightness, adjR, adjG, adjB);
|
||||
renderTopFace(world, block, pos, renderer, texturesOverlay[1], mixedBrightness, adjR, adjG, adjB);
|
||||
renderEastFace(world, block, pos, renderer, texturesOverlay[2], mixedBrightness, adjR, adjG, adjB);
|
||||
renderWestFace(world, block, pos, renderer, texturesOverlay[3], mixedBrightness, adjR, adjG, adjB);
|
||||
renderNorthFace(world, block, pos, renderer, texturesOverlay[4], mixedBrightness, adjR, adjG, adjB);
|
||||
renderSouthFace(world, block, pos, renderer, texturesOverlay[5], mixedBrightness, adjR, adjG, adjB);
|
||||
}
|
||||
|
||||
private static TextureAtlasSprite[] getSprites(EnumFarmBlockTexture texture) {
|
||||
TextureAtlasSprite[] textures = new TextureAtlasSprite[6];
|
||||
textures[0] = EnumFarmBlockTexture.getSprite(texture, 0);
|
||||
textures[1] = EnumFarmBlockTexture.getSprite(texture, 1);
|
||||
textures[2] = EnumFarmBlockTexture.getSprite(texture, 2);
|
||||
textures[3] = EnumFarmBlockTexture.getSprite(texture, 3);
|
||||
textures[4] = EnumFarmBlockTexture.getSprite(texture, 4);
|
||||
textures[5] = EnumFarmBlockTexture.getSprite(texture, 5);
|
||||
return textures;
|
||||
}
|
||||
|
||||
private static TextureAtlasSprite[] getOverlaySprites(EnumBlockFarmType type) {
|
||||
TextureAtlasSprite[] textures = new TextureAtlasSprite[6];
|
||||
textures[0] = getOverlaySprite(type, 0);
|
||||
textures[1] = getOverlaySprite(type, 1);
|
||||
textures[2] = getOverlaySprite(type, 2);
|
||||
textures[3] = getOverlaySprite(type, 3);
|
||||
textures[4] = getOverlaySprite(type, 4);
|
||||
textures[5] = getOverlaySprite(type, 5);
|
||||
return textures;
|
||||
}
|
||||
|
||||
private static TextureAtlasSprite getOverlaySprite(EnumBlockFarmType texture, int side) {
|
||||
return EnumFarmBlockTexture.getSprite(texture, side);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TextureAtlasSprite getParticleTexture() {
|
||||
return getSprites(EnumFarmBlockTexture.BRICK)[0];
|
||||
}
|
||||
|
||||
}
|
||||
@@ -34,10 +34,11 @@ import forestry.core.network.DataInputStreamForestry;
|
||||
import forestry.core.network.DataOutputStreamForestry;
|
||||
import forestry.core.network.IStreamableGui;
|
||||
import forestry.core.tiles.ITitled;
|
||||
import forestry.farming.blocks.EnumFarmBlockType;
|
||||
import forestry.farming.gui.ContainerFarm;
|
||||
import forestry.farming.gui.GuiFarm;
|
||||
import forestry.farming.models.EnumFarmBlockTexture;
|
||||
import forestry.farming.multiblock.MultiblockLogicFarm;
|
||||
import forestry.farming.render.EnumFarmBlockTexture;
|
||||
|
||||
public abstract class TileFarm extends MultiblockTileEntityForestry<MultiblockLogicFarm> implements IFarmComponent, IHintSource, ISocketable, IStreamableGui, IErrorLogicSource, IRestrictedAccess, ITitled {
|
||||
|
||||
@@ -49,13 +50,13 @@ public abstract class TileFarm extends MultiblockTileEntityForestry<MultiblockLo
|
||||
|
||||
@Override
|
||||
public void onMachineAssembled(IMultiblockController multiblockController, BlockPos minCoord, BlockPos maxCoord) {
|
||||
worldObj.notifyBlockOfStateChange(getPos(), getBlockType());
|
||||
worldObj.notifyBlockOfStateChange(getPos(), worldObj.getBlockState(pos).getBlock());
|
||||
markDirty();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMachineBroken() {
|
||||
worldObj.notifyBlockOfStateChange(getPos(), getBlockType());
|
||||
worldObj.notifyBlockOfStateChange(getPos(), worldObj.getBlockState(pos).getBlock());
|
||||
markDirty();
|
||||
}
|
||||
|
||||
@@ -94,6 +95,10 @@ public abstract class TileFarm extends MultiblockTileEntityForestry<MultiblockLo
|
||||
public EnumFarmBlockTexture getFarmBlockTexture() {
|
||||
return farmBlockTexture;
|
||||
}
|
||||
|
||||
public EnumFarmBlockType getFarmBlockType() {
|
||||
return EnumFarmBlockType.VALUES[getBlockMetadata()];
|
||||
}
|
||||
|
||||
/* TILEFORESTRY */
|
||||
|
||||
|
||||
Reference in new issue
Block a user