mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-03-11 12:15:35 +00:00
cyclotron automation yeah
This commit is contained in:
parent
2b7ffd6902
commit
7e5e2ce1c5
@ -25,7 +25,7 @@ public class MachineCyclotron extends BlockDummyable {
|
|||||||
return new TileEntityMachineCyclotron();
|
return new TileEntityMachineCyclotron();
|
||||||
|
|
||||||
if(meta >= 6)
|
if(meta >= 6)
|
||||||
return new TileEntityProxyCombo(false, true, true);
|
return new TileEntityProxyCombo().inventory().power().fluid();
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@ -93,12 +93,16 @@ public class MachineCyclotron extends BlockDummyable {
|
|||||||
super.fillSpace(world, x, y, z, dir, o);
|
super.fillSpace(world, x, y, z, dir, o);
|
||||||
|
|
||||||
this.makeExtra(world, x + dir.offsetX * o + 2, y, z + dir.offsetZ * o + 1);
|
this.makeExtra(world, x + dir.offsetX * o + 2, y, z + dir.offsetZ * o + 1);
|
||||||
|
this.makeExtra(world, x + dir.offsetX * o + 2, y, z + dir.offsetZ * o);
|
||||||
this.makeExtra(world, x + dir.offsetX * o + 2, y, z + dir.offsetZ * o - 1);
|
this.makeExtra(world, x + dir.offsetX * o + 2, y, z + dir.offsetZ * o - 1);
|
||||||
this.makeExtra(world, x + dir.offsetX * o - 2, y, z + dir.offsetZ * o + 1);
|
this.makeExtra(world, x + dir.offsetX * o - 2, y, z + dir.offsetZ * o + 1);
|
||||||
|
this.makeExtra(world, x + dir.offsetX * o - 2, y, z + dir.offsetZ * o);
|
||||||
this.makeExtra(world, x + dir.offsetX * o - 2, y, z + dir.offsetZ * o - 1);
|
this.makeExtra(world, x + dir.offsetX * o - 2, y, z + dir.offsetZ * o - 1);
|
||||||
this.makeExtra(world, x + dir.offsetX * o + 1, y, z + dir.offsetZ * o + 2);
|
this.makeExtra(world, x + dir.offsetX * o + 1, y, z + dir.offsetZ * o + 2);
|
||||||
|
this.makeExtra(world, x + dir.offsetX * o, y, z + dir.offsetZ * o + 2);
|
||||||
this.makeExtra(world, x + dir.offsetX * o - 1, y, z + dir.offsetZ * o + 2);
|
this.makeExtra(world, x + dir.offsetX * o - 1, y, z + dir.offsetZ * o + 2);
|
||||||
this.makeExtra(world, x + dir.offsetX * o + 1, y, z + dir.offsetZ * o - 2);
|
this.makeExtra(world, x + dir.offsetX * o + 1, y, z + dir.offsetZ * o - 2);
|
||||||
|
this.makeExtra(world, x + dir.offsetX * o, y, z + dir.offsetZ * o - 2);
|
||||||
this.makeExtra(world, x + dir.offsetX * o - 1, y, z + dir.offsetZ * o - 2);
|
this.makeExtra(world, x + dir.offsetX * o - 1, y, z + dir.offsetZ * o - 2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
package com.hbm.tileentity.machine;
|
package com.hbm.tileentity.machine;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map.Entry;
|
||||||
|
|
||||||
import com.hbm.config.BombConfig;
|
import com.hbm.config.BombConfig;
|
||||||
import com.hbm.entity.effect.EntityBlackHole;
|
import com.hbm.entity.effect.EntityBlackHole;
|
||||||
@ -11,6 +11,8 @@ import com.hbm.explosion.ExplosionLarge;
|
|||||||
import com.hbm.explosion.ExplosionThermo;
|
import com.hbm.explosion.ExplosionThermo;
|
||||||
import com.hbm.interfaces.IFluidAcceptor;
|
import com.hbm.interfaces.IFluidAcceptor;
|
||||||
import com.hbm.interfaces.IFluidSource;
|
import com.hbm.interfaces.IFluidSource;
|
||||||
|
import com.hbm.inventory.RecipesCommon.AStack;
|
||||||
|
import com.hbm.inventory.RecipesCommon.ComparableStack;
|
||||||
import com.hbm.inventory.container.ContainerMachineCyclotron;
|
import com.hbm.inventory.container.ContainerMachineCyclotron;
|
||||||
import com.hbm.inventory.fluid.FluidType;
|
import com.hbm.inventory.fluid.FluidType;
|
||||||
import com.hbm.inventory.fluid.Fluids;
|
import com.hbm.inventory.fluid.Fluids;
|
||||||
@ -22,8 +24,10 @@ import com.hbm.items.machine.ItemMachineUpgrade;
|
|||||||
import com.hbm.lib.Library;
|
import com.hbm.lib.Library;
|
||||||
import com.hbm.packet.AuxParticlePacketNT;
|
import com.hbm.packet.AuxParticlePacketNT;
|
||||||
import com.hbm.packet.PacketDispatcher;
|
import com.hbm.packet.PacketDispatcher;
|
||||||
|
import com.hbm.tileentity.IConditionalInvAccess;
|
||||||
import com.hbm.tileentity.IGUIProvider;
|
import com.hbm.tileentity.IGUIProvider;
|
||||||
import com.hbm.tileentity.TileEntityMachineBase;
|
import com.hbm.tileentity.TileEntityMachineBase;
|
||||||
|
import com.hbm.util.Tuple.Pair;
|
||||||
import com.hbm.util.fauxpointtwelve.DirPos;
|
import com.hbm.util.fauxpointtwelve.DirPos;
|
||||||
|
|
||||||
import api.hbm.energy.IEnergyUser;
|
import api.hbm.energy.IEnergyUser;
|
||||||
@ -39,8 +43,9 @@ import net.minecraft.item.ItemStack;
|
|||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraft.util.AxisAlignedBB;
|
import net.minecraft.util.AxisAlignedBB;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
|
|
||||||
public class TileEntityMachineCyclotron extends TileEntityMachineBase implements IFluidSource, IFluidAcceptor, IEnergyUser, IFluidStandardTransceiver, IGUIProvider {
|
public class TileEntityMachineCyclotron extends TileEntityMachineBase implements IFluidSource, IFluidAcceptor, IEnergyUser, IFluidStandardTransceiver, IGUIProvider, IConditionalInvAccess {
|
||||||
|
|
||||||
public long power;
|
public long power;
|
||||||
public static final long maxPower = 100000000;
|
public static final long maxPower = 100000000;
|
||||||
@ -59,8 +64,6 @@ public class TileEntityMachineCyclotron extends TileEntityMachineBase implements
|
|||||||
public FluidTank coolant;
|
public FluidTank coolant;
|
||||||
public FluidTank amat;
|
public FluidTank amat;
|
||||||
|
|
||||||
public List<IFluidAcceptor> list = new ArrayList();
|
|
||||||
|
|
||||||
public TileEntityMachineCyclotron() {
|
public TileEntityMachineCyclotron() {
|
||||||
super(16);
|
super(16);
|
||||||
|
|
||||||
@ -408,39 +411,11 @@ public class TileEntityMachineCyclotron extends TileEntityMachineBase implements
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override public void fillFluidInit(FluidType type) { }
|
||||||
public void fillFluidInit(FluidType type) {
|
@Override public void fillFluid(int x, int y, int z, boolean newTact, FluidType type) { }
|
||||||
|
@Override public boolean getTact() { return false; }
|
||||||
fillFluid(xCoord + 3, yCoord, zCoord + 1, getTact(), type);
|
@Override public List<IFluidAcceptor> getFluidList(FluidType type) { return null; }
|
||||||
fillFluid(xCoord + 3, yCoord, zCoord - 1, getTact(), type);
|
@Override public void clearFluidList(FluidType type) { }
|
||||||
fillFluid(xCoord - 3, yCoord, zCoord + 1, getTact(), type);
|
|
||||||
fillFluid(xCoord - 3, yCoord, zCoord - 1, getTact(), type);
|
|
||||||
|
|
||||||
fillFluid(xCoord + 1, yCoord, zCoord + 3, getTact(), type);
|
|
||||||
fillFluid(xCoord - 1, yCoord, zCoord + 3, getTact(), type);
|
|
||||||
fillFluid(xCoord + 1, yCoord, zCoord - 3, getTact(), type);
|
|
||||||
fillFluid(xCoord - 1, yCoord, zCoord - 3, getTact(), type);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void fillFluid(int x, int y, int z, boolean newTact, FluidType type) {
|
|
||||||
Library.transmitFluid(x, y, z, newTact, this, worldObj, type);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean getTact() {
|
|
||||||
return age >= 0 && age < 10;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<IFluidAcceptor> getFluidList(FluidType type) {
|
|
||||||
return list;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void clearFluidList(FluidType type) {
|
|
||||||
list.clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getMaxFluidFill(FluidType type) {
|
public int getMaxFluidFill(FluidType type) {
|
||||||
@ -559,4 +534,46 @@ public class TileEntityMachineCyclotron extends TileEntityMachineBase implements
|
|||||||
public GuiScreen provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
public GuiScreen provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||||
return new GUIMachineCyclotron(player.inventory, this);
|
return new GUIMachineCyclotron(player.inventory, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isItemValidForSlot(int x, int y, int z, int slot, ItemStack stack) {
|
||||||
|
|
||||||
|
if(slot < 3) {
|
||||||
|
for(Entry<Pair<ComparableStack, AStack>, Pair<ItemStack, Integer>> entry : CyclotronRecipes.recipes.entrySet()) {
|
||||||
|
if(entry.getKey().getKey().matchesRecipe(stack, true)) return true;
|
||||||
|
}
|
||||||
|
} else if(slot < 6) {
|
||||||
|
|
||||||
|
for(Entry<Pair<ComparableStack, AStack>, Pair<ItemStack, Integer>> entry : CyclotronRecipes.recipes.entrySet()) {
|
||||||
|
if(entry.getKey().getValue().matchesRecipe(stack, true)) return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canInsertItem(int x, int y, int z, int slot, ItemStack stack, int side) {
|
||||||
|
return this.isItemValidForSlot(x, y, z, slot, stack);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canExtractItem(int x, int y, int z, int slot, ItemStack stack, int side) {
|
||||||
|
return slot >= 6 && slot <= 8;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int[] getAccessibleSlotsFromSide(int x, int y, int z, int side) {
|
||||||
|
|
||||||
|
for(int i = 2; i < 6; i++) {
|
||||||
|
ForgeDirection dir = ForgeDirection.getOrientation(i);
|
||||||
|
ForgeDirection rot = dir.getRotation(ForgeDirection.UP);
|
||||||
|
|
||||||
|
if(x == xCoord + dir.offsetX * 2 + rot.offsetX && z == zCoord + dir.offsetZ * 2 + rot.offsetZ) return new int[] {0, 3, 6, 7, 8};
|
||||||
|
if(x == xCoord + dir.offsetX * 2 && z == zCoord + dir.offsetZ * 2) return new int[] {1, 4, 6, 7, 8};
|
||||||
|
if(x == xCoord + dir.offsetX * 2 - rot.offsetX && z == zCoord + dir.offsetZ * 2 - rot.offsetZ) return new int[] {2, 5, 6, 7, 8};
|
||||||
|
}
|
||||||
|
|
||||||
|
return new int[] {6, 7, 8};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 4.4 KiB After Width: | Height: | Size: 4.5 KiB |
Loading…
x
Reference in New Issue
Block a user