mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
some more RBMK funnies
This commit is contained in:
parent
3ef96ad63b
commit
025c6dc40c
@ -6,17 +6,10 @@ import com.hbm.blocks.bomb.*;
|
||||
import com.hbm.blocks.fluid.*;
|
||||
import com.hbm.blocks.gas.*;
|
||||
import com.hbm.blocks.machine.*;
|
||||
import com.hbm.blocks.machine.pile.BlockGraphite;
|
||||
import com.hbm.blocks.machine.pile.BlockGraphiteDrilled;
|
||||
import com.hbm.blocks.machine.pile.BlockGraphiteFuel;
|
||||
import com.hbm.blocks.machine.pile.BlockGraphiteRod;
|
||||
import com.hbm.blocks.machine.pile.BlockGraphiteSource;
|
||||
import com.hbm.blocks.machine.pile.*;
|
||||
import com.hbm.blocks.machine.rbmk.*;
|
||||
import com.hbm.blocks.network.*;
|
||||
import com.hbm.blocks.siege.SiegeCircuit;
|
||||
import com.hbm.blocks.siege.SiegeHole;
|
||||
import com.hbm.blocks.siege.SiegeInternal;
|
||||
import com.hbm.blocks.siege.SiegeShield;
|
||||
import com.hbm.blocks.siege.*;
|
||||
import com.hbm.blocks.test.*;
|
||||
import com.hbm.blocks.turret.*;
|
||||
import com.hbm.items.block.*;
|
||||
@ -32,7 +25,6 @@ import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockFalling;
|
||||
import net.minecraft.block.material.*;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidRegistry;
|
||||
|
||||
@ -1044,6 +1036,7 @@ public class ModBlocks {
|
||||
public static final int guiID_rbmk_control_auto = 116;
|
||||
public static final int guiID_rbmk_console = 117;
|
||||
public static final int guiID_rbmk_outgasser = 119;
|
||||
public static final int guiID_rbmk_storage = 123;
|
||||
public static Block rbmk_loader;
|
||||
public static Block rbmk_steam_inlet;
|
||||
public static Block rbmk_steam_outlet;
|
||||
|
||||
@ -1,9 +1,11 @@
|
||||
package com.hbm.blocks.machine.rbmk;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.handler.BossSpawnHandler;
|
||||
import com.hbm.tileentity.TileEntityProxyCombo;
|
||||
import com.hbm.tileentity.machine.rbmk.TileEntityRBMKOutgasser;
|
||||
import com.hbm.tileentity.machine.rbmk.TileEntityRBMKStorage;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
@ -22,4 +24,10 @@ public class RBMKStorage extends RBMKBase {
|
||||
public int getRenderType(){
|
||||
return this.renderIDPassive;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
|
||||
BossSpawnHandler.markFBI(player);
|
||||
return openInv(world, x, y, z, player, ModBlocks.guiID_rbmk_storage);
|
||||
}
|
||||
}
|
||||
|
||||
@ -845,6 +845,13 @@ public class GUIHandler implements IGuiHandler {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
case ModBlocks.guiID_rbmk_storage: {
|
||||
if(entity instanceof TileEntityRBMKStorage) {
|
||||
return new ContainerRBMKStorage(player.inventory, (TileEntityRBMKStorage) entity);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
// NON-TE CONTAINERS
|
||||
|
||||
@ -1680,6 +1687,13 @@ public class GUIHandler implements IGuiHandler {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
case ModBlocks.guiID_rbmk_storage: {
|
||||
if(entity instanceof TileEntityRBMKStorage) {
|
||||
return new GUIRBMKStorage(player.inventory, (TileEntityRBMKStorage) entity);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
// ITEM GUIS
|
||||
|
||||
|
||||
@ -0,0 +1,66 @@
|
||||
package com.hbm.inventory.container;
|
||||
|
||||
import com.hbm.tileentity.machine.rbmk.TileEntityRBMKStorage;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ContainerRBMKStorage extends Container {
|
||||
|
||||
private TileEntityRBMKStorage rbmk;
|
||||
|
||||
public ContainerRBMKStorage(InventoryPlayer invPlayer, TileEntityRBMKStorage tedf) {
|
||||
rbmk = tedf;
|
||||
|
||||
for(int i = 0; i < 3; i++) {
|
||||
for(int j = 0; j < 4; j++) {
|
||||
this.addSlotToContainer(new Slot(tedf, i + j * 3, 32 + 32 * j, 29 + 16 * i));
|
||||
}
|
||||
}
|
||||
|
||||
for(int i = 0; i < 3; i++) {
|
||||
for(int j = 0; j < 9; j++) {
|
||||
this.addSlotToContainer(new Slot(invPlayer, j + i * 9 + 9, 8 + j * 18, 84 + i * 18 + 20));
|
||||
}
|
||||
}
|
||||
|
||||
for(int i = 0; i < 9; i++) {
|
||||
this.addSlotToContainer(new Slot(invPlayer, i, 8 + i * 18, 142 + 20));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack transferStackInSlot(EntityPlayer p_82846_1_, int par2) {
|
||||
ItemStack var3 = null;
|
||||
Slot var4 = (Slot) this.inventorySlots.get(par2);
|
||||
|
||||
if(var4 != null && var4.getHasStack()) {
|
||||
ItemStack var5 = var4.getStack();
|
||||
var3 = var5.copy();
|
||||
|
||||
if(par2 == 0) {
|
||||
if(!this.mergeItemStack(var5, rbmk.getSizeInventory(), this.inventorySlots.size(), true)) {
|
||||
return null;
|
||||
}
|
||||
} else if(!this.mergeItemStack(var5, 0, 12, false)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if(var5.stackSize == 0) {
|
||||
var4.putStack((ItemStack) null);
|
||||
} else {
|
||||
var4.onSlotChanged();
|
||||
}
|
||||
}
|
||||
|
||||
return var3;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer player) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
41
src/main/java/com/hbm/inventory/gui/GUIRBMKStorage.java
Normal file
41
src/main/java/com/hbm/inventory/gui/GUIRBMKStorage.java
Normal file
@ -0,0 +1,41 @@
|
||||
package com.hbm.inventory.gui;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.inventory.container.ContainerRBMKStorage;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.tileentity.machine.rbmk.TileEntityRBMKStorage;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class GUIRBMKStorage extends GuiInfoContainer {
|
||||
|
||||
private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/reactors/gui_rbmk_storage.png");
|
||||
private TileEntityRBMKStorage rod;
|
||||
|
||||
public GUIRBMKStorage(InventoryPlayer invPlayer, TileEntityRBMKStorage tedf) {
|
||||
super(new ContainerRBMKStorage(invPlayer, tedf));
|
||||
rod = tedf;
|
||||
|
||||
this.xSize = 176;
|
||||
this.ySize = 186;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(int i, int j) {
|
||||
String name = this.rod.hasCustomInventoryName() ? this.rod.getInventoryName() : I18n.format(this.rod.getInventoryName());
|
||||
|
||||
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
|
||||
this.fontRendererObj.drawString(I18n.format("container.inventory"), 8, this.ySize - 96 + 2, 4210752);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
|
||||
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
|
||||
}
|
||||
}
|
||||
@ -242,6 +242,8 @@ public class ClientProxy extends ServerProxy {
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityRBMKReflector.class, new RenderRBMKLid());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityRBMKRod.class, new RenderRBMKLid());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityRBMKRodReaSim.class, new RenderRBMKLid());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityRBMKCooler.class, new RenderRBMKLid());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityRBMKStorage.class, new RenderRBMKLid());
|
||||
//ITER
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityITER.class, new RenderITER());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachinePlasmaHeater.class, new RenderPlasmaHeater());
|
||||
|
||||
@ -954,6 +954,23 @@ public class ItemRenderLibrary {
|
||||
GL11.glShadeModel(GL11.GL_FLAT);
|
||||
}});
|
||||
|
||||
renderers.put(Item.getItemFromBlock(ModBlocks.rbmk_crane_console), new ItemRenderBase() {
|
||||
public void renderInventory() {
|
||||
GL11.glTranslated(0, -3, 0);
|
||||
GL11.glScaled(3.5, 3.5, 3.5);
|
||||
}
|
||||
public void renderCommon() {
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
bindTexture(ResourceManager.rbmk_crane_console_tex);
|
||||
ResourceManager.rbmk_crane_console.renderPart("Console_Coonsole");
|
||||
ResourceManager.rbmk_crane_console.renderPart("JoyStick");
|
||||
ResourceManager.rbmk_crane_console.renderPart("Meter1");
|
||||
ResourceManager.rbmk_crane_console.renderPart("Meter2");
|
||||
bindTexture(ResourceManager.ks23_tex); ResourceManager.rbmk_crane_console.renderPart("Shotgun");
|
||||
bindTexture(ResourceManager.mini_nuke_tex); ResourceManager.rbmk_crane_console.renderPart("MiniNuke");
|
||||
GL11.glShadeModel(GL11.GL_FLAT);
|
||||
}});
|
||||
|
||||
renderers.put(Item.getItemFromBlock(ModBlocks.lamp_demon), new ItemRenderBase() {
|
||||
public void renderInventory() {
|
||||
GL11.glTranslated(0, -3, 0);
|
||||
|
||||
@ -24,7 +24,7 @@ public class TileEntityTowerLarge extends TileEntityCondenser {
|
||||
|
||||
if(worldObj.isRemote) {
|
||||
|
||||
if(this.waterTimer > 0) {
|
||||
if(this.waterTimer > 0 && this.worldObj.getTotalWorldTime() % 4 == 0) {
|
||||
NBTTagCompound data = new NBTTagCompound();
|
||||
data.setString("type", "tower");
|
||||
data.setFloat("lift", 0.5F);
|
||||
|
||||
@ -24,7 +24,7 @@ public class TileEntityTowerSmall extends TileEntityCondenser {
|
||||
|
||||
if(worldObj.isRemote) {
|
||||
|
||||
if(this.waterTimer > 0) {
|
||||
if(this.waterTimer > 0 && this.worldObj.getTotalWorldTime() % 2 == 0) {
|
||||
NBTTagCompound data = new NBTTagCompound();
|
||||
data.setString("type", "tower");
|
||||
data.setFloat("lift", 1F);
|
||||
|
||||
@ -1,7 +1,20 @@
|
||||
package com.hbm.tileentity.machine.rbmk;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
|
||||
public class TileEntityCraneConsole extends TileEntity {
|
||||
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getRenderBoundingBox() {
|
||||
return AxisAlignedBB.getBoundingBox(xCoord - 1.5, yCoord, zCoord - 1.5, xCoord + 2.5, yCoord + 1.5, zCoord + 2.5);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public double getMaxRenderDistanceSquared() {
|
||||
return 65536.0D;
|
||||
}
|
||||
}
|
||||
|
||||
@ -8,12 +8,16 @@ import com.hbm.interfaces.IFluidAcceptor;
|
||||
import com.hbm.inventory.FluidTank;
|
||||
import com.hbm.tileentity.machine.rbmk.TileEntityRBMKConsole.ColumnType;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.DamageSource;
|
||||
|
||||
public class TileEntityRBMKCooler extends TileEntityRBMKBase implements IFluidAcceptor {
|
||||
|
||||
private FluidTank tank;
|
||||
private int lastCooled;
|
||||
|
||||
public TileEntityRBMKCooler() {
|
||||
super();
|
||||
@ -34,9 +38,39 @@ public class TileEntityRBMKCooler extends TileEntityRBMKBase implements IFluidAc
|
||||
this.heat -= cooling;
|
||||
this.tank.setFill(this.tank.getFill() - cooling);
|
||||
|
||||
/*
|
||||
* spew fire here
|
||||
*/
|
||||
this.lastCooled = cooling;
|
||||
|
||||
if(lastCooled > 0) {
|
||||
List<Entity> entities = worldObj.getEntitiesWithinAABB(Entity.class, AxisAlignedBB.getBoundingBox(xCoord, yCoord + 4, zCoord, xCoord + 1, yCoord + 8, zCoord + 1));
|
||||
|
||||
for(Entity e : entities) {
|
||||
e.setFire(5);
|
||||
e.attackEntityFrom(DamageSource.inFire, 10);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.lastCooled = 0;
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
if(this.lastCooled > 100) {
|
||||
for(int i = 0; i < 2; i++) {
|
||||
worldObj.spawnParticle("flame", xCoord + 0.25 + worldObj.rand.nextDouble() * 0.5, yCoord + 4.5, zCoord + 0.25 + worldObj.rand.nextDouble() * 0.5, 0, 0.2, 0);
|
||||
worldObj.spawnParticle("smoke", xCoord + 0.25 + worldObj.rand.nextDouble() * 0.5, yCoord + 4.5, zCoord + 0.25 + worldObj.rand.nextDouble() * 0.5, 0, 0.2, 0);
|
||||
}
|
||||
|
||||
if(worldObj.rand.nextInt(20) == 0)
|
||||
worldObj.spawnParticle("lava", xCoord + 0.25 + worldObj.rand.nextDouble() * 0.5, yCoord + 4.5, zCoord + 0.25 + worldObj.rand.nextDouble() * 0.5, 0, 0.0, 0);
|
||||
} else if(this.lastCooled > 50) {
|
||||
for(int i = 0; i < 2; i++) {
|
||||
worldObj.spawnParticle("cloud", xCoord + 0.25 + worldObj.rand.nextDouble() * 0.5, yCoord + 4.5, zCoord + 0.25 + worldObj.rand.nextDouble() * 0.5, worldObj.rand.nextGaussian() * 0.05, 0.2, worldObj.rand.nextGaussian() * 0.05);
|
||||
}
|
||||
} else if(this.lastCooled > 0) {
|
||||
|
||||
if(worldObj.getTotalWorldTime() % 2 == 0)
|
||||
worldObj.spawnParticle("cloud", xCoord + 0.25 + worldObj.rand.nextDouble() * 0.5, yCoord + 4.5, zCoord + 0.25 + worldObj.rand.nextDouble() * 0.5, 0, 0.2, 0);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -48,6 +82,7 @@ public class TileEntityRBMKCooler extends TileEntityRBMKBase implements IFluidAc
|
||||
super.readFromNBT(nbt);
|
||||
|
||||
tank.readFromNBT(nbt, "cryo");
|
||||
this.lastCooled = nbt.getInteger("cooled");
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -55,6 +90,7 @@ public class TileEntityRBMKCooler extends TileEntityRBMKBase implements IFluidAc
|
||||
super.writeToNBT(nbt);
|
||||
|
||||
tank.writeToNBT(nbt, "cryo");
|
||||
nbt.setInteger("cooled", this.lastCooled);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -20,7 +20,7 @@ public class TileEntityRBMKStorage extends TileEntityRBMKSlottedBase implements
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
|
||||
if(!worldObj.isRemote) {
|
||||
if(!worldObj.isRemote && worldObj.getTotalWorldTime() % 10 == 0) {
|
||||
|
||||
for(int i = 0; i < slots.length - 1; i++) {
|
||||
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 1.4 KiB |
Loading…
x
Reference in New Issue
Block a user