restore proper engine breaking icons, re-optimize textures
Before Width: | Height: | Size: 282 B After Width: | Height: | Size: 281 B |
Before Width: | Height: | Size: 186 B |
Before Width: | Height: | Size: 306 B After Width: | Height: | Size: 305 B |
Before Width: | Height: | Size: 345 B After Width: | Height: | Size: 344 B |
Before Width: | Height: | Size: 978 B After Width: | Height: | Size: 977 B |
After Width: | Height: | Size: 184 B |
Before Width: | Height: | Size: 344 B After Width: | Height: | Size: 250 B |
Before Width: | Height: | Size: 223 B After Width: | Height: | Size: 259 B |
Before Width: | Height: | Size: 407 B After Width: | Height: | Size: 406 B |
Before Width: | Height: | Size: 209 B After Width: | Height: | Size: 208 B |
Before Width: | Height: | Size: 209 B After Width: | Height: | Size: 208 B |
Before Width: | Height: | Size: 456 B After Width: | Height: | Size: 455 B |
Before Width: | Height: | Size: 789 B After Width: | Height: | Size: 787 B |
Before Width: | Height: | Size: 977 B After Width: | Height: | Size: 976 B |
Before Width: | Height: | Size: 759 B After Width: | Height: | Size: 758 B |
Before Width: | Height: | Size: 760 B After Width: | Height: | Size: 759 B |
Before Width: | Height: | Size: 708 B After Width: | Height: | Size: 707 B |
Before Width: | Height: | Size: 212 B After Width: | Height: | Size: 211 B |
|
@ -361,7 +361,7 @@ public class BuildCraftCore extends BuildCraftMod {
|
|||
|
||||
engineBlock = (BlockEngine) CompatHooks.INSTANCE.getBlock(BlockEngine.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");
|
||||
|
||||
markerBlock = (BlockMarker) CompatHooks.INSTANCE.getBlock(BlockMarker.class);
|
||||
|
|
|
@ -100,7 +100,6 @@ public class BuildCraftEnergy extends BuildCraftMod {
|
|||
public static Item bucketRedPlasma;
|
||||
public static Item fuel;
|
||||
|
||||
public static Achievement engineAchievement1;
|
||||
public static Achievement engineAchievement2;
|
||||
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.packed_ice), StackKey.fluid(FluidRegistry.WATER), 2.0f);
|
||||
|
||||
BuildCraftCore.engineBlock.registerTile(TileEngineStone.class, "tile.engineStone");
|
||||
BuildCraftCore.engineBlock.registerTile(TileEngineIron.class, "tile.engineIron");
|
||||
BuildCraftCore.engineBlock.registerTile(TileEngineCreative.class, "tile.engineCreative");
|
||||
BuildCraftCore.engineBlock.registerTile(TileEngineStone.class, "tile.engineStone", "buildcraftenergy:engineStone");
|
||||
BuildCraftCore.engineBlock.registerTile(TileEngineIron.class, "tile.engineIron", "buildcraftenergy:engineIron");
|
||||
BuildCraftCore.engineBlock.registerTile(TileEngineCreative.class, "tile.engineCreative", "buildcraftenergy:engineCreative");
|
||||
|
||||
InterModComms.registerHandler(new IMCHandlerEnergy());
|
||||
|
||||
|
|
|
@ -15,6 +15,7 @@ import buildcraft.core.lib.engines.TileEngineBase;
|
|||
public class BlockEngine extends BlockEngineBase {
|
||||
private final ArrayList<Class<? extends TileEngineBase>> engineTiles;
|
||||
private final ArrayList<String> names;
|
||||
private final ArrayList<String> texturePaths;
|
||||
|
||||
public BlockEngine() {
|
||||
super();
|
||||
|
@ -22,6 +23,20 @@ public class BlockEngine extends BlockEngineBase {
|
|||
|
||||
engineTiles = new ArrayList<Class<? extends TileEngineBase>>(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
|
||||
|
@ -29,9 +44,10 @@ public class BlockEngine extends BlockEngineBase {
|
|||
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);
|
||||
names.add(name);
|
||||
texturePaths.add(texturePath);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -22,11 +22,6 @@ public class TileEngineWood extends TileEngineBase implements IRedstoneEngine {
|
|||
|
||||
private boolean hasSent = false;
|
||||
|
||||
@Override
|
||||
public String getResourcePrefix() {
|
||||
return "buildcraftcore:textures/blocks/engineWood";
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResourceLocation getTrunkTexture(EnergyStage stage) {
|
||||
return super.getTrunkTexture(stage == EnergyStage.RED && progress < 0.5 ? EnergyStage.YELLOW : stage);
|
||||
|
|
|
@ -13,16 +13,20 @@ import java.util.Random;
|
|||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
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 buildcraft.BuildCraftCore;
|
||||
|
@ -45,6 +49,27 @@ public abstract class BlockEngineBase extends BlockBuildCraft implements ICustom
|
|||
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
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
|
|
|
@ -73,19 +73,17 @@ public abstract class TileEngineBase extends TileBuildCraft implements IPipeConn
|
|||
}
|
||||
}
|
||||
|
||||
public abstract String getResourcePrefix();
|
||||
|
||||
public ResourceLocation getBaseTexture() {
|
||||
return new ResourceLocation(getResourcePrefix() + "/base.png");
|
||||
return new ResourceLocation(((BlockEngineBase) getBlockType()).getTexturePrefix(getBlockMetadata(), true) + "/base.png");
|
||||
}
|
||||
|
||||
public ResourceLocation getChamberTexture() {
|
||||
return new ResourceLocation(getResourcePrefix() + "/chamber.png");
|
||||
return new ResourceLocation(((BlockEngineBase) getBlockType()).getTexturePrefix(getBlockMetadata(), true) + "/chamber.png");
|
||||
}
|
||||
|
||||
public ResourceLocation getTrunkTexture(EnergyStage stage) {
|
||||
if (ResourceUtils.resourceExists(getResourcePrefix() + "/trunk.png")) {
|
||||
return new ResourceLocation(getResourcePrefix() + "/trunk.png");
|
||||
if (ResourceUtils.resourceExists(((BlockEngineBase) getBlockType()).getTexturePrefix(getBlockMetadata(), true) + "/trunk.png")) {
|
||||
return new ResourceLocation(((BlockEngineBase) getBlockType()).getTexturePrefix(getBlockMetadata(), true) + "/trunk.png");
|
||||
}
|
||||
|
||||
switch (stage) {
|
||||
|
|
|
@ -99,7 +99,10 @@ public class CoreProxyClient extends CoreProxy {
|
|||
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEngineBase.class, new RenderEngine());
|
||||
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));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -32,11 +32,6 @@ public class TileEngineCreative extends TileEngineBase {
|
|||
return EnergyStage.BLUE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getResourcePrefix() {
|
||||
return "buildcraftenergy:textures/blocks/engineCreative";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(EntityPlayer player, ForgeDirection side) {
|
||||
if (!getWorldObj().isRemote) {
|
||||
|
|
|
@ -64,11 +64,6 @@ public class TileEngineIron extends TileEngineWithInventory implements IFluidHan
|
|||
tankManager.add(tankCoolant);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getResourcePrefix() {
|
||||
return "buildcraftenergy:textures/blocks/engineIron";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(EntityPlayer player, ForgeDirection side) {
|
||||
if (super.onBlockActivated(player, side)) {
|
||||
|
|
|
@ -41,11 +41,6 @@ public class TileEngineStone extends TileEngineWithInventory {
|
|||
super(1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getResourcePrefix() {
|
||||
return "buildcraftenergy:textures/blocks/engineStone";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(EntityPlayer player, ForgeDirection side) {
|
||||
if (super.onBlockActivated(player, side)) {
|
||||
|
|