BuildCraft 7.0.20

This commit is contained in:
asiekierka 2015-08-06 11:09:35 +02:00
parent 8a3e499507
commit dbf10a3cfc
10 changed files with 25 additions and 52 deletions

View file

@ -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.19"
version = "7.0.20"
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]

View file

@ -2,4 +2,5 @@ Bugs fixed:
* Creative Only blueprints partially working in Survival worlds (asie)
* Incorrect behaviour with Forestry/RailCraft engines (asie - workaround, actually bug on their side)
* Logistics Pipes VerifyError crash (asie)
* Overly dark water with non-sky lighting (asie)

View file

@ -1,3 +1,3 @@
1.6.4:BuildCraft:4.2.2
1.7.2:BuildCraft:6.0.16
1.7.10:BuildCraft:7.0.19
1.7.10:BuildCraft:7.0.20

View file

@ -40,4 +40,7 @@ public class TransportProxy {
public void obsidianPipePickup(World world, EntityItem item, TileEntity tile) {
}
public void clearDisplayList(int displayList) {
}
}

View file

@ -8,6 +8,7 @@
*/
package buildcraft.transport;
import net.minecraft.client.renderer.GLAllocation;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
@ -44,6 +45,11 @@ public class TransportProxyClient extends TransportProxy {
FMLClientHandler.instance().getClient().effectRenderer.addEffect(new TileEntityPickupFX(world, item, tile));
}
@Override
public void clearDisplayList(int displayList) {
GLAllocation.deleteDisplayLists(displayList);
}
@Override
public void registerRenderers() {
MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipeItemsWood, pipeItemRenderer);

View file

@ -99,7 +99,10 @@ public class TravelerSet extends ForwardingSet<TravelingItem> {
}
void removeScheduledItems() {
items.removeAll(toRemove);
for (TravelingItem i : toRemove) {
i.cleanup();
items.remove(i);
}
toRemove.clear();
}

View file

@ -13,7 +13,6 @@ import java.util.Map;
import com.google.common.collect.MapMaker;
import net.minecraft.client.renderer.GLAllocation;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
@ -309,11 +308,9 @@ public class TravelingItem {
return true;
}
@Override
public void finalize() {
// Nasty hack.
public void cleanup() {
if (hasDisplayList) {
GLAllocation.deleteDisplayLists(displayList);
TransportProxy.proxy.clearDisplayList(displayList);
hasDisplayList = false;
}
}

View file

@ -1,42 +1,16 @@
package buildcraft.transport.pipes;
import net.minecraft.item.Item;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraftforge.common.util.ForgeDirection;
import buildcraft.BuildCraftTransport;
import buildcraft.api.core.IIconProvider;
import buildcraft.core.lib.RFBattery;
import buildcraft.transport.PipeIconProvider;
public class PipePowerEmerald extends PipePowerWood {
public PipePowerEmerald(Item item) {
super(item);
standardIconIndex = PipeIconProvider.TYPE.PipePowerEmerald_Standard.ordinal();
solidIconIndex = PipeIconProvider.TYPE.PipeAllEmerald_Solid.ordinal();
battery = new RFBattery(2560 * 50, 2560 * 50, 0);
receiveLimit = 2560;
transport.initFromPipe(this.getClass());
}
@Override
@SideOnly(Side.CLIENT)
public IIconProvider getIconProvider() {
return BuildCraftTransport.instance.pipeIconProvider;
}
@Override
public int getIconIndex(ForgeDirection direction) {
if (direction != ForgeDirection.UNKNOWN && powerSources[direction.ordinal()]) {
return solidIconIndex;
} else {
return standardIconIndex;
}
}
}

View file

@ -39,17 +39,15 @@ public class PipePowerWood extends Pipe<PipeTransportPower> implements IPipeTran
protected int standardIconIndex = PipeIconProvider.TYPE.PipePowerWood_Standard.ordinal();
protected int solidIconIndex = PipeIconProvider.TYPE.PipeAllWood_Solid.ordinal();
protected RFBattery battery;
protected int receiveLimit;
private int requestedEnergy, sources, lastRequestedEnergy;
private int requestedEnergy, lastRequestedEnergy, sources;
private boolean allowExtraction = false;
public PipePowerWood(Item item) {
super(new PipeTransportPower(), item);
battery = new RFBattery(320 * 50, 320 * 50, 0);
battery = new RFBattery(40960, 40960, 0);
transport.initFromPipe(getClass());
receiveLimit = 320;
}
@Override
@ -106,7 +104,7 @@ public class PipePowerWood extends Pipe<PipeTransportPower> implements IPipeTran
if (allowExtraction) {
allowExtraction = false;
int energyMaxExtract = Math.min(receiveLimit, battery.getMaxEnergyStored() - battery.getEnergyStored());
int energyMaxExtract = Math.min(transport.maxPower, battery.getMaxEnergyStored() - battery.getEnergyStored());
energyMaxExtract /= sources;
for (ForgeDirection o : ForgeDirection.VALID_DIRECTIONS) {
@ -199,13 +197,7 @@ public class PipePowerWood extends Pipe<PipeTransportPower> implements IPipeTran
return maxReceive;
}
if (from.ordinal() < 6 && powerSources[from.ordinal()]) {
/* Non-simulate is technically supposed to cap to maxReceive, but Forestry and RailCraft have a bug which causes
them to push energy and void it. Therefore, if a non-RF-compliant mod requests energy WITHOUT simulation, we just
accept everything verbatim.
This should be removed but probably won't. */
int maxEnergyReceive = simulate ? Math.min(receiveLimit, lastRequestedEnergy) : battery.getMaxEnergyStored();
return battery.receiveEnergy(maxEnergyReceive, simulate);
return battery.receiveEnergy(simulate ? Math.min(maxReceive, lastRequestedEnergy) : Math.min(maxReceive, battery.getMaxEnergyStored() - battery.getEnergyStored()), simulate);
} else {
return 0;
}

View file

@ -840,9 +840,6 @@ public class PipeRendererTESR extends TileEntitySpecialRenderer {
private void renderSolids(Pipe<PipeTransportItems> pipe, double x, double y, double z, float f) {
GL11.glPushMatrix();
int skylight = pipe.container.getWorld().getSkyBlockTypeBrightness(EnumSkyBlock.Sky, pipe.container.x(), pipe.container.y(), pipe.container.z());
int blocklight = pipe.container.getWorld().getSkyBlockTypeBrightness(EnumSkyBlock.Block, pipe.container.x(), pipe.container.y(), pipe.container.z());
int count = 0;
for (TravelingItem item : pipe.transport.items) {
if (count >= MAX_ITEMS_TO_RENDER) {
@ -852,7 +849,7 @@ public class PipeRendererTESR extends TileEntitySpecialRenderer {
Position motion = new Position(0, 0, 0, item.toCenter ? item.input : item.output);
motion.moveForwards(item.getSpeed() * f);
doRenderItem(item, x + item.xCoord - pipe.container.xCoord + motion.x, y + item.yCoord - pipe.container.yCoord + motion.y, z + item.zCoord - pipe.container.zCoord + motion.z, skylight, blocklight, item.color);
doRenderItem(item, x + item.xCoord - pipe.container.xCoord + motion.x, y + item.yCoord - pipe.container.yCoord + motion.y, z + item.zCoord - pipe.container.zCoord + motion.z, 0.0F, item.color);
count++;
}
@ -867,7 +864,7 @@ public class PipeRendererTESR extends TileEntitySpecialRenderer {
return 0;
}
public void doRenderItem(TravelingItem travellingItem, double x, double y, double z, int skylight, int blocklight, EnumColor color) {
public void doRenderItem(TravelingItem travellingItem, double x, double y, double z, float light, EnumColor color) {
if (travellingItem == null || travellingItem.getItemStack() == null) {
return;
}