Fix oil, fuel, quarry and pump

This commit is contained in:
Christian 2013-03-29 22:55:53 -04:00
parent 4a5d5b219d
commit 738d5ede52
12 changed files with 69 additions and 17 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4 KiB

After

Width:  |  Height:  |  Size: 6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.9 KiB

After

Width:  |  Height:  |  Size: 4.7 KiB

View file

Before

Width:  |  Height:  |  Size: 567 B

After

Width:  |  Height:  |  Size: 567 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 321 B

After

Width:  |  Height:  |  Size: 13 KiB

View file

@ -0,0 +1,32 @@
0*2
1*2
2*2
3*2
4*2
5*2
6*2
7*2
8*2
9*2
10*2
11*2
12*2
13*2
14*2
15*2
16*2
17*2
18*2
19*2
20*2
21*2
22*2
23*2
24*2
25*2
26*2
27*2
28*2
29*2
30*2
31*2

View file

@ -11,13 +11,18 @@ package buildcraft;
import java.util.List; import java.util.List;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.client.event.TextureStitchEvent;
import net.minecraftforge.common.Configuration; import net.minecraftforge.common.Configuration;
import net.minecraftforge.common.ForgeChunkManager; import net.minecraftforge.common.ForgeChunkManager;
import net.minecraftforge.common.ForgeChunkManager.Ticket; import net.minecraftforge.common.ForgeChunkManager.Ticket;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.common.Property; import net.minecraftforge.common.Property;
import net.minecraftforge.event.ForgeSubscribe;
import buildcraft.core.DefaultProps; import buildcraft.core.DefaultProps;
import buildcraft.core.Version; import buildcraft.core.Version;
import buildcraft.core.proxy.CoreProxy; import buildcraft.core.proxy.CoreProxy;
@ -35,6 +40,7 @@ import buildcraft.factory.BptBlockFrame;
import buildcraft.factory.BptBlockRefinery; import buildcraft.factory.BptBlockRefinery;
import buildcraft.factory.BptBlockTank; import buildcraft.factory.BptBlockTank;
import buildcraft.factory.FactoryProxy; import buildcraft.factory.FactoryProxy;
import buildcraft.factory.FactoryProxyClient;
import buildcraft.factory.GuiHandler; import buildcraft.factory.GuiHandler;
import buildcraft.factory.TileAutoWorkbench; import buildcraft.factory.TileAutoWorkbench;
import buildcraft.factory.TileHopper; import buildcraft.factory.TileHopper;
@ -57,6 +63,8 @@ import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent; import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.network.NetworkMod; import cpw.mods.fml.common.network.NetworkMod;
import cpw.mods.fml.common.network.NetworkRegistry; import cpw.mods.fml.common.network.NetworkRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@Mod(name = "BuildCraft Factory", version = Version.VERSION, useMetadata = false, modid = "BuildCraft|Factory", dependencies = DefaultProps.DEPENDENCY_CORE) @Mod(name = "BuildCraft Factory", version = Version.VERSION, useMetadata = false, modid = "BuildCraft|Factory", dependencies = DefaultProps.DEPENDENCY_CORE)
@NetworkMod(channels = { DefaultProps.NET_CHANNEL_NAME }, packetHandler = PacketHandlerFactory.class, clientSideRequired = true, serverSideRequired = true) @NetworkMod(channels = { DefaultProps.NET_CHANNEL_NAME }, packetHandler = PacketHandlerFactory.class, clientSideRequired = true, serverSideRequired = true)
@ -208,6 +216,8 @@ public class BuildCraftFactory {
{ {
BuildCraftCore.mainConfiguration.save(); BuildCraftCore.mainConfiguration.save();
} }
MinecraftForge.EVENT_BUS.register(this);
} }
public static void loadRecipes() { public static void loadRecipes() {
@ -251,4 +261,16 @@ public class BuildCraftFactory {
} }
} }
@ForgeSubscribe
@SideOnly(Side.CLIENT)
public void loadTextures(TextureStitchEvent.Pre evt) {
if (evt.map == Minecraft.getMinecraft().renderEngine.textureMapBlocks) {
TextureMap terrainTextures = evt.map;
FactoryProxyClient.pumpTexture = terrainTextures.registerIcon("buildcraft:pump_tube");
FactoryProxyClient.drillTexture = terrainTextures.registerIcon("buildcraft:blockDrillTexture");
FactoryProxyClient.drillHeadTexture = terrainTextures.registerIcon("buildcraft:blockDrillHeadTexture");
}
}
} }

View file

@ -133,8 +133,8 @@ public class BptBlock {
*/ */
public void buildBlock(BptSlotInfo slot, IBptContext context) { public void buildBlock(BptSlotInfo slot, IBptContext context) {
// Meta needs to be specified twice, depending on the block behavior // Meta needs to be specified twice, depending on the block behavior
context.world().setBlock(slot.x, slot.y, slot.z, slot.blockId, slot.meta,1); context.world().setBlock(slot.x, slot.y, slot.z, slot.blockId, slot.meta,3);
context.world().setBlockMetadataWithNotify(slot.x, slot.y, slot.z, slot.meta,1); context.world().setBlockMetadataWithNotify(slot.x, slot.y, slot.z, slot.meta,3);
if (Block.blocksList[slot.blockId] instanceof BlockContainer) { if (Block.blocksList[slot.blockId] instanceof BlockContainer) {
TileEntity tile = context.world().getBlockTileEntity(slot.x, slot.y, slot.z); TileEntity tile = context.world().getBlockTileEntity(slot.x, slot.y, slot.z);

View file

@ -207,6 +207,7 @@ public class EntityRobot extends Entity implements IEntityAdditionalSpawnData {
if (a.slot != null) { if (a.slot != null) {
BptSlot target = a.slot; BptSlot target = a.slot;
System.out.printf("RobotChanging %d %d %d %s\n",target.x, target.y, target.z, target.mode);
if (wait <= 0 && BlockUtil.canChangeBlock(worldObj, target.x, target.y, target.z)) { if (wait <= 0 && BlockUtil.canChangeBlock(worldObj, target.x, target.y, target.z)) {
if (!CoreProxy.proxy.isRenderWorld(worldObj)) { if (!CoreProxy.proxy.isRenderWorld(worldObj)) {
@ -214,13 +215,13 @@ public class EntityRobot extends Entity implements IEntityAdditionalSpawnData {
if (target.mode == Mode.ClearIfInvalid) { if (target.mode == Mode.ClearIfInvalid) {
if (!target.isValid(a.context)) { if (!target.isValid(a.context)) {
worldObj.setBlock(target.x, target.y, target.z, 0, 0,1); worldObj.setBlock(target.x, target.y, target.z, 0, 0,3);
} }
} else if (target.stackToUse != null) { } else if (target.stackToUse != null) {
worldObj.setBlock(target.x, target.y, target.z, 0); worldObj.setBlock(target.x, target.y, target.z, 0);
throw new RuntimeErrorException(null, "NOT IMPLEMENTED"); throw new RuntimeException("NOT IMPLEMENTED");
// target.stackToUse.getItem().onItemUse(target.stackToUse, // target.stackToUse.getItem().onItemUse(target.stackToUse,
// CoreProxy.getBuildCraftPlayer(worldObj), worldObj, target.x, target.y - 1, // CoreProxy.getBuildCraftPlayer(worldObj), worldObj, target.x, target.y - 1,
// target.z, 1); // target.z, 1);

View file

@ -3,6 +3,7 @@ package buildcraft.core.render;
import java.util.HashMap; import java.util.HashMap;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.Tessellator;
import net.minecraft.world.IBlockAccess; import net.minecraft.world.IBlockAccess;
@ -96,7 +97,7 @@ public class RenderingEntityBlocks implements ISimpleBlockRenderingHandler {
// renderblocks.renderStandardBlock(block, i, j, k); // renderblocks.renderStandardBlock(block, i, j, k);
} else if (block.getRenderType() == BuildCraftCore.legacyPipeModel) { } else if (block.getRenderType() == BuildCraftCore.legacyPipeModel) {
Minecraft.getMinecraft().renderEngine.bindTexture("/terrain.png");
legacyPipeRender(renderer, world, x, y, z, block, modelId); legacyPipeRender(renderer, world, x, y, z, block, modelId);
} }
@ -114,7 +115,7 @@ public class RenderingEntityBlocks implements ISimpleBlockRenderingHandler {
return BuildCraftCore.blockByEntityModel; return BuildCraftCore.blockByEntityModel;
} }
/* LEGACY PIPE RENDERING */ /* LEGACY PIPE RENDERING and quarry frames! */
private void legacyPipeRender(RenderBlocks renderblocks, IBlockAccess iblockaccess, int i, int j, int k, Block block, int l) { private void legacyPipeRender(RenderBlocks renderblocks, IBlockAccess iblockaccess, int i, int j, int k, Block block, int l) {
float minSize = Utils.pipeMinPos; float minSize = Utils.pipeMinPos;
float maxSize = Utils.pipeMaxPos; float maxSize = Utils.pipeMaxPos;

View file

@ -104,7 +104,7 @@ public class BlockFrame extends Block implements IFramePipeConnection {
public AxisAlignedBB getSelectedBoundingBoxFromPool(World world, int i, int j, int k) { public AxisAlignedBB getSelectedBoundingBoxFromPool(World world, int i, int j, int k) {
return getCollisionBoundingBoxFromPool(world, i, j, k); return getCollisionBoundingBoxFromPool(world, i, j, k);
} }
@SuppressWarnings("rawtypes") @SuppressWarnings("rawtypes")
@Override @Override
public void addCollisionBoxesToList(World world, int i, int j, int k, AxisAlignedBB axisalignedbb, List arraylist, Entity par7Entity) { public void addCollisionBoxesToList(World world, int i, int j, int k, AxisAlignedBB axisalignedbb, List arraylist, Entity par7Entity) {
@ -196,6 +196,6 @@ public class BlockFrame extends Block implements IFramePipeConnection {
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void registerIcons(IconRegister par1IconRegister) public void registerIcons(IconRegister par1IconRegister)
{ {
par1IconRegister.registerIcon("buildcraft:blockFrame"); blockIcon = par1IconRegister.registerIcon("buildcraft:blockFrame");
} }
} }

View file

@ -44,9 +44,9 @@ public class BlockPump extends BlockContainer {
public Icon getBlockTextureFromSideAndMetadata(int i, int j) { public Icon getBlockTextureFromSideAndMetadata(int i, int j) {
switch (i) { switch (i) {
case 0: case 0:
return textureTop;
case 1:
return textureBottom; return textureBottom;
case 1:
return textureTop;
default: default:
return textureSide; return textureSide;
} }

View file

@ -20,9 +20,9 @@ import cpw.mods.fml.client.registry.ClientRegistry;
import cpw.mods.fml.client.registry.RenderingRegistry; import cpw.mods.fml.client.registry.RenderingRegistry;
public class FactoryProxyClient extends FactoryProxy { public class FactoryProxyClient extends FactoryProxy {
private Icon pumpTexture; public static Icon pumpTexture;
private Icon drillTexture; public static Icon drillTexture;
private Icon drillHeadTexture; public static Icon drillHeadTexture;
@Override @Override
public void initializeTileEntities() { public void initializeTileEntities() {
@ -41,10 +41,6 @@ public class FactoryProxyClient extends FactoryProxy {
@Override @Override
public void initializeEntityRenders() { public void initializeEntityRenders() {
RenderingRegistry.registerEntityRenderingHandler(EntityMechanicalArm.class, new RenderVoid()); RenderingRegistry.registerEntityRenderingHandler(EntityMechanicalArm.class, new RenderVoid());
TextureMap terrainTextures = Minecraft.getMinecraft().renderEngine.textureMapItems;
pumpTexture = terrainTextures.registerIcon("buildcraft:blockPumpTubeTexture");
drillTexture = terrainTextures.registerIcon("buildcraft:blockDrillTexture");
drillHeadTexture = terrainTextures.registerIcon("buildcraft:blockDrillHeadTexture");
} }
@Override @Override