mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
new RBMK columns
This commit is contained in:
parent
2b36cc8e0d
commit
3ef96ad63b
@ -1034,6 +1034,8 @@ public class ModBlocks {
|
||||
public static Block rbmk_absorber;
|
||||
public static Block rbmk_moderator;
|
||||
public static Block rbmk_outgasser;
|
||||
public static Block rbmk_storage;
|
||||
public static Block rbmk_cooler;
|
||||
public static Block rbmk_console;
|
||||
public static Block rbmk_crane_console;
|
||||
public static final int guiID_rbmk_rod = 113;
|
||||
@ -1945,6 +1947,8 @@ public class ModBlocks {
|
||||
rbmk_absorber = new RBMKAbsorber().setBlockName("rbmk_absorber").setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":rbmk/rbmk_absorber");
|
||||
rbmk_moderator = new RBMKModerator().setBlockName("rbmk_moderator").setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":rbmk/rbmk_moderator");
|
||||
rbmk_outgasser = new RBMKOutgasser().setBlockName("rbmk_outgasser").setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":rbmk/rbmk_outgasser");
|
||||
rbmk_storage = new RBMKStorage().setBlockName("rbmk_storage").setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":rbmk/rbmk_storage");
|
||||
rbmk_cooler = new RBMKCooler().setBlockName("rbmk_cooler").setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":rbmk/rbmk_cooler");
|
||||
rbmk_console = new RBMKConsole().setBlockName("rbmk_console").setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":rbmk/rbmk_console");
|
||||
rbmk_crane_console = new RBMKCraneConsole().setBlockName("rbmk_crane_console").setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":rbmk/rbmk_crane_console");
|
||||
rbmk_loader = new BlockGeneric(Material.iron).setBlockName("rbmk_loader").setCreativeTab(MainRegistry.machineTab).setHardness(50.0F).setResistance(60.0F).setBlockTextureName(RefStrings.MODID + ":rbmk_loader");
|
||||
@ -2796,6 +2800,8 @@ public class ModBlocks {
|
||||
GameRegistry.registerBlock(rbmk_absorber, rbmk_absorber.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(rbmk_moderator, rbmk_moderator.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(rbmk_outgasser, rbmk_outgasser.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(rbmk_storage, rbmk_storage.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(rbmk_cooler, rbmk_cooler.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(rbmk_console, rbmk_console.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(rbmk_crane_console, rbmk_crane_console.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(rbmk_loader, rbmk_loader.getUnlocalizedName());
|
||||
|
||||
23
src/main/java/com/hbm/blocks/machine/rbmk/RBMKCooler.java
Normal file
23
src/main/java/com/hbm/blocks/machine/rbmk/RBMKCooler.java
Normal file
@ -0,0 +1,23 @@
|
||||
package com.hbm.blocks.machine.rbmk;
|
||||
|
||||
import com.hbm.tileentity.machine.rbmk.TileEntityRBMKCooler;
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class RBMKCooler extends RBMKBase {
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
|
||||
if(meta >= this.offset)
|
||||
return new TileEntityRBMKCooler();
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType(){
|
||||
return this.renderIDPassive;
|
||||
}
|
||||
}
|
||||
25
src/main/java/com/hbm/blocks/machine/rbmk/RBMKStorage.java
Normal file
25
src/main/java/com/hbm/blocks/machine/rbmk/RBMKStorage.java
Normal file
@ -0,0 +1,25 @@
|
||||
package com.hbm.blocks.machine.rbmk;
|
||||
|
||||
import com.hbm.tileentity.TileEntityProxyCombo;
|
||||
import com.hbm.tileentity.machine.rbmk.TileEntityRBMKOutgasser;
|
||||
import com.hbm.tileentity.machine.rbmk.TileEntityRBMKStorage;
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class RBMKStorage extends RBMKBase {
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
|
||||
if(meta >= this.offset)
|
||||
return new TileEntityRBMKStorage();
|
||||
|
||||
return new TileEntityProxyCombo(true, false, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType(){
|
||||
return this.renderIDPassive;
|
||||
}
|
||||
}
|
||||
@ -255,6 +255,8 @@ public class TileMappings {
|
||||
map.put(TileEntityRBMKAbsorber.class, "tileentity_rbmk_absorber");
|
||||
map.put(TileEntityRBMKModerator.class, "tileentity_rbmk_moderator");
|
||||
map.put(TileEntityRBMKOutgasser.class, "tileentity_rbmk_outgasser");
|
||||
map.put(TileEntityRBMKCooler.class, "tileentity_rbmk_cooler");
|
||||
map.put(TileEntityRBMKStorage.class, "tileentity_rbmk_storage");
|
||||
map.put(TileEntityCraneConsole.class, "tileentity_rbmk_crane_console");
|
||||
map.put(TileEntityRBMKConsole.class, "tileentity_rbmk_console");
|
||||
map.put(TileEntityRBMKInlet.class, "tileentity_rbmk_inlet");
|
||||
|
||||
@ -0,0 +1,33 @@
|
||||
package com.hbm.tileentity.machine.rbmk;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public interface IRBMKLoadable {
|
||||
|
||||
/**
|
||||
* @param toLoad the ItemStack that should be loaded
|
||||
* @return TRUE if the provided ItemStack can be inserted into the column
|
||||
*/
|
||||
public boolean canLoad(ItemStack toLoad);
|
||||
|
||||
/**
|
||||
* Loads the given ItemStack, canLoad check necessary first
|
||||
* @param toLoad
|
||||
*/
|
||||
public void load(ItemStack toLoad);
|
||||
|
||||
/**
|
||||
* @return TRUE if the column contains an ItemStack that can be unloaded
|
||||
*/
|
||||
public boolean canUnload();
|
||||
|
||||
/**
|
||||
* @return The next ItemStack to be unloaded
|
||||
*/
|
||||
public ItemStack provideNext();
|
||||
|
||||
/**
|
||||
* Removes the next ItemStack as part of the unloading process
|
||||
*/
|
||||
public void unload();
|
||||
}
|
||||
@ -270,7 +270,9 @@ public class TileEntityRBMKConsole extends TileEntityMachineBase implements ICon
|
||||
ABSORBER(60),
|
||||
REFLECTOR(70),
|
||||
OUTGASSER(80),
|
||||
BREEDER(100);
|
||||
BREEDER(100),
|
||||
STORAGE(110),
|
||||
COOLER(120);
|
||||
|
||||
public int offset;
|
||||
|
||||
|
||||
@ -0,0 +1,96 @@
|
||||
package com.hbm.tileentity.machine.rbmk;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.handler.FluidTypeHandler.FluidType;
|
||||
import com.hbm.interfaces.IFluidAcceptor;
|
||||
import com.hbm.inventory.FluidTank;
|
||||
import com.hbm.tileentity.machine.rbmk.TileEntityRBMKConsole.ColumnType;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
public class TileEntityRBMKCooler extends TileEntityRBMKBase implements IFluidAcceptor {
|
||||
|
||||
private FluidTank tank;
|
||||
|
||||
public TileEntityRBMKCooler() {
|
||||
super();
|
||||
|
||||
this.tank = new FluidTank(FluidType.CRYOGEL, 8000, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
|
||||
if(!worldObj.isRemote) {
|
||||
|
||||
if((int)(this.heat) > 750) {
|
||||
|
||||
int heatProvided = (int)(this.heat - 750D);
|
||||
int cooling = Math.min(heatProvided, tank.getFill());
|
||||
|
||||
this.heat -= cooling;
|
||||
this.tank.setFill(this.tank.getFill() - cooling);
|
||||
|
||||
/*
|
||||
* spew fire here
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
super.updateEntity();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbt) {
|
||||
super.readFromNBT(nbt);
|
||||
|
||||
tank.readFromNBT(nbt, "cryo");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbt) {
|
||||
super.writeToNBT(nbt);
|
||||
|
||||
tank.writeToNBT(nbt, "cryo");
|
||||
}
|
||||
|
||||
@Override
|
||||
public ColumnType getConsoleType() {
|
||||
return ColumnType.COOLER;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFillstate(int fill, int index) {
|
||||
tank.setFill(fill);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFluidFill(int fill, FluidType type) {
|
||||
if(type == tank.getTankType())
|
||||
tank.setFill(fill);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setType(FluidType type, int index) {
|
||||
tank.setTankType(type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FluidTank> getTanks() {
|
||||
return new ArrayList() {{ add(tank); }};
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFluidFill(FluidType type) {
|
||||
return type == tank.getTankType() ? tank.getFill() : 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxFluidFill(FluidType type) {
|
||||
return type == tank.getTankType() ? tank.getMaxFill() : 0;
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,81 @@
|
||||
package com.hbm.tileentity.machine.rbmk;
|
||||
|
||||
import com.hbm.items.machine.ItemRBMKRod;
|
||||
import com.hbm.tileentity.machine.rbmk.TileEntityRBMKConsole.ColumnType;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
public class TileEntityRBMKStorage extends TileEntityRBMKSlottedBase implements IRBMKLoadable {
|
||||
|
||||
public TileEntityRBMKStorage() {
|
||||
super(12);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "container.rbmkStorage";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
|
||||
if(!worldObj.isRemote) {
|
||||
|
||||
for(int i = 0; i < slots.length - 1; i++) {
|
||||
|
||||
if(slots[i] == null && slots[i + 1] != null) {
|
||||
slots[i] = slots[i + 1];
|
||||
slots[i + 1] = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
super.updateEntity();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ColumnType getConsoleType() {
|
||||
return ColumnType.STORAGE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isItemValidForSlot(int i, ItemStack itemStack) {
|
||||
return itemStack.getItem() instanceof ItemRBMKRod;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canExtractItem(int i, ItemStack itemStack, int j) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getAccessibleSlotsFromSide(int p_94128_1_) {
|
||||
return new int[] {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11};
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canLoad(ItemStack toLoad) {
|
||||
return slots[11] == null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void load(ItemStack toLoad) {
|
||||
slots[11] = toLoad.copy();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canUnload() {
|
||||
return slots[0] != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack provideNext() {
|
||||
return slots[0];
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unload() {
|
||||
slots[0] = null;
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 925 B |
Binary file not shown.
|
Before Width: | Height: | Size: 5.6 KiB After Width: | Height: | Size: 5.9 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 2.2 KiB |
Loading…
x
Reference in New Issue
Block a user