fix #3089, revert pipe speed tweaks for now
This commit is contained in:
parent
9abd7e2a8a
commit
728da1fc38
10 changed files with 48 additions and 44 deletions
|
@ -3,7 +3,6 @@ Improvements:
|
||||||
* [#3088] Miner Robots now support enchantments correctly. (asie)
|
* [#3088] Miner Robots now support enchantments correctly. (asie)
|
||||||
* Robots ignore broken tools and unload them when they break - think Tinkers' Construct here. (asie)
|
* Robots ignore broken tools and unload them when they break - think Tinkers' Construct here. (asie)
|
||||||
* Stained Glass Pipe recipes now support ore dictionary colored glass. (asie)
|
* Stained Glass Pipe recipes now support ore dictionary colored glass. (asie)
|
||||||
* Tweaked item movement speed in pipes. (asie)
|
|
||||||
|
|
||||||
Removals:
|
Removals:
|
||||||
|
|
||||||
|
@ -14,6 +13,7 @@ Bugs fixed:
|
||||||
* [#3092, #3087, #3085] Robot unstucking code being a terrible hack - removed it for now (asie)
|
* [#3092, #3087, #3085] Robot unstucking code being a terrible hack - removed it for now (asie)
|
||||||
* [#3091, #3083] Various recipe disabling crashes (asie)
|
* [#3091, #3083] Various recipe disabling crashes (asie)
|
||||||
* [#3090] Robots delete repairable tools after they break (asie)
|
* [#3090] Robots delete repairable tools after they break (asie)
|
||||||
|
* [#3089] Integration Table dupe (asie)
|
||||||
* [#3082] Void not killing robots (asie)
|
* [#3082] Void not killing robots (asie)
|
||||||
* [#3081] Emzuli Pipe behaviour bug (asie)
|
* [#3081] Emzuli Pipe behaviour bug (asie)
|
||||||
|
|
||||||
|
|
|
@ -57,11 +57,6 @@ public class CoreProxy implements ICoreProxy {
|
||||||
entity.worldObj.removeEntity(entity);
|
entity.worldObj.removeEntity(entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* WRAPPER */
|
|
||||||
@SuppressWarnings("rawtypes")
|
|
||||||
public void feedSubBlocks(Block block, CreativeTabs tab, List itemList) {
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getItemDisplayName(ItemStack newStack) {
|
public String getItemDisplayName(ItemStack newStack) {
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
|
@ -66,16 +66,6 @@ public class CoreProxyClient extends CoreProxy {
|
||||||
}
|
}
|
||||||
|
|
||||||
/* WRAPPER */
|
/* WRAPPER */
|
||||||
@SuppressWarnings("rawtypes")
|
|
||||||
@Override
|
|
||||||
public void feedSubBlocks(Block block, CreativeTabs tab, List itemList) {
|
|
||||||
if (block == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
block.getSubBlocks(Item.getItemFromBlock(block), tab, itemList);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getItemDisplayName(ItemStack stack) {
|
public String getItemDisplayName(ItemStack stack) {
|
||||||
if (stack.getItem() == null) {
|
if (stack.getItem() == null) {
|
||||||
|
@ -154,7 +144,7 @@ public class CoreProxyClient extends CoreProxy {
|
||||||
public TileEntity getServerTile(TileEntity source) {
|
public TileEntity getServerTile(TileEntity source) {
|
||||||
if (BuildCraftCore.useServerDataOnClient && Minecraft.getMinecraft().isSingleplayer() && source.getWorldObj().isRemote) {
|
if (BuildCraftCore.useServerDataOnClient && Minecraft.getMinecraft().isSingleplayer() && source.getWorldObj().isRemote) {
|
||||||
WorldServer w = DimensionManager.getWorld(source.getWorldObj().provider.dimensionId);
|
WorldServer w = DimensionManager.getWorld(source.getWorldObj().provider.dimensionId);
|
||||||
if (w != null) {
|
if (w != null && w.getChunkProvider() != null) {
|
||||||
Chunk c = w.getChunkFromBlockCoords(source.xCoord, source.zCoord);
|
Chunk c = w.getChunkFromBlockCoords(source.xCoord, source.zCoord);
|
||||||
if (c != null) {
|
if (c != null) {
|
||||||
TileEntity t = c.getTileEntityUnsafe(source.xCoord & 15, source.yCoord, source.zCoord & 15);
|
TileEntity t = c.getTileEntityUnsafe(source.xCoord & 15, source.yCoord, source.zCoord & 15);
|
||||||
|
|
|
@ -25,7 +25,6 @@ import net.minecraftforge.client.event.DrawBlockHighlightEvent;
|
||||||
import buildcraft.core.lib.render.ICustomHighlight;
|
import buildcraft.core.lib.render.ICustomHighlight;
|
||||||
|
|
||||||
public class BlockHighlightHandler {
|
public class BlockHighlightHandler {
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public void handleBlockHighlight(DrawBlockHighlightEvent e) {
|
public void handleBlockHighlight(DrawBlockHighlightEvent e) {
|
||||||
|
@ -37,18 +36,21 @@ public class BlockHighlightHandler {
|
||||||
if (block instanceof ICustomHighlight) {
|
if (block instanceof ICustomHighlight) {
|
||||||
AxisAlignedBB[] aabbs = ((ICustomHighlight) block).getBoxes(e.player.worldObj, x, y, z, e.player);
|
AxisAlignedBB[] aabbs = ((ICustomHighlight) block).getBoxes(e.player.worldObj, x, y, z, e.player);
|
||||||
Vec3 pos = e.player.getPosition(e.partialTicks);
|
Vec3 pos = e.player.getPosition(e.partialTicks);
|
||||||
|
|
||||||
GL11.glEnable(GL11.GL_BLEND);
|
GL11.glEnable(GL11.GL_BLEND);
|
||||||
OpenGlHelper.glBlendFunc(770, 771, 1, 0);
|
OpenGlHelper.glBlendFunc(770, 771, 1, 0);
|
||||||
GL11.glColor4f(0.0F, 0.0F, 0.0F, 0.4F);
|
GL11.glColor4f(0.0F, 0.0F, 0.0F, 0.4F);
|
||||||
GL11.glLineWidth(2.0F);
|
GL11.glLineWidth(2.0F);
|
||||||
GL11.glDisable(GL11.GL_TEXTURE_2D);
|
GL11.glDisable(GL11.GL_TEXTURE_2D);
|
||||||
GL11.glDepthMask(false);
|
GL11.glDepthMask(false);
|
||||||
|
|
||||||
double exp = ((ICustomHighlight) block).getExpansion();
|
double exp = ((ICustomHighlight) block).getExpansion();
|
||||||
for (AxisAlignedBB aabb : aabbs) {
|
for (AxisAlignedBB aabb : aabbs) {
|
||||||
RenderGlobal.drawOutlinedBoundingBox(aabb.copy().expand(exp, exp, exp)
|
RenderGlobal.drawOutlinedBoundingBox(aabb.copy().expand(exp, exp, exp)
|
||||||
.offset(x, y, z)
|
.offset(x, y, z)
|
||||||
.offset(-pos.xCoord, -pos.yCoord, -pos.zCoord), -1);
|
.offset(-pos.xCoord, -pos.yCoord, -pos.zCoord), -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
GL11.glDepthMask(true);
|
GL11.glDepthMask(true);
|
||||||
GL11.glEnable(GL11.GL_TEXTURE_2D);
|
GL11.glEnable(GL11.GL_TEXTURE_2D);
|
||||||
GL11.glDisable(GL11.GL_BLEND);
|
GL11.glDisable(GL11.GL_BLEND);
|
||||||
|
|
|
@ -13,17 +13,22 @@ import java.util.List;
|
||||||
|
|
||||||
import io.netty.buffer.ByteBuf;
|
import io.netty.buffer.ByteBuf;
|
||||||
|
|
||||||
|
import net.minecraft.inventory.IInventory;
|
||||||
import net.minecraft.inventory.ISidedInventory;
|
import net.minecraft.inventory.ISidedInventory;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
import buildcraft.api.recipes.BuildcraftRecipeRegistry;
|
import buildcraft.api.recipes.BuildcraftRecipeRegistry;
|
||||||
import buildcraft.api.recipes.IIntegrationRecipe;
|
import buildcraft.api.recipes.IIntegrationRecipe;
|
||||||
|
import buildcraft.core.lib.inventory.SimpleInventory;
|
||||||
import buildcraft.core.lib.inventory.StackHelper;
|
import buildcraft.core.lib.inventory.StackHelper;
|
||||||
|
import buildcraft.core.lib.utils.NetworkUtils;
|
||||||
import buildcraft.core.lib.utils.StringUtils;
|
import buildcraft.core.lib.utils.StringUtils;
|
||||||
import buildcraft.core.lib.utils.Utils;
|
import buildcraft.core.lib.utils.Utils;
|
||||||
|
|
||||||
public class TileIntegrationTable extends TileLaserTableBase implements ISidedInventory {
|
public class TileIntegrationTable extends TileLaserTableBase implements ISidedInventory {
|
||||||
public static final int SLOT_OUTPUT = 9;
|
public static final int SLOT_OUTPUT = 9;
|
||||||
|
public final IInventory clientOutputInv = new SimpleInventory(1, "Preview", 64);
|
||||||
|
|
||||||
private static final int CYCLE_LENGTH = 16;
|
private static final int CYCLE_LENGTH = 16;
|
||||||
private static final int[] SLOTS = Utils.createSlotArray(0, 10);
|
private static final int[] SLOTS = Utils.createSlotArray(0, 10);
|
||||||
private int tick = 0;
|
private int tick = 0;
|
||||||
|
@ -58,7 +63,7 @@ public class TileIntegrationTable extends TileLaserTableBase implements ISidedIn
|
||||||
|
|
||||||
updateRecipeOutput();
|
updateRecipeOutput();
|
||||||
|
|
||||||
ItemStack output = getStackInSlot(10);
|
ItemStack output = clientOutputInv.getStackInSlot(0);
|
||||||
if (!isRoomForOutput(output)) {
|
if (!isRoomForOutput(output)) {
|
||||||
setEnergy(0);
|
setEnergy(0);
|
||||||
return;
|
return;
|
||||||
|
@ -100,22 +105,24 @@ public class TileIntegrationTable extends TileLaserTableBase implements ISidedIn
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateRecipeOutput() {
|
private void updateRecipeOutput() {
|
||||||
if (activeRecipe == null) {
|
ItemStack oldClientOutput = clientOutputInv.getStackInSlot(0);
|
||||||
inv.setInventorySlotContents(10, null);
|
|
||||||
return;
|
activeRecipeValid = false;
|
||||||
|
clientOutputInv.setInventorySlotContents(0, null);
|
||||||
|
|
||||||
|
if (activeRecipe != null) {
|
||||||
|
List<ItemStack> expansions = getExpansions();
|
||||||
|
|
||||||
|
if (expansions.size() > 0) {
|
||||||
|
clientOutputInv.setInventorySlotContents(0, activeRecipe.craft(getStackInSlot(0), expansions, true));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
List<ItemStack> expansions = getExpansions();
|
activeRecipeValid = clientOutputInv.getStackInSlot(0) != null;
|
||||||
|
|
||||||
if (expansions.size() == 0) {
|
if (!StackHelper.isEqualItem(clientOutputInv.getStackInSlot(0), oldClientOutput)) {
|
||||||
activeRecipeValid = false;
|
sendNetworkUpdate();
|
||||||
inv.setInventorySlotContents(10, null);
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ItemStack output = activeRecipe.craft(getStackInSlot(0), expansions, true);
|
|
||||||
activeRecipeValid = output != null;
|
|
||||||
inv.setInventorySlotContents(10, output);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setNewActiveRecipe() {
|
private void setNewActiveRecipe() {
|
||||||
|
@ -153,11 +160,13 @@ public class TileIntegrationTable extends TileLaserTableBase implements ISidedIn
|
||||||
@Override
|
@Override
|
||||||
public void writeData(ByteBuf buf) {
|
public void writeData(ByteBuf buf) {
|
||||||
buf.writeByte((byte) getMaxExpansionCount());
|
buf.writeByte((byte) getMaxExpansionCount());
|
||||||
|
NetworkUtils.writeStack(buf, clientOutputInv.getStackInSlot(0));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void readData(ByteBuf buf) {
|
public void readData(ByteBuf buf) {
|
||||||
maxExpCountClient = buf.readByte();
|
maxExpCountClient = buf.readByte();
|
||||||
|
clientOutputInv.setInventorySlotContents(0, NetworkUtils.readStack(buf));
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getMaxExpansionCount() {
|
public int getMaxExpansionCount() {
|
||||||
|
@ -193,7 +202,7 @@ public class TileIntegrationTable extends TileLaserTableBase implements ISidedIn
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getSizeInventory() {
|
public int getSizeInventory() {
|
||||||
return 11;
|
return 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -38,7 +38,7 @@ public class ContainerIntegrationTable extends BuildCraftContainer {
|
||||||
}
|
}
|
||||||
|
|
||||||
addSlot(new SlotOutput(table, 9, 138, 49));
|
addSlot(new SlotOutput(table, 9, 138, 49));
|
||||||
addSlot(new SlotUntouchable(table, 10, 101, 36));
|
addSlot(new SlotUntouchable(table.clientOutputInv, 0, 101, 36));
|
||||||
|
|
||||||
for (int y = 0; y < 3; y++) {
|
for (int y = 0; y < 3; y++) {
|
||||||
for (int x = 0; x < 9; x++) {
|
for (int x = 0; x < 9; x++) {
|
||||||
|
|
|
@ -673,13 +673,13 @@ public class PipeTransportFluids extends PipeTransport implements IFluidHandler,
|
||||||
fluidCapacities.put(PipeFluidsWood.class, 1 * BuildCraftTransport.pipeFluidsBaseFlowRate);
|
fluidCapacities.put(PipeFluidsWood.class, 1 * BuildCraftTransport.pipeFluidsBaseFlowRate);
|
||||||
fluidCapacities.put(PipeFluidsCobblestone.class, 1 * BuildCraftTransport.pipeFluidsBaseFlowRate);
|
fluidCapacities.put(PipeFluidsCobblestone.class, 1 * BuildCraftTransport.pipeFluidsBaseFlowRate);
|
||||||
|
|
||||||
|
fluidCapacities.put(PipeFluidsSandstone.class, 2 * BuildCraftTransport.pipeFluidsBaseFlowRate);
|
||||||
fluidCapacities.put(PipeFluidsStone.class, 2 * BuildCraftTransport.pipeFluidsBaseFlowRate);
|
fluidCapacities.put(PipeFluidsStone.class, 2 * BuildCraftTransport.pipeFluidsBaseFlowRate);
|
||||||
|
|
||||||
fluidCapacities.put(PipeFluidsClay.class, 4 * BuildCraftTransport.pipeFluidsBaseFlowRate);
|
fluidCapacities.put(PipeFluidsClay.class, 4 * BuildCraftTransport.pipeFluidsBaseFlowRate);
|
||||||
fluidCapacities.put(PipeFluidsEmerald.class, 4 * BuildCraftTransport.pipeFluidsBaseFlowRate);
|
fluidCapacities.put(PipeFluidsEmerald.class, 4 * BuildCraftTransport.pipeFluidsBaseFlowRate);
|
||||||
fluidCapacities.put(PipeFluidsIron.class, 4 * BuildCraftTransport.pipeFluidsBaseFlowRate);
|
fluidCapacities.put(PipeFluidsIron.class, 4 * BuildCraftTransport.pipeFluidsBaseFlowRate);
|
||||||
fluidCapacities.put(PipeFluidsQuartz.class, 4 * BuildCraftTransport.pipeFluidsBaseFlowRate);
|
fluidCapacities.put(PipeFluidsQuartz.class, 4 * BuildCraftTransport.pipeFluidsBaseFlowRate);
|
||||||
fluidCapacities.put(PipeFluidsSandstone.class, 4 * BuildCraftTransport.pipeFluidsBaseFlowRate);
|
|
||||||
|
|
||||||
fluidCapacities.put(PipeFluidsDiamond.class, 8 * BuildCraftTransport.pipeFluidsBaseFlowRate);
|
fluidCapacities.put(PipeFluidsDiamond.class, 8 * BuildCraftTransport.pipeFluidsBaseFlowRate);
|
||||||
fluidCapacities.put(PipeFluidsGold.class, 8 * BuildCraftTransport.pipeFluidsBaseFlowRate);
|
fluidCapacities.put(PipeFluidsGold.class, 8 * BuildCraftTransport.pipeFluidsBaseFlowRate);
|
||||||
|
|
|
@ -475,15 +475,15 @@ public class PipeTransportPower extends PipeTransport implements IDebuggable {
|
||||||
}
|
}
|
||||||
|
|
||||||
static {
|
static {
|
||||||
powerCapacities.put(PipePowerCobblestone.class, 80);
|
powerCapacities.put(PipePowerCobblestone.class, TransportConstants.PIPE_POWER_BASE_CAP);
|
||||||
powerCapacities.put(PipePowerStone.class, 160);
|
powerCapacities.put(PipePowerStone.class, 2 * TransportConstants.PIPE_POWER_BASE_CAP);
|
||||||
powerCapacities.put(PipePowerWood.class, 320);
|
powerCapacities.put(PipePowerWood.class, 4 * TransportConstants.PIPE_POWER_BASE_CAP);
|
||||||
powerCapacities.put(PipePowerSandstone.class, 320);
|
powerCapacities.put(PipePowerSandstone.class, 4 * TransportConstants.PIPE_POWER_BASE_CAP);
|
||||||
powerCapacities.put(PipePowerQuartz.class, 640);
|
powerCapacities.put(PipePowerQuartz.class, 8 * TransportConstants.PIPE_POWER_BASE_CAP);
|
||||||
powerCapacities.put(PipePowerIron.class, 1280);
|
powerCapacities.put(PipePowerIron.class, 16 * TransportConstants.PIPE_POWER_BASE_CAP);
|
||||||
powerCapacities.put(PipePowerGold.class, 2560);
|
powerCapacities.put(PipePowerGold.class, 32 * TransportConstants.PIPE_POWER_BASE_CAP);
|
||||||
powerCapacities.put(PipePowerEmerald.class, 2560);
|
powerCapacities.put(PipePowerEmerald.class, 32 * TransportConstants.PIPE_POWER_BASE_CAP);
|
||||||
powerCapacities.put(PipePowerDiamond.class, 10240);
|
powerCapacities.put(PipePowerDiamond.class, 128 * TransportConstants.PIPE_POWER_BASE_CAP);
|
||||||
|
|
||||||
powerResistances.put(PipePowerCobblestone.class, 0.05F);
|
powerResistances.put(PipePowerCobblestone.class, 0.05F);
|
||||||
powerResistances.put(PipePowerStone.class, 0.025F);
|
powerResistances.put(PipePowerStone.class, 0.025F);
|
||||||
|
|
|
@ -12,11 +12,19 @@ public final class TransportConstants {
|
||||||
|
|
||||||
public static final float FACADE_THICKNESS = 2F / 16F;
|
public static final float FACADE_THICKNESS = 2F / 16F;
|
||||||
|
|
||||||
|
/*
|
||||||
public static final float PIPE_MIN_SPEED = (1.0F / 80.0F);
|
public static final float PIPE_MIN_SPEED = (1.0F / 80.0F);
|
||||||
public static final float PIPE_MAX_SPEED = (1.0F / 7.0F);
|
public static final float PIPE_MAX_SPEED = (1.0F / 7.0F);
|
||||||
public static final float PIPE_SLOWDOWN_SPEED = 0.008F;
|
public static final float PIPE_SLOWDOWN_SPEED = 0.008F;
|
||||||
public static final float PIPE_DEFAULT_SPEED = (1.0F / 25.0F);
|
public static final float PIPE_DEFAULT_SPEED = (1.0F / 25.0F);
|
||||||
|
*/
|
||||||
|
|
||||||
|
public static final int PIPE_POWER_BASE_CAP = 80;
|
||||||
|
public static final float PIPE_SPEEDUP_MULTIPLIER = 4F;
|
||||||
|
public static final float PIPE_MIN_SPEED = 0.01F;
|
||||||
|
public static final float PIPE_MAX_SPEED = 0.15F;
|
||||||
|
public static final float PIPE_SLOWDOWN_SPEED = 0.01F;
|
||||||
|
public static final float PIPE_DEFAULT_SPEED = PIPE_MIN_SPEED;
|
||||||
/**
|
/**
|
||||||
* Deactivate constructor
|
* Deactivate constructor
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -44,6 +44,6 @@ public class PipeItemsGold extends Pipe<PipeTransportItems> {
|
||||||
public void eventHandler(PipeEventItem.AdjustSpeed event) {
|
public void eventHandler(PipeEventItem.AdjustSpeed event) {
|
||||||
event.handled = true;
|
event.handled = true;
|
||||||
TravelingItem item = event.item;
|
TravelingItem item = event.item;
|
||||||
item.setSpeed(MathUtils.clamp(item.getSpeed() * 4F, TransportConstants.PIPE_MIN_SPEED * 4F, TransportConstants.PIPE_MAX_SPEED));
|
item.setSpeed(MathUtils.clamp(item.getSpeed() * TransportConstants.PIPE_SPEEDUP_MULTIPLIER, TransportConstants.PIPE_MIN_SPEED * TransportConstants.PIPE_SPEEDUP_MULTIPLIER, TransportConstants.PIPE_MAX_SPEED));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue