improve pipe rotatablity in blueprints, begin adding heuristic detection of necessary rotation code
This commit is contained in:
parent
a6e5e6f016
commit
bc3963b8dc
4 changed files with 25 additions and 46 deletions
|
@ -71,6 +71,7 @@ import buildcraft.core.proxy.CoreProxy;
|
|||
import buildcraft.transport.BlockFilteredBuffer;
|
||||
import buildcraft.transport.BlockGenericPipe;
|
||||
import buildcraft.transport.FacadePluggable;
|
||||
import buildcraft.transport.IDiamondPipe;
|
||||
import buildcraft.transport.IMCHandlerTransport;
|
||||
import buildcraft.transport.ItemFacade;
|
||||
import buildcraft.transport.ItemGateCopier;
|
||||
|
@ -144,9 +145,8 @@ import buildcraft.transport.pluggable.ItemPlug;
|
|||
import buildcraft.transport.pluggable.LensPluggable;
|
||||
import buildcraft.transport.pluggable.PlugPluggable;
|
||||
import buildcraft.transport.render.PipeRendererTESR;
|
||||
import buildcraft.transport.schematics.BptItemPipeFilters;
|
||||
import buildcraft.transport.schematics.BptPipeIron;
|
||||
import buildcraft.transport.schematics.BptPipeWooden;
|
||||
import buildcraft.transport.schematics.BptPipeFiltered;
|
||||
import buildcraft.transport.schematics.BptPipeRotatable;
|
||||
import buildcraft.transport.schematics.SchematicPipe;
|
||||
import buildcraft.transport.statements.ActionEnergyPulsar;
|
||||
import buildcraft.transport.statements.ActionExtractionPreset;
|
||||
|
@ -462,16 +462,26 @@ public class BuildCraftTransport extends BuildCraftMod {
|
|||
|
||||
BuilderAPI.schematicRegistry.registerSchematicBlock(genericPipeBlock, SchematicPipe.class);
|
||||
|
||||
new BptPipeIron(pipeItemsIron);
|
||||
new BptPipeIron(pipeFluidsIron);
|
||||
new BptPipeIron(pipePowerIron);
|
||||
new BptPipeRotatable(pipeItemsWood);
|
||||
new BptPipeRotatable(pipeFluidsWood);
|
||||
new BptPipeRotatable(pipePowerWood);
|
||||
new BptPipeRotatable(pipeItemsIron);
|
||||
new BptPipeRotatable(pipeFluidsIron);
|
||||
new BptPipeRotatable(pipePowerIron);
|
||||
new BptPipeRotatable(pipeItemsEmerald);
|
||||
new BptPipeRotatable(pipeFluidsEmerald);
|
||||
new BptPipeRotatable(pipePowerEmerald);
|
||||
|
||||
new BptPipeWooden(pipeItemsWood);
|
||||
new BptPipeWooden(pipeFluidsWood);
|
||||
new BptPipeWooden(pipePowerWood);
|
||||
new BptPipeWooden(pipeItemsEmerald);
|
||||
new BptPipeRotatable(pipeItemsDaizuli);
|
||||
new BptPipeRotatable(pipeItemsEmzuli);
|
||||
|
||||
new BptItemPipeFilters(pipeItemsDiamond);
|
||||
for (Item itemPipe : BlockGenericPipe.pipes.keySet()) {
|
||||
Class<? extends Pipe> klazz = BlockGenericPipe.pipes.get(itemPipe);
|
||||
|
||||
if (IDiamondPipe.class.isAssignableFrom(klazz)) {
|
||||
new BptPipeFiltered(itemPipe);
|
||||
}
|
||||
}
|
||||
|
||||
BCCreativeTab.get("pipes").setIcon(new ItemStack(BuildCraftTransport.pipeItemsDiamond, 1));
|
||||
BCCreativeTab.get("facades").setIcon(facadeItem.getFacadeForBlock(Blocks.brick_block, 0));
|
||||
|
|
|
@ -15,9 +15,9 @@ import buildcraft.api.blueprints.IBuilderContext;
|
|||
import buildcraft.api.blueprints.SchematicTile;
|
||||
import buildcraft.core.lib.inventory.SimpleInventory;
|
||||
|
||||
public class BptItemPipeFilters extends BptPipeExtension {
|
||||
public class BptPipeFiltered extends BptPipeExtension {
|
||||
|
||||
public BptItemPipeFilters(Item i) {
|
||||
public BptPipeFiltered(Item i) {
|
||||
super (i);
|
||||
}
|
||||
|
|
@ -1,31 +0,0 @@
|
|||
/**
|
||||
* Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team
|
||||
* http://www.mod-buildcraft.com
|
||||
*
|
||||
* BuildCraft is distributed under the terms of the Minecraft Mod Public
|
||||
* License 1.0, or MMPL. Please check the contents of the license located in
|
||||
* http://www.mod-buildcraft.com/MMPL-1.0.txt
|
||||
*/
|
||||
package buildcraft.transport.schematics;
|
||||
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import buildcraft.api.blueprints.IBuilderContext;
|
||||
import buildcraft.api.blueprints.SchematicTile;
|
||||
|
||||
public class BptPipeIron extends BptPipeExtension {
|
||||
|
||||
public BptPipeIron(Item i) {
|
||||
super(i);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void rotateLeft(SchematicTile slot, IBuilderContext context) {
|
||||
int orientation = slot.meta & 7;
|
||||
int others = slot.meta - orientation;
|
||||
|
||||
slot.meta = ForgeDirection.values()[orientation].getRotation(ForgeDirection.UP).ordinal() + others;
|
||||
}
|
||||
|
||||
}
|
|
@ -14,9 +14,9 @@ import net.minecraftforge.common.util.ForgeDirection;
|
|||
import buildcraft.api.blueprints.IBuilderContext;
|
||||
import buildcraft.api.blueprints.SchematicTile;
|
||||
|
||||
public class BptPipeWooden extends BptPipeExtension {
|
||||
public class BptPipeRotatable extends BptPipeExtension {
|
||||
|
||||
public BptPipeWooden(Item i) {
|
||||
public BptPipeRotatable(Item i) {
|
||||
super (i);
|
||||
}
|
||||
|
Loading…
Reference in a new issue