Merge branch '6.5.x' of github.com:BuildCraft/BuildCraft
This commit is contained in:
commit
00f04022b5
|
@ -163,7 +163,7 @@ public abstract class DockingStation {
|
|||
}
|
||||
|
||||
public boolean linkIsDocked() {
|
||||
if (isTaken()) {
|
||||
if (robotTaking() != null) {
|
||||
return robotTaking().getDockingStation() == this;
|
||||
} else {
|
||||
return false;
|
||||
|
|
|
@ -22,7 +22,7 @@ apply plugin: 'forge' // adds the forge dependency
|
|||
apply plugin: 'maven' // for uploading to a maven repo
|
||||
apply plugin: 'checkstyle'
|
||||
|
||||
version = "7.0.17"
|
||||
version = "7.0.18"
|
||||
group= "com.mod-buildcraft"
|
||||
archivesBaseName = "buildcraft" // the name that all artifacts will use as a base. artifacts names follow this pattern: [baseName]-[appendix]-[version]-[classifier].[extension]
|
||||
|
||||
|
|
18
buildcraft_resources/changelog/7.0.18
Normal file
18
buildcraft_resources/changelog/7.0.18
Normal file
|
@ -0,0 +1,18 @@
|
|||
Improvements:
|
||||
|
||||
* [#2941] Knights and Butchers now respect all your fancy sword enchantments, knockbacks and damage modifiers. Woo! (asie)
|
||||
* [#2926] Fluid pipes are now extra glowy (asie)
|
||||
|
||||
Bugs fixed:
|
||||
|
||||
* [#2942] Autarchic Gates not reacting to short pulses on Single Energy Pulse mode (asie)
|
||||
* [#2935, attempted] Programming Table robot board mixups (asie)
|
||||
* [#2929] Builders unable to place liquid in survival mode (asie)
|
||||
* [#2921] Architect Table's defined area box not visible >64 blocks (ganymedes01)
|
||||
* [#2914] Advanced Crafting Table excess tick times in certain circumstances (asie)
|
||||
* [#2898] Robot crash on chunk unload/reload (hea3ven)
|
||||
* [#2862] Pipe name not displaying in WAILA (asie)
|
||||
* Fluid tanks rendering incorrectly in Builder (asie)
|
||||
* Knight/Butcher not emitting Forge attack events (asie)
|
||||
* Restoring robot block breaking state could fail (hea3ven)
|
||||
* Stripes pipes placing extra blocks, and the behaviour of the stripes robot placing blocks (hea3ven)
|
|
@ -1,3 +1,3 @@
|
|||
1.6.4:BuildCraft:4.2.2
|
||||
1.7.2:BuildCraft:6.0.16
|
||||
1.7.10:BuildCraft:7.0.17
|
||||
1.7.10:BuildCraft:7.0.18
|
||||
|
|
|
@ -12,7 +12,6 @@ import net.minecraft.block.material.Material;
|
|||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
@ -22,7 +21,6 @@ import buildcraft.core.GuiIds;
|
|||
import buildcraft.core.lib.block.BlockBuildCraft;
|
||||
|
||||
public class BlockArchitect extends BlockBuildCraft {
|
||||
private IIcon[] led;
|
||||
|
||||
public BlockArchitect() {
|
||||
super(Material.iron);
|
||||
|
|
|
@ -21,6 +21,7 @@ import net.minecraft.nbt.NBTTagList;
|
|||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraftforge.common.util.Constants;
|
||||
|
||||
import buildcraft.BuildCraftCore;
|
||||
|
@ -350,4 +351,10 @@ public class TileArchitect extends TileBuildCraft implements IInventory, IBoxPro
|
|||
public int getLEDLevel(int led) {
|
||||
return (led == 0 ? isProcessing : box != null && box.isInitialized()) ? 15 : 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public double getMaxRenderDistanceSquared() {
|
||||
return Double.MAX_VALUE;
|
||||
}
|
||||
}
|
|
@ -967,4 +967,8 @@ public class TileBuilder extends TileAbstractBuilder implements IHasWork, IFluid
|
|||
box.readData(stream);
|
||||
fluidTank.readData(stream);
|
||||
}
|
||||
|
||||
public Tank[] getFluidTanks() {
|
||||
return fluidTanks;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,6 +26,7 @@ import buildcraft.core.lib.gui.AdvancedSlot;
|
|||
import buildcraft.core.lib.gui.GuiAdvancedInterface;
|
||||
import buildcraft.core.lib.network.command.CommandWriter;
|
||||
import buildcraft.core.lib.network.command.PacketCommand;
|
||||
import buildcraft.core.lib.render.FluidRenderer;
|
||||
import buildcraft.core.lib.utils.StringUtils;
|
||||
|
||||
public class GuiBuilder extends GuiAdvancedInterface {
|
||||
|
@ -128,6 +129,7 @@ public class GuiBuilder extends GuiAdvancedInterface {
|
|||
for (int i = 0; i < builder.fluidTanks.length; i++) {
|
||||
Tank tank = builder.fluidTanks[i];
|
||||
if (tank.getFluid() != null && tank.getFluid().amount > 0) {
|
||||
mc.renderEngine.bindTexture(FluidRenderer.getFluidSheet(tank.getFluid()));
|
||||
drawFluid(tank.getFluid(), guiLeft + 179 + 18 * i, guiTop + 145, 16, 47, tank.getCapacity());
|
||||
drawTexturedModalRect(guiLeft + 179 + 18 * i, guiTop + 145, 0, 54, 16, 47);
|
||||
}
|
||||
|
|
|
@ -14,7 +14,9 @@ import java.util.List;
|
|||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.WorldSettings;
|
||||
import buildcraft.core.lib.fluids.Tank;
|
||||
|
||||
public class BuildingSlotMapIterator {
|
||||
private static final int MAX_PER_ITEM = 80;
|
||||
|
@ -39,7 +41,15 @@ public class BuildingSlotMapIterator {
|
|||
if (builder != null) {
|
||||
availablePairs.add(new BuilderItemMetaPair(null));
|
||||
for (int i = 0; i < builder.getSizeInventory(); i++) {
|
||||
availablePairs.add(new BuilderItemMetaPair(builder.getStackInSlot(i)));
|
||||
ItemStack stack = builder.getStackInSlot(i);
|
||||
if (stack != null) {
|
||||
availablePairs.add(new BuilderItemMetaPair(stack));
|
||||
}
|
||||
}
|
||||
for (Tank t : builder.getFluidTanks()) {
|
||||
if (t.getFluid() != null && t.getFluid().getFluid().getBlock() != null) {
|
||||
availablePairs.add(new BuilderItemMetaPair(new ItemStack(t.getFluid().getFluid().getBlock())));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -28,6 +28,7 @@ import buildcraft.core.LaserData;
|
|||
import buildcraft.core.internal.IBoxProvider;
|
||||
import buildcraft.core.lib.RFBattery;
|
||||
import buildcraft.core.lib.block.TileBuildCraft;
|
||||
import buildcraft.core.lib.fluids.Tank;
|
||||
import buildcraft.core.lib.network.Packet;
|
||||
import buildcraft.core.lib.network.command.CommandWriter;
|
||||
import buildcraft.core.lib.network.command.ICommandReceiver;
|
||||
|
@ -189,4 +190,8 @@ public abstract class TileAbstractBuilder extends TileBuildCraft implements ITil
|
|||
public boolean drainBuild(FluidStack fluidStack, boolean realDrain) {
|
||||
return false;
|
||||
}
|
||||
|
||||
public Tank[] getFluidTanks() {
|
||||
return new Tank[0];
|
||||
}
|
||||
}
|
||||
|
|
|
@ -21,7 +21,9 @@ import net.minecraft.entity.Entity;
|
|||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.world.EnumSkyBlock;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import buildcraft.core.lib.EntityBlock;
|
||||
|
||||
|
@ -69,6 +71,10 @@ public final class RenderEntityBlock extends Render {
|
|||
setBounds(minX, minY, minZ, maxX, maxY, maxZ);
|
||||
}
|
||||
|
||||
public void setSkyBlockLight(World world, int x, int y, int z, int light) {
|
||||
this.brightness = world.getSkyBlockTypeBrightness(EnumSkyBlock.Sky, x, y, z) << 16 | light;
|
||||
}
|
||||
|
||||
public float getBlockBrightness(IBlockAccess iblockaccess, int i, int j, int k) {
|
||||
return baseBlock.getMixedBrightnessForBlock(iblockaccess, i, j, k);
|
||||
}
|
||||
|
|
|
@ -71,7 +71,7 @@ public final class CraftingUtils {
|
|||
ingredients.add(item2);
|
||||
|
||||
return new ShapelessRecipes(new ItemStack(item1.getItem(), 1, newDamage), ingredients);
|
||||
} else {
|
||||
} else if (itemNum > 0) {
|
||||
// End repair recipe handler
|
||||
|
||||
List recipes = CraftingManager.getInstance().getRecipeList();
|
||||
|
@ -83,6 +83,10 @@ public final class CraftingUtils {
|
|||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
} else {
|
||||
// No items - no recipe!
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,10 +1,12 @@
|
|||
package buildcraft.core.lib.utils;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidContainerRegistry;
|
||||
import net.minecraftforge.fluids.FluidRegistry;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.IFluidBlock;
|
||||
import net.minecraftforge.fluids.IFluidContainerItem;
|
||||
|
@ -23,8 +25,14 @@ public final class FluidUtils {
|
|||
return FluidContainerRegistry.getFluidForFilledItem(stack);
|
||||
} else if (stack.getItem() instanceof ItemBlock) {
|
||||
Block b = Block.getBlockFromItem(stack.getItem());
|
||||
if (b != null && b instanceof IFluidBlock && ((IFluidBlock) b).getFluid() != null) {
|
||||
return new FluidStack(((IFluidBlock) b).getFluid(), 1000);
|
||||
if (b != null) {
|
||||
if (b instanceof IFluidBlock && ((IFluidBlock) b).getFluid() != null) {
|
||||
return new FluidStack(((IFluidBlock) b).getFluid(), 1000);
|
||||
} else if (b == Blocks.lava) {
|
||||
return new FluidStack(FluidRegistry.getFluid("lava"), 1000);
|
||||
} else if (b == Blocks.water) {
|
||||
return new FluidStack(FluidRegistry.getFluid("water"), 1000);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -167,4 +167,8 @@ public class CoreProxy implements ICoreProxy {
|
|||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public EntityPlayer getClientPlayer() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -139,4 +139,9 @@ public class CoreProxyClient extends CoreProxy {
|
|||
return Minecraft.getMinecraft().thePlayer;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public EntityPlayer getClientPlayer() {
|
||||
return Minecraft.getMinecraft().thePlayer;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -23,7 +23,8 @@ public class BoardProgrammingRecipe implements IProgrammingRecipe {
|
|||
|
||||
@Override
|
||||
public int compare(ItemStack o1, ItemStack o2) {
|
||||
return recipe.getEnergyCost(o1) - recipe.getEnergyCost(o2);
|
||||
int i = (recipe.getEnergyCost(o1) - recipe.getEnergyCost(o2)) * 200;
|
||||
return i != 0 ? i : ItemRedstoneBoard.getBoardNBT(o1).getID().compareTo(ItemRedstoneBoard.getBoardNBT(o2).getID());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -43,14 +43,17 @@ import net.minecraft.util.StatCollector;
|
|||
import net.minecraft.util.StringUtils;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.WorldServer;
|
||||
|
||||
import cpw.mods.fml.common.registry.IEntityAdditionalSpawnData;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.common.util.Constants;
|
||||
import net.minecraftforge.common.util.Constants.NBT;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.event.entity.player.AttackEntityEvent;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidContainerRegistry;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
@ -80,6 +83,7 @@ import buildcraft.core.lib.network.command.CommandWriter;
|
|||
import buildcraft.core.lib.network.command.ICommandReceiver;
|
||||
import buildcraft.core.lib.network.command.PacketCommand;
|
||||
import buildcraft.core.lib.utils.NetworkUtils;
|
||||
import buildcraft.core.proxy.CoreProxy;
|
||||
import buildcraft.robotics.ai.AIRobotMain;
|
||||
import buildcraft.robotics.ai.AIRobotShutdown;
|
||||
import buildcraft.robotics.ai.AIRobotSleep;
|
||||
|
@ -989,17 +993,50 @@ public class EntityRobot extends EntityRobotBase implements
|
|||
}
|
||||
|
||||
public void attackTargetEntityWithCurrentItem(Entity par1Entity) {
|
||||
if (MinecraftForge.EVENT_BUS.post(new AttackEntityEvent(
|
||||
CoreProxy.proxy.getBuildCraftPlayer((WorldServer) worldObj, (int) posX, (int) posY, (int) posZ).get(),
|
||||
par1Entity))) {
|
||||
return;
|
||||
}
|
||||
if (par1Entity.canAttackWithItem()) {
|
||||
if (!par1Entity.hitByEntity(this)) {
|
||||
this.setLastAttacker(par1Entity);
|
||||
boolean flag2 = par1Entity.attackEntityFrom(new EntityDamageSource("robot", this), 2.0F);
|
||||
float attackDamage = 2.0F;
|
||||
int knockback = 0;
|
||||
|
||||
EnchantmentHelper.func_151385_b(this, par1Entity);
|
||||
ItemStack itemstack = itemInUse;
|
||||
Object object = par1Entity;
|
||||
if (par1Entity instanceof EntityLivingBase) {
|
||||
attackDamage += EnchantmentHelper.getEnchantmentModifierLiving(this, (EntityLivingBase) par1Entity);
|
||||
knockback += EnchantmentHelper.getKnockbackModifier(this, (EntityLivingBase) par1Entity);
|
||||
}
|
||||
|
||||
if (itemstack != null && object instanceof EntityLivingBase) {
|
||||
itemstack.getItem().hitEntity(itemstack, (EntityLivingBase) object, this);
|
||||
if (attackDamage > 0.0F) {
|
||||
int fireAspect = EnchantmentHelper.getFireAspectModifier(this);
|
||||
|
||||
if (par1Entity instanceof EntityLivingBase && fireAspect > 0 && !par1Entity.isBurning()) {
|
||||
par1Entity.setFire(fireAspect * 4);
|
||||
}
|
||||
|
||||
if (par1Entity.attackEntityFrom(new EntityDamageSource("robot", this), attackDamage)) {
|
||||
this.setLastAttacker(par1Entity);
|
||||
|
||||
if (knockback > 0) {
|
||||
par1Entity.addVelocity((double) (-MathHelper.sin(this.rotationYaw * (float) Math.PI / 180.0F) * (float) knockback * 0.5F), 0.1D, (double) (MathHelper.cos(this.rotationYaw * (float) Math.PI / 180.0F) * (float) knockback * 0.5F));
|
||||
this.motionX *= 0.6D;
|
||||
this.motionZ *= 0.6D;
|
||||
this.setSprinting(false);
|
||||
}
|
||||
|
||||
if (par1Entity instanceof EntityLivingBase) {
|
||||
EnchantmentHelper.func_151384_a((EntityLivingBase) par1Entity, this);
|
||||
}
|
||||
|
||||
EnchantmentHelper.func_151385_b(this, par1Entity);
|
||||
|
||||
ItemStack itemstack = itemInUse;
|
||||
|
||||
if (itemstack != null && par1Entity instanceof EntityLivingBase) {
|
||||
itemstack.getItem().hitEntity(itemstack, (EntityLivingBase) par1Entity, this);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -55,8 +55,21 @@ public class AIRobotBreak extends AIRobot {
|
|||
|
||||
@Override
|
||||
public void update() {
|
||||
if (block == null || block.isAir(robot.worldObj, blockToBreak.x, blockToBreak.y, blockToBreak.z)) {
|
||||
if (block == null) {
|
||||
block = robot.worldObj.getBlock(blockToBreak.x, blockToBreak.y, blockToBreak.z);
|
||||
if (block == null) {
|
||||
setSuccess(false);
|
||||
terminate();
|
||||
return;
|
||||
}
|
||||
meta = robot.worldObj.getBlockMetadata(blockToBreak.x, blockToBreak.y, blockToBreak.z);
|
||||
hardness = block.getBlockHardness(robot.worldObj, blockToBreak.x, blockToBreak.y, blockToBreak.z);
|
||||
speed = getBreakSpeed(robot, robot.getHeldItem(), block, meta);
|
||||
}
|
||||
if (block.isAir(robot.worldObj, blockToBreak.x, blockToBreak.y, blockToBreak.z)) {
|
||||
setSuccess(false);
|
||||
terminate();
|
||||
return;
|
||||
}
|
||||
|
||||
if (hardness != 0) {
|
||||
|
|
|
@ -158,7 +158,9 @@ public class TileProgrammingTable extends TileLaserTableBase implements IInvento
|
|||
}
|
||||
}
|
||||
|
||||
if ((oldId != null && !oldId.equals(currentRecipeId)) || (oldId == null && currentRecipeId != null)) {
|
||||
if ((oldId != null && currentRecipeId != null && !oldId.equals(currentRecipeId))
|
||||
|| (oldId == null && currentRecipeId != null)
|
||||
|| (oldId != null && currentRecipeId == null)) {
|
||||
optionId = -1;
|
||||
updateRecipe();
|
||||
queueNetworkUpdate();
|
||||
|
|
|
@ -62,6 +62,7 @@ import buildcraft.core.lib.TileBuffer;
|
|||
import buildcraft.core.lib.block.BlockBuildCraft;
|
||||
import buildcraft.core.lib.utils.MatrixTranformations;
|
||||
import buildcraft.core.lib.utils.Utils;
|
||||
import buildcraft.core.proxy.CoreProxy;
|
||||
import buildcraft.transport.gates.GatePluggable;
|
||||
import buildcraft.transport.render.PipeRendererWorld;
|
||||
|
||||
|
@ -485,6 +486,17 @@ public class BlockGenericPipe extends BlockBuildCraft implements IColorRemovable
|
|||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z) {
|
||||
// HACK: WAILA compatibility
|
||||
EntityPlayer clientPlayer = CoreProxy.proxy.getClientPlayer();
|
||||
if (clientPlayer != null) {
|
||||
return getPickBlock(target, world, x, y, z, clientPlayer);
|
||||
} else {
|
||||
return new ItemStack(getPipe(world, x, y, z).item, 1, getPipe(world, x, y, z).container.getItemMetadata());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z, EntityPlayer player) {
|
||||
RaytraceResult rayTraceResult = doRayTrace(world, x, y, z, player);
|
||||
|
|
|
@ -436,6 +436,7 @@ public class PipeTransportFluids extends PipeTransport implements IFluidHandler
|
|||
changed = true;
|
||||
renderCache.fluidID = fluidType != null ? fluidType.getFluid().getID() : 0;
|
||||
renderCache.color = fluidType != null ? fluidType.getFluid().getColor(fluidType) : 0;
|
||||
renderCache.flags = FluidRenderData.getFlags(fluidType);
|
||||
delta.set(0);
|
||||
}
|
||||
|
||||
|
|
|
@ -21,6 +21,7 @@ import buildcraft.api.gates.IGate;
|
|||
import buildcraft.api.gates.IGateExpansion;
|
||||
import buildcraft.api.statements.IActionInternal;
|
||||
import buildcraft.api.statements.IStatement;
|
||||
import buildcraft.core.lib.utils.MathUtils;
|
||||
import buildcraft.transport.statements.ActionEnergyPulsar;
|
||||
import buildcraft.transport.statements.ActionSingleEnergyPulse;
|
||||
|
||||
|
@ -38,7 +39,6 @@ public final class GateExpansionPulsar extends GateExpansionBuildcraft implement
|
|||
}
|
||||
|
||||
private class GateExpansionControllerPulsar extends GateExpansionController {
|
||||
|
||||
private static final int PULSE_PERIOD = 10;
|
||||
private boolean isActive;
|
||||
private boolean singlePulse;
|
||||
|
@ -58,7 +58,7 @@ public final class GateExpansionPulsar extends GateExpansionBuildcraft implement
|
|||
|
||||
@Override
|
||||
public void startResolution() {
|
||||
if (isActive()) {
|
||||
if (isActive) {
|
||||
disablePulse();
|
||||
}
|
||||
}
|
||||
|
@ -84,46 +84,35 @@ public final class GateExpansionPulsar extends GateExpansionBuildcraft implement
|
|||
|
||||
@Override
|
||||
public void tick(IGate gate) {
|
||||
if (!isActive && hasPulsed) {
|
||||
hasPulsed = false;
|
||||
}
|
||||
|
||||
if (tick++ % PULSE_PERIOD != 0) {
|
||||
// only do the treatement once every period
|
||||
return;
|
||||
}
|
||||
|
||||
if (!isActive) {
|
||||
gate.setPulsing(false);
|
||||
return;
|
||||
}
|
||||
gate.setPulsing(isActive);
|
||||
|
||||
if (pipeTile instanceof IEnergyHandler && (!singlePulse || !hasPulsed)) {
|
||||
gate.setPulsing(true);
|
||||
((IEnergyHandler) pipeTile).receiveEnergy(ForgeDirection.UNKNOWN, Math.min(1 << (count - 1), 64) * 10,
|
||||
if (pipeTile instanceof IEnergyHandler && ((singlePulse && !hasPulsed) || (!singlePulse && isActive))) {
|
||||
((IEnergyHandler) pipeTile).receiveEnergy(ForgeDirection.UNKNOWN, MathUtils.clamp(1 << (count - 1), 1, 64) * 10,
|
||||
false);
|
||||
hasPulsed = true;
|
||||
} else {
|
||||
gate.setPulsing(true);
|
||||
}
|
||||
}
|
||||
|
||||
private void enableSinglePulse(int count) {
|
||||
singlePulse = true;
|
||||
isActive = true;
|
||||
singlePulse = true;
|
||||
hasPulsed = false;
|
||||
this.count = count;
|
||||
}
|
||||
|
||||
private void enablePulse(int count) {
|
||||
isActive = true;
|
||||
hasPulsed = false;
|
||||
singlePulse = false;
|
||||
this.count = count;
|
||||
}
|
||||
|
||||
private void disablePulse() {
|
||||
if (!isActive) {
|
||||
hasPulsed = false;
|
||||
}
|
||||
isActive = false;
|
||||
this.count = 0;
|
||||
}
|
||||
|
|
|
@ -80,6 +80,7 @@ public class PacketFluidUpdate extends PacketCoordinates {
|
|||
if (delta.get(0)) {
|
||||
renderCache.fluidID = data.readShort();
|
||||
renderCache.color = renderCache.fluidID != 0 ? data.readInt() : 0xFFFFFF;
|
||||
renderCache.flags = renderCache.fluidID != 0 ? data.readUnsignedByte() : 0;
|
||||
}
|
||||
|
||||
for (ForgeDirection dir : ForgeDirection.values()) {
|
||||
|
@ -101,6 +102,7 @@ public class PacketFluidUpdate extends PacketCoordinates {
|
|||
data.writeShort(renderCache.fluidID);
|
||||
if (renderCache.fluidID != 0) {
|
||||
data.writeInt(renderCache.color);
|
||||
data.writeByte(renderCache.flags);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -40,9 +40,7 @@ public class PipePowerWood extends Pipe<PipeTransportPower> implements IPipeTran
|
|||
protected int solidIconIndex = PipeIconProvider.TYPE.PipeAllWood_Solid.ordinal();
|
||||
protected RFBattery battery;
|
||||
|
||||
private boolean full;
|
||||
private int requestedEnergy, sources, lastRequestedEnergy;
|
||||
|
||||
private boolean allowExtraction = false;
|
||||
|
||||
public PipePowerWood(Item item) {
|
||||
|
|
|
@ -24,6 +24,7 @@ import net.minecraft.item.ItemStack;
|
|||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.IntHashMap;
|
||||
import net.minecraft.world.EnumSkyBlock;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
|
@ -110,9 +111,11 @@ public class PipeRendererTESR extends TileEntitySpecialRenderer {
|
|||
initialized = false;
|
||||
}
|
||||
|
||||
private DisplayFluidList getDisplayFluidLists(int liquidId, World world) {
|
||||
if (displayFluidLists.containsItem(liquidId)) {
|
||||
return (DisplayFluidList) displayFluidLists.lookup(liquidId);
|
||||
private DisplayFluidList getDisplayFluidLists(int liquidId, int skylight, int flags, World world) {
|
||||
int listId = (liquidId & 0x3FFFF) << 13 | flags << 5 | (skylight & 31);
|
||||
|
||||
if (displayFluidLists.containsItem(listId)) {
|
||||
return (DisplayFluidList) displayFluidLists.lookup(listId);
|
||||
}
|
||||
|
||||
Fluid fluid = FluidRegistry.getFluid(liquidId);
|
||||
|
@ -122,7 +125,7 @@ public class PipeRendererTESR extends TileEntitySpecialRenderer {
|
|||
}
|
||||
|
||||
DisplayFluidList d = new DisplayFluidList();
|
||||
displayFluidLists.addKey(liquidId, d);
|
||||
displayFluidLists.addKey(listId, d);
|
||||
|
||||
RenderInfo block = new RenderInfo();
|
||||
|
||||
|
@ -133,6 +136,7 @@ public class PipeRendererTESR extends TileEntitySpecialRenderer {
|
|||
}
|
||||
|
||||
block.texture = fluid.getStillIcon();
|
||||
block.brightness = skylight << 16 | flags & 31;
|
||||
|
||||
float size = CoreConstants.PIPE_MAX_POS - CoreConstants.PIPE_MIN_POS;
|
||||
|
||||
|
@ -744,7 +748,7 @@ public class PipeRendererTESR extends TileEntitySpecialRenderer {
|
|||
|
||||
GL11.glTranslatef((float) x, (float) y, (float) z);
|
||||
|
||||
// sides
|
||||
int skylight = pipe.container.getWorld().getSkyBlockTypeBrightness(EnumSkyBlock.Sky, pipe.container.x(), pipe.container.y(), pipe.container.z());
|
||||
|
||||
boolean sides = false, above = false;
|
||||
|
||||
|
@ -761,7 +765,8 @@ public class PipeRendererTESR extends TileEntitySpecialRenderer {
|
|||
continue;
|
||||
}
|
||||
|
||||
DisplayFluidList d = getDisplayFluidLists(fluidRenderData.fluidID, pipe.container.getWorldObj());
|
||||
DisplayFluidList d = getDisplayFluidLists(fluidRenderData.fluidID, skylight,
|
||||
fluidRenderData.flags, pipe.container.getWorldObj());
|
||||
|
||||
if (d == null) {
|
||||
continue;
|
||||
|
@ -804,7 +809,8 @@ public class PipeRendererTESR extends TileEntitySpecialRenderer {
|
|||
FluidRenderData fluidRenderData = trans.renderCache;
|
||||
|
||||
if (fluidRenderData.amount[6] > 0) {
|
||||
DisplayFluidList d = getDisplayFluidLists(fluidRenderData.fluidID, pipe.container.getWorldObj());
|
||||
DisplayFluidList d = getDisplayFluidLists(fluidRenderData.fluidID, skylight,
|
||||
fluidRenderData.flags, pipe.container.getWorldObj());
|
||||
|
||||
if (d != null) {
|
||||
int stage = (int) ((float) fluidRenderData.amount[6] / (float) (trans.getCapacity()) * (LIQUID_STAGES - 1));
|
||||
|
|
|
@ -14,7 +14,6 @@ import net.minecraft.item.ItemStack;
|
|||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import buildcraft.api.core.Position;
|
||||
import buildcraft.api.transport.IStripesActivator;
|
||||
import buildcraft.api.transport.IStripesHandler;
|
||||
|
||||
|
@ -34,19 +33,16 @@ public class StripesHandlerPlaceBlock implements IStripesHandler {
|
|||
public boolean handle(World world, int x, int y, int z,
|
||||
ForgeDirection direction, ItemStack stack, EntityPlayer player,
|
||||
IStripesActivator activator) {
|
||||
if (!world.isAirBlock(x, y, z) && stack.tryPlaceItemIntoWorld(player, world, x, y, z, 1, 0.0f, 0.0f, 0.0f)) {
|
||||
return true;
|
||||
} else if (world.isAirBlock(x, y, z)) {
|
||||
Position src = new Position(x, y, z);
|
||||
src.orientation = direction;
|
||||
src.moveBackwards(1.0D);
|
||||
if (stack.tryPlaceItemIntoWorld(player, world, (int) src.x, (int) src.y, (int) src.z, direction.ordinal(), 0.0f, 0.0f, 0.0f)) {
|
||||
if (stack.stackSize > 0) {
|
||||
activator.sendItem(stack, direction.getOpposite());
|
||||
}
|
||||
|
||||
return true;
|
||||
if (!world.isAirBlock(x, y, z)) {
|
||||
return false;
|
||||
}
|
||||
if (stack.tryPlaceItemIntoWorld(player, world, x, y, z, direction.ordinal(), 0.0f,
|
||||
0.0f, 0.0f)) {
|
||||
if (stack.stackSize > 0) {
|
||||
activator.sendItem(stack, direction.getOpposite());
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -1,14 +1,24 @@
|
|||
package buildcraft.transport.utils;
|
||||
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
public class FluidRenderData {
|
||||
public int fluidID, color;
|
||||
public int fluidID, color, flags;
|
||||
public int[] amount = new int[7];
|
||||
|
||||
public FluidRenderData duplicate() {
|
||||
FluidRenderData n = new FluidRenderData();
|
||||
n.fluidID = fluidID;
|
||||
n.color = color;
|
||||
n.flags = flags;
|
||||
System.arraycopy(this.amount, 0, n.amount, 0, 7);
|
||||
return n;
|
||||
}
|
||||
|
||||
public static int getFlags(FluidStack s) {
|
||||
if (s == null) {
|
||||
return 0;
|
||||
}
|
||||
return s.getFluid().getLuminosity(s);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue