restore proper engine breaking icons, re-optimize textures

This commit is contained in:
asiekierka 2015-09-28 10:46:08 +02:00
parent 9c55d79861
commit 3e7e37cebe
28 changed files with 54 additions and 33 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 282 B

After

Width:  |  Height:  |  Size: 281 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 186 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 306 B

After

Width:  |  Height:  |  Size: 305 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 345 B

After

Width:  |  Height:  |  Size: 344 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 978 B

After

Width:  |  Height:  |  Size: 977 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 184 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 344 B

After

Width:  |  Height:  |  Size: 250 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 223 B

After

Width:  |  Height:  |  Size: 259 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 407 B

After

Width:  |  Height:  |  Size: 406 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 209 B

After

Width:  |  Height:  |  Size: 208 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 209 B

After

Width:  |  Height:  |  Size: 208 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 456 B

After

Width:  |  Height:  |  Size: 455 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 789 B

After

Width:  |  Height:  |  Size: 787 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 977 B

After

Width:  |  Height:  |  Size: 976 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 759 B

After

Width:  |  Height:  |  Size: 758 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 760 B

After

Width:  |  Height:  |  Size: 759 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 708 B

After

Width:  |  Height:  |  Size: 707 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 212 B

After

Width:  |  Height:  |  Size: 211 B

View file

@ -361,7 +361,7 @@ public class BuildCraftCore extends BuildCraftMod {
engineBlock = (BlockEngine) CompatHooks.INSTANCE.getBlock(BlockEngine.class); engineBlock = (BlockEngine) CompatHooks.INSTANCE.getBlock(BlockEngine.class);
CoreProxy.proxy.registerBlock(engineBlock, ItemEngine.class); CoreProxy.proxy.registerBlock(engineBlock, ItemEngine.class);
engineBlock.registerTile((Class<? extends TileEngineBase>) CompatHooks.INSTANCE.getTile(TileEngineWood.class), "tile.engineWood"); engineBlock.registerTile((Class<? extends TileEngineBase>) CompatHooks.INSTANCE.getTile(TileEngineWood.class), "tile.engineWood", "buildcraftcore:engineWood");
CoreProxy.proxy.registerTileEntity(TileEngineWood.class, "net.minecraft.src.buildcraft.energy.TileEngineWood"); CoreProxy.proxy.registerTileEntity(TileEngineWood.class, "net.minecraft.src.buildcraft.energy.TileEngineWood");
markerBlock = (BlockMarker) CompatHooks.INSTANCE.getBlock(BlockMarker.class); markerBlock = (BlockMarker) CompatHooks.INSTANCE.getBlock(BlockMarker.class);

View file

@ -100,7 +100,6 @@ public class BuildCraftEnergy extends BuildCraftMod {
public static Item bucketRedPlasma; public static Item bucketRedPlasma;
public static Item fuel; public static Item fuel;
public static Achievement engineAchievement1;
public static Achievement engineAchievement2; public static Achievement engineAchievement2;
public static Achievement engineAchievement3; public static Achievement engineAchievement3;
@ -288,9 +287,9 @@ public class BuildCraftEnergy extends BuildCraftMod {
BuildcraftFuelRegistry.coolant.addSolidCoolant(StackKey.stack(Blocks.ice), StackKey.fluid(FluidRegistry.WATER), 1.5f); BuildcraftFuelRegistry.coolant.addSolidCoolant(StackKey.stack(Blocks.ice), StackKey.fluid(FluidRegistry.WATER), 1.5f);
BuildcraftFuelRegistry.coolant.addSolidCoolant(StackKey.stack(Blocks.packed_ice), StackKey.fluid(FluidRegistry.WATER), 2.0f); BuildcraftFuelRegistry.coolant.addSolidCoolant(StackKey.stack(Blocks.packed_ice), StackKey.fluid(FluidRegistry.WATER), 2.0f);
BuildCraftCore.engineBlock.registerTile(TileEngineStone.class, "tile.engineStone"); BuildCraftCore.engineBlock.registerTile(TileEngineStone.class, "tile.engineStone", "buildcraftenergy:engineStone");
BuildCraftCore.engineBlock.registerTile(TileEngineIron.class, "tile.engineIron"); BuildCraftCore.engineBlock.registerTile(TileEngineIron.class, "tile.engineIron", "buildcraftenergy:engineIron");
BuildCraftCore.engineBlock.registerTile(TileEngineCreative.class, "tile.engineCreative"); BuildCraftCore.engineBlock.registerTile(TileEngineCreative.class, "tile.engineCreative", "buildcraftenergy:engineCreative");
InterModComms.registerHandler(new IMCHandlerEnergy()); InterModComms.registerHandler(new IMCHandlerEnergy());

View file

@ -15,6 +15,7 @@ import buildcraft.core.lib.engines.TileEngineBase;
public class BlockEngine extends BlockEngineBase { public class BlockEngine extends BlockEngineBase {
private final ArrayList<Class<? extends TileEngineBase>> engineTiles; private final ArrayList<Class<? extends TileEngineBase>> engineTiles;
private final ArrayList<String> names; private final ArrayList<String> names;
private final ArrayList<String> texturePaths;
public BlockEngine() { public BlockEngine() {
super(); super();
@ -22,6 +23,20 @@ public class BlockEngine extends BlockEngineBase {
engineTiles = new ArrayList<Class<? extends TileEngineBase>>(16); engineTiles = new ArrayList<Class<? extends TileEngineBase>>(16);
names = new ArrayList<String>(16); names = new ArrayList<String>(16);
texturePaths = new ArrayList<String>(16);
}
@Override
public String getTexturePrefix(int meta, boolean addPrefix) {
if (meta < texturePaths.size()) {
if (addPrefix) {
return texturePaths.get(meta).replaceAll(":", ":textures/blocks/");
} else {
return texturePaths.get(meta);
}
} else {
return null;
}
} }
@Override @Override
@ -29,9 +44,10 @@ public class BlockEngine extends BlockEngineBase {
return names.get(metadata % names.size()); return names.get(metadata % names.size());
} }
public void registerTile(Class<? extends TileEngineBase> engineTile, String name) { public void registerTile(Class<? extends TileEngineBase> engineTile, String name, String texturePath) {
engineTiles.add(engineTile); engineTiles.add(engineTile);
names.add(name); names.add(name);
texturePaths.add(texturePath);
} }
@Override @Override

View file

@ -22,11 +22,6 @@ public class TileEngineWood extends TileEngineBase implements IRedstoneEngine {
private boolean hasSent = false; private boolean hasSent = false;
@Override
public String getResourcePrefix() {
return "buildcraftcore:textures/blocks/engineWood";
}
@Override @Override
public ResourceLocation getTrunkTexture(EnergyStage stage) { public ResourceLocation getTrunkTexture(EnergyStage stage) {
return super.getTrunkTexture(stage == EnergyStage.RED && progress < 0.5 ? EnergyStage.YELLOW : stage); return super.getTrunkTexture(stage == EnergyStage.RED && progress < 0.5 ? EnergyStage.YELLOW : stage);

View file

@ -13,16 +13,20 @@ import java.util.Random;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.IIcon;
import net.minecraft.util.MovingObjectPosition; import net.minecraft.util.MovingObjectPosition;
import net.minecraft.util.Vec3; import net.minecraft.util.Vec3;
import net.minecraft.world.IBlockAccess; import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World; import net.minecraft.world.World;
import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.common.util.ForgeDirection;
import buildcraft.BuildCraftCore; import buildcraft.BuildCraftCore;
@ -45,6 +49,27 @@ public abstract class BlockEngineBase extends BlockBuildCraft implements ICustom
super(Material.iron); super(Material.iron);
} }
public abstract String getTexturePrefix(int meta, boolean addPrefix);
@Override
@SideOnly(Side.CLIENT)
public IIcon getIconAbsolute(int side, int metadata) {
return icons[metadata] == null ? icons[0][0] : icons[metadata][0];
}
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister register) {
icons = new IIcon[16][];
for (int meta = 0; meta < 16; meta++) {
String prefix = getTexturePrefix(meta, false);
if (prefix != null) {
icons[meta] = new IIcon[1];
icons[meta][0] = register.registerIcon(prefix + "/icon");
}
}
}
@Override @Override
public boolean isOpaqueCube() { public boolean isOpaqueCube() {
return false; return false;

View file

@ -73,19 +73,17 @@ public abstract class TileEngineBase extends TileBuildCraft implements IPipeConn
} }
} }
public abstract String getResourcePrefix();
public ResourceLocation getBaseTexture() { public ResourceLocation getBaseTexture() {
return new ResourceLocation(getResourcePrefix() + "/base.png"); return new ResourceLocation(((BlockEngineBase) getBlockType()).getTexturePrefix(getBlockMetadata(), true) + "/base.png");
} }
public ResourceLocation getChamberTexture() { public ResourceLocation getChamberTexture() {
return new ResourceLocation(getResourcePrefix() + "/chamber.png"); return new ResourceLocation(((BlockEngineBase) getBlockType()).getTexturePrefix(getBlockMetadata(), true) + "/chamber.png");
} }
public ResourceLocation getTrunkTexture(EnergyStage stage) { public ResourceLocation getTrunkTexture(EnergyStage stage) {
if (ResourceUtils.resourceExists(getResourcePrefix() + "/trunk.png")) { if (ResourceUtils.resourceExists(((BlockEngineBase) getBlockType()).getTexturePrefix(getBlockMetadata(), true) + "/trunk.png")) {
return new ResourceLocation(getResourcePrefix() + "/trunk.png"); return new ResourceLocation(((BlockEngineBase) getBlockType()).getTexturePrefix(getBlockMetadata(), true) + "/trunk.png");
} }
switch (stage) { switch (stage) {

View file

@ -99,7 +99,10 @@ public class CoreProxyClient extends CoreProxy {
ClientRegistry.bindTileEntitySpecialRenderer(TileEngineBase.class, new RenderEngine()); ClientRegistry.bindTileEntitySpecialRenderer(TileEngineBase.class, new RenderEngine());
for (int i = 0; i < BuildCraftCore.engineBlock.getEngineCount(); i++) { for (int i = 0; i < BuildCraftCore.engineBlock.getEngineCount(); i++) {
RenderingEntityBlocks.blockByEntityRenders.put(new RenderingEntityBlocks.EntityRenderIndex(BuildCraftCore.engineBlock, i), new RenderEngine((TileEngineBase) BuildCraftCore.engineBlock.createTileEntity(null, i))); TileEngineBase engineTile = (TileEngineBase) BuildCraftCore.engineBlock.createTileEntity(null, i);
engineTile.blockType = BuildCraftCore.engineBlock;
engineTile.blockMetadata = i;
RenderingEntityBlocks.blockByEntityRenders.put(new RenderingEntityBlocks.EntityRenderIndex(BuildCraftCore.engineBlock, i), new RenderEngine(engineTile));
} }
} }

View file

@ -32,11 +32,6 @@ public class TileEngineCreative extends TileEngineBase {
return EnergyStage.BLUE; return EnergyStage.BLUE;
} }
@Override
public String getResourcePrefix() {
return "buildcraftenergy:textures/blocks/engineCreative";
}
@Override @Override
public boolean onBlockActivated(EntityPlayer player, ForgeDirection side) { public boolean onBlockActivated(EntityPlayer player, ForgeDirection side) {
if (!getWorldObj().isRemote) { if (!getWorldObj().isRemote) {

View file

@ -64,11 +64,6 @@ public class TileEngineIron extends TileEngineWithInventory implements IFluidHan
tankManager.add(tankCoolant); tankManager.add(tankCoolant);
} }
@Override
public String getResourcePrefix() {
return "buildcraftenergy:textures/blocks/engineIron";
}
@Override @Override
public boolean onBlockActivated(EntityPlayer player, ForgeDirection side) { public boolean onBlockActivated(EntityPlayer player, ForgeDirection side) {
if (super.onBlockActivated(player, side)) { if (super.onBlockActivated(player, side)) {

View file

@ -41,11 +41,6 @@ public class TileEngineStone extends TileEngineWithInventory {
super(1); super(1);
} }
@Override
public String getResourcePrefix() {
return "buildcraftenergy:textures/blocks/engineStone";
}
@Override @Override
public boolean onBlockActivated(EntityPlayer player, ForgeDirection side) { public boolean onBlockActivated(EntityPlayer player, ForgeDirection side) {
if (super.onBlockActivated(player, side)) { if (super.onBlockActivated(player, side)) {