fix a fair amount of bugs
This commit is contained in:
parent
927b0f099d
commit
5ce9ab97f2
11 changed files with 103 additions and 57 deletions
|
@ -1,14 +1,17 @@
|
|||
Additions:
|
||||
|
||||
* "/buildcraft op" and "/buildcraft deop", used to op/deop the BuildCraft "fake player" (asie)
|
||||
|
||||
Improvements:
|
||||
|
||||
* New quarry frame model! (asie)
|
||||
* "/buildcraft op" and "/buildcraft deop" commands, letting you easily op/deop the BuildCraft "fake player" (asie)
|
||||
* New Quarry frame model (asie)
|
||||
* Quarry now rebuilds its own frame if it is removed (asie)
|
||||
|
||||
Bugs fixed:
|
||||
|
||||
* [#3033] Emerald Transport Pipes only changing setting after closing GUI (asie)
|
||||
* [#2998] Quarries not respecting a certain form of player-specific protection (asie)
|
||||
* Biome config crashing instead of finding a new ID on setting ID past 256 (asie)
|
||||
* Crash in TileAssemblyTable upon removing a mod whose Assembly Table recipes were being used (asie)
|
||||
* Creative Engines only outputting 1/5th the advertised RF/t (asie)
|
||||
* Frame icon not rendering on Quarry Frame building (asie)
|
||||
* Frame icon not rendering on Quarry frame building (asie)
|
||||
* NullPointerException on invalid StackRequest saving (asie)
|
||||
* Rare StackOverflowException on breaking Markers (asie)
|
||||
* StackOverflowException when breaking large Quarry frames (asie)
|
||||
|
|
|
@ -159,8 +159,10 @@ public class BuildCraftEnergy extends BuildCraftMod {
|
|||
|
||||
BuildCraftCore.mainConfiguration.save();
|
||||
|
||||
BiomeGenBase[] biomeGenArray = BiomeGenBase.getBiomeGenArray();
|
||||
|
||||
if (oilDesertBiomeId > 0) {
|
||||
if (BiomeGenBase.getBiomeGenArray()[oilDesertBiomeId] != null) {
|
||||
if (biomeGenArray.length >= oilDesertBiomeId || biomeGenArray[oilDesertBiomeId] != null) {
|
||||
oilDesertBiomeId = findUnusedBiomeID("oilDesert");
|
||||
// save changes to config file
|
||||
BuildCraftCore.mainConfiguration.get("worldgen.biomes", "biomeOilDesert", oilDesertBiomeId).set(oilDesertBiomeId);
|
||||
|
@ -170,7 +172,7 @@ public class BuildCraftEnergy extends BuildCraftMod {
|
|||
}
|
||||
|
||||
if (oilOceanBiomeId > 0) {
|
||||
if (BiomeGenBase.getBiomeGenArray()[oilOceanBiomeId] != null) {
|
||||
if (biomeGenArray.length >= oilOceanBiomeId || biomeGenArray[oilOceanBiomeId] != null) {
|
||||
oilOceanBiomeId = findUnusedBiomeID("oilOcean");
|
||||
// save changes to config file
|
||||
BuildCraftCore.mainConfiguration.get("worldgen.biomes", "biomeOilOcean", oilOceanBiomeId).set(oilOceanBiomeId);
|
||||
|
@ -433,7 +435,7 @@ public class BuildCraftEnergy extends BuildCraftMod {
|
|||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public BiomeIdLimitException(String biome) {
|
||||
super(String.format("You have run out of free Biome ID spaces for %s", biome));
|
||||
super(String.format("You have run out of free Biome ID spaces for %s - free more Biome IDs or disable the biome by setting the ID to 0!", biome));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -9,8 +9,11 @@
|
|||
package buildcraft.builders;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.ConcurrentSkipListSet;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
|
@ -27,12 +30,13 @@ import net.minecraft.world.World;
|
|||
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import buildcraft.BuildCraftCore;
|
||||
import buildcraft.api.core.BlockIndex;
|
||||
import buildcraft.core.CoreConstants;
|
||||
import buildcraft.core.internal.IFramePipeConnection;
|
||||
import buildcraft.core.lib.utils.Utils;
|
||||
|
||||
public class BlockFrame extends Block implements IFramePipeConnection {
|
||||
private static final ThreadLocal<Boolean> isRemovingFrames = new ThreadLocal<Boolean>();
|
||||
|
||||
public BlockFrame() {
|
||||
super(Material.glass);
|
||||
|
@ -45,16 +49,33 @@ public class BlockFrame extends Block implements IFramePipeConnection {
|
|||
return;
|
||||
}
|
||||
|
||||
if (isRemovingFrames.get() == null) {
|
||||
removeNeighboringFrames(world, x, y, z);
|
||||
}
|
||||
}
|
||||
|
||||
public void removeNeighboringFrames(World world, int x, int y, int z) {
|
||||
isRemovingFrames.set(true);
|
||||
|
||||
Set<BlockIndex> frameCoords = new ConcurrentSkipListSet<BlockIndex>();
|
||||
frameCoords.add(new BlockIndex(x, y, z));
|
||||
|
||||
while (frameCoords.size() > 0) {
|
||||
Iterator<BlockIndex> frameCoordIterator = frameCoords.iterator();
|
||||
while (frameCoordIterator.hasNext()) {
|
||||
BlockIndex i = frameCoordIterator.next();
|
||||
for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
|
||||
Block nBlock = world.getBlock(x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ);
|
||||
Block nBlock = world.getBlock(i.x + dir.offsetX, i.y + dir.offsetY, i.z + dir.offsetZ);
|
||||
if (nBlock == this) {
|
||||
world.setBlockToAir(x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ);
|
||||
world.setBlockToAir(i.x + dir.offsetX, i.y + dir.offsetY, i.z + dir.offsetZ);
|
||||
frameCoords.add(new BlockIndex(i.x + dir.offsetX, i.y + dir.offsetY, i.z + dir.offsetZ));
|
||||
}
|
||||
}
|
||||
frameCoordIterator.remove();
|
||||
}
|
||||
}
|
||||
|
||||
isRemovingFrames.remove();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -149,7 +149,7 @@ public class BlockMarker extends BlockBuildCraft {
|
|||
|
||||
private void dropTorchIfCantStay(World world, int x, int y, int z) {
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
if (!canPlaceBlockOnSide(world, x, y, z, meta)) {
|
||||
if (!canPlaceBlockOnSide(world, x, y, z, meta) && world.getBlock(x, y, z) == this) {
|
||||
dropBlockAsItem(world, x, y, z, 0, 0);
|
||||
world.setBlockToAir(x, y, z);
|
||||
}
|
||||
|
|
|
@ -20,6 +20,7 @@ import net.minecraftforge.common.DimensionManager;
|
|||
import buildcraft.BuildCraftCore;
|
||||
import buildcraft.core.network.PacketIds;
|
||||
|
||||
// TODO: Rename to PacketGuiUpdate
|
||||
public class PacketGuiReturn extends Packet {
|
||||
private EntityPlayer sender;
|
||||
private IGuiReturnHandler obj;
|
||||
|
|
|
@ -48,6 +48,10 @@ public final class ResourceUtils {
|
|||
* @return
|
||||
*/
|
||||
public static String getObjectPrefix(String objectName) {
|
||||
if (objectName == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
int splitLocation = objectName.indexOf(":");
|
||||
return objectName.substring(0, splitLocation).replaceAll("[^a-zA-Z0-9\\s]", "") + objectName.substring(splitLocation);
|
||||
}
|
||||
|
|
|
@ -33,6 +33,7 @@ public class RenderLEDTile extends TileEntitySpecialRenderer {
|
|||
public static void registerBlockIcons(IIconRegister register) {
|
||||
for (Block b : iconMap.keySet().toArray(new Block[iconMap.keySet().size()])) {
|
||||
String base = ResourceUtils.getObjectPrefix(Block.blockRegistry.getNameForObject(b));
|
||||
if (base != null) {
|
||||
List<IIcon> icons = new ArrayList<IIcon>();
|
||||
if (b instanceof ICustomLEDBlock) {
|
||||
for (String s : ((ICustomLEDBlock) b).getLEDSuffixes()) {
|
||||
|
@ -46,6 +47,7 @@ public class RenderLEDTile extends TileEntitySpecialRenderer {
|
|||
iconMap.put(b, icons.toArray(new IIcon[icons.size()]));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntity tile, double x, double y, double z, float f) {
|
||||
|
|
|
@ -51,7 +51,10 @@ public class StackRequest {
|
|||
|
||||
public IRequestProvider getRequester(World world) {
|
||||
if (requester == null) {
|
||||
requester = getStation(world).getRequestProvider();
|
||||
DockingStation dockingStation = getStation(world);
|
||||
if (dockingStation != null) {
|
||||
requester = dockingStation.getRequestProvider();
|
||||
}
|
||||
}
|
||||
return requester;
|
||||
}
|
||||
|
@ -85,13 +88,16 @@ public class StackRequest {
|
|||
stack.writeToNBT(stackNBT);
|
||||
nbt.setTag("stack", stackNBT);
|
||||
|
||||
if (station != null) {
|
||||
NBTTagCompound stationIndexNBT = new NBTTagCompound();
|
||||
station.index().writeTo(stationIndexNBT);
|
||||
nbt.setTag("stationIndex", stationIndexNBT);
|
||||
nbt.setByte("stationSide", (byte) station.side().ordinal());
|
||||
}
|
||||
}
|
||||
|
||||
public static StackRequest loadFromNBT(NBTTagCompound nbt) {
|
||||
if (nbt.hasKey("stationIndex")) {
|
||||
int slot = nbt.getInteger("slot");
|
||||
|
||||
ItemStack stack = ItemStack.loadItemStackFromNBT(nbt.getCompoundTag("stack"));
|
||||
|
@ -100,9 +106,12 @@ public class StackRequest {
|
|||
ForgeDirection stationSide = ForgeDirection.values()[nbt.getByte("stationSide")];
|
||||
|
||||
return new StackRequest(slot, stack, stationIndex, stationSide);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public ResourceId getResourceId(World world) {
|
||||
return new ResourceIdRequest(getStation(world), slot);
|
||||
return getStation(world) != null ? new ResourceIdRequest(getStation(world), slot) : null;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -36,7 +36,12 @@ public class AIRobotDeliverRequested extends AIRobot {
|
|||
|
||||
@Override
|
||||
public void start() {
|
||||
if (requested != null) {
|
||||
startDelegateAI(new AIRobotGotoStation(robot, requested.getStation(robot.worldObj)));
|
||||
} else {
|
||||
setSuccess(false);
|
||||
terminate();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -142,6 +142,7 @@ public class TileAssemblyTable extends TileLaserTableBase implements IInventory,
|
|||
private void generatePlannedOutputIcons() {
|
||||
for (String s : plannedOutput) {
|
||||
IFlexibleRecipe<ItemStack> recipe = AssemblyRecipeManager.INSTANCE.getRecipe(s);
|
||||
if (recipe != null) {
|
||||
CraftingResult<ItemStack> result = recipe.craft(this, true);
|
||||
if (result != null && result.usedItems != null && result.usedItems.size() > 0) {
|
||||
plannedOutputIcons.put(s, result);
|
||||
|
@ -155,6 +156,9 @@ public class TileAssemblyTable extends TileLaserTableBase implements IInventory,
|
|||
plannedOutputIcons.put(s, result);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
plannedOutput.remove(s);
|
||||
}
|
||||
}
|
||||
|
||||
for (String s : plannedOutputIcons.keySet().toArray(new String[plannedOutputIcons.size()])) {
|
||||
|
|
|
@ -82,16 +82,6 @@ public class GuiEmeraldPipe extends GuiBuildCraft implements IButtonClickEventLi
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onGuiClosed() {
|
||||
if (pipe.getWorld().isRemote) {
|
||||
PacketGuiReturn pkt = new PacketGuiReturn(pipe.getContainer());
|
||||
pkt.sendPacket();
|
||||
}
|
||||
|
||||
super.onGuiClosed();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleButtonClick(IButtonClickEventTrigger sender, int buttonId) {
|
||||
switch (buttonId) {
|
||||
|
@ -117,6 +107,11 @@ public class GuiEmeraldPipe extends GuiBuildCraft implements IButtonClickEventLi
|
|||
pipe.getSettings().setFilterMode(FilterMode.ROUND_ROBIN);
|
||||
break;
|
||||
}
|
||||
|
||||
if (pipe.getWorld().isRemote) {
|
||||
PacketGuiReturn pkt = new PacketGuiReturn(pipe.getContainer());
|
||||
pkt.sendPacket();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in a new issue