challenge pissing

This commit is contained in:
Boblet 2026-03-10 16:52:19 +01:00
parent d9353f5cc8
commit a95b3761c6
15 changed files with 278 additions and 106 deletions

View File

@ -1,11 +1,10 @@
## Changed ## Changed
* Updated russian localization * Updated textures for some nuclear bomb GUIs
* Safes now properly use the inventorytweaks API, allowing slot sorting via GUI * RBMK fuel rods too hot to be taken out manually can now be removed by players in creative mode
* The meltdown disabling dial now also affects meldown caused by breaking fuel channels while hot * Updated the SILEX recycling recipe for MOX fuel to reflect the recent recipe change
* The dots on the grpahite moderator columns are now a lot darker to tell them apart from fuel channels much more easily * High-xenon MOX pellets now yield xenon-135 again
* Improved logging for incorrectly configured machine recipes
## Fixed ## Fixed
* Fixed RBMK fuel channel RoR not being properly parseable due to not being integers * Fixed some damage categories not applying correctly, causing things like general energy resistance to not work against lasers
* Potentially fixed a dupe regarding safes * Fixed RoR components not being able to be attached to the top of reasim fuel rods
* Moved the flow control pump's GUI code out of the block class which should hopefully fix an issue where spigot servers crash instantly when placed down
* Fixed RBMKs melting down when removing the covers from fuel channels with hot fuel in them

View File

@ -1097,6 +1097,7 @@ public class ModBlocks {
public static Block rbmk_console; public static Block rbmk_console;
public static Block rbmk_crane_console; public static Block rbmk_crane_console;
public static Block rbmk_display; public static Block rbmk_display;
public static Block rbmk_key_pad;
public static Block rbmk_autoloader; public static Block rbmk_autoloader;
public static Block rbmk_loader; public static Block rbmk_loader;
public static Block rbmk_steam_inlet; public static Block rbmk_steam_inlet;
@ -2117,6 +2118,7 @@ public class ModBlocks {
rbmk_console = new RBMKConsole().setBlockName("rbmk_console").setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":rbmk/rbmk_console"); 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_crane_console = new RBMKCraneConsole().setBlockName("rbmk_crane_console").setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":rbmk/rbmk_crane_console");
rbmk_display = new RBMKDisplay().setBlockName("rbmk_display").setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":rbmk/rbmk_display"); rbmk_display = new RBMKDisplay().setBlockName("rbmk_display").setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":rbmk/rbmk_display");
rbmk_key_pad = new RBMKKeyPad().setBlockName("rbmk_key_pad").setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":rbmk/rbmk_display");
rbmk_autoloader = new RBMKAutoloader().setBlockName("rbmk_autoloader").setCreativeTab(MainRegistry.machineTab).setHardness(50.0F).setResistance(60.0F).setBlockTextureName(RefStrings.MODID + ":rbmk_autoloader"); rbmk_autoloader = new RBMKAutoloader().setBlockName("rbmk_autoloader").setCreativeTab(MainRegistry.machineTab).setHardness(50.0F).setResistance(60.0F).setBlockTextureName(RefStrings.MODID + ":rbmk_autoloader");
rbmk_loader = new RBMKLoader(Material.iron).setBlockName("rbmk_loader").setCreativeTab(MainRegistry.machineTab).setHardness(50.0F).setResistance(60.0F).setBlockTextureName(RefStrings.MODID + ":rbmk_loader"); rbmk_loader = new RBMKLoader(Material.iron).setBlockName("rbmk_loader").setCreativeTab(MainRegistry.machineTab).setHardness(50.0F).setResistance(60.0F).setBlockTextureName(RefStrings.MODID + ":rbmk_loader");
rbmk_steam_inlet = new RBMKInlet(Material.iron).setBlockName("rbmk_steam_inlet").setCreativeTab(MainRegistry.machineTab).setHardness(50.0F).setResistance(60.0F).setBlockTextureName(RefStrings.MODID + ":rbmk_steam_inlet"); rbmk_steam_inlet = new RBMKInlet(Material.iron).setBlockName("rbmk_steam_inlet").setCreativeTab(MainRegistry.machineTab).setHardness(50.0F).setResistance(60.0F).setBlockTextureName(RefStrings.MODID + ":rbmk_steam_inlet");
@ -3109,6 +3111,7 @@ public class ModBlocks {
GameRegistry.registerBlock(rbmk_console, rbmk_console.getUnlocalizedName()); GameRegistry.registerBlock(rbmk_console, rbmk_console.getUnlocalizedName());
GameRegistry.registerBlock(rbmk_crane_console, rbmk_crane_console.getUnlocalizedName()); GameRegistry.registerBlock(rbmk_crane_console, rbmk_crane_console.getUnlocalizedName());
register(rbmk_display); register(rbmk_display);
register(rbmk_key_pad);
register(rbmk_autoloader); register(rbmk_autoloader);
register(rbmk_loader); register(rbmk_loader);
register(rbmk_steam_inlet); register(rbmk_steam_inlet);

View File

@ -1,57 +1,19 @@
package com.hbm.blocks.machine.rbmk; package com.hbm.blocks.machine.rbmk;
import org.lwjgl.opengl.GL11;
import com.hbm.render.block.ISBRHUniversal;
import com.hbm.render.util.RenderBlocksNT;
import com.hbm.tileentity.machine.rbmk.TileEntityRBMKDisplay; import com.hbm.tileentity.machine.rbmk.TileEntityRBMKDisplay;
import api.hbm.block.IToolable; import api.hbm.block.IToolable;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.MathHelper;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World; import net.minecraft.world.World;
public class RBMKDisplay extends BlockContainer implements ISBRHUniversal, IToolable { public class RBMKDisplay extends RBMKMiniPanelBase implements IToolable {
public RBMKDisplay() {
super(Material.iron);
}
@Override public int getRenderType() { return renderID; }
@Override public boolean isOpaqueCube() { return false; }
@Override public boolean renderAsNormalBlock() { return false; }
@Override
@SideOnly(Side.CLIENT)
public boolean shouldSideBeRendered(IBlockAccess world, int x, int y, int z, int side) {
return true;
}
@Override @Override
public TileEntity createNewTileEntity(World world, int meta) { public TileEntity createNewTileEntity(World world, int meta) {
return new TileEntityRBMKDisplay(); return new TileEntityRBMKDisplay();
} }
@Override
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack itemStack) {
int i = MathHelper.floor_double(player.rotationYaw * 4.0F / 360.0F + 0.5D) & 3;
if(i == 0) world.setBlockMetadataWithNotify(x, y, z, 2, 2);
if(i == 1) world.setBlockMetadataWithNotify(x, y, z, 5, 2);
if(i == 2) world.setBlockMetadataWithNotify(x, y, z, 3, 2);
if(i == 3) world.setBlockMetadataWithNotify(x, y, z, 4, 2);
}
@Override @Override
public boolean onScrew(World world, EntityPlayer player, int x, int y, int z, int side, float fX, float fY, float fZ, ToolType tool) { public boolean onScrew(World world, EntityPlayer player, int x, int y, int z, int side, float fX, float fY, float fZ, ToolType tool) {
if(tool != ToolType.SCREWDRIVER) if(tool != ToolType.SCREWDRIVER)
@ -64,33 +26,4 @@ public class RBMKDisplay extends BlockContainer implements ISBRHUniversal, ITool
} }
return true; return true;
} }
@Override
public void renderInventoryBlock(Block block, int meta, int modelId, Object renderBlocks) {
GL11.glPushMatrix();
RenderBlocks renderer = (RenderBlocks) renderBlocks;
GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F);
GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
renderer.setRenderBounds(0.25D, 0D, 0D, 1D, 1D, 1D);
RenderBlocksNT.renderStandardInventoryBlock(block, meta, renderer);
GL11.glPopMatrix();
}
@Override
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, Object renderBlocks) {
RenderBlocksNT renderer = RenderBlocksNT.INSTANCE.setWorld(world);
Tessellator tessellator = Tessellator.instance;
tessellator.setBrightness(block.getMixedBrightnessForBlock(world, x, y, z));
tessellator.setColorOpaque_F(1, 1, 1);
int meta = world.getBlockMetadata(x, y, z);
renderer.setRenderBounds(meta == 4 ? 0.25D : 0D, 0D, meta == 2 ? 0.25D : 0D, meta == 5 ? 0.75D : 1D, 1D, meta == 3 ? 0.75D : 1D);
renderer.renderStandardBlock(block, x, y, z);
return true;
}
} }

View File

@ -0,0 +1,14 @@
package com.hbm.blocks.machine.rbmk;
import com.hbm.tileentity.machine.rbmk.TileEntityRBMKKeyPad;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
public class RBMKKeyPad extends RBMKMiniPanelBase {
@Override
public TileEntity createNewTileEntity(World world, int meta) {
return new TileEntityRBMKKeyPad();
}
}

View File

@ -0,0 +1,74 @@
package com.hbm.blocks.machine.rbmk;
import org.lwjgl.opengl.GL11;
import com.hbm.render.block.ISBRHUniversal;
import com.hbm.render.util.RenderBlocksNT;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.item.ItemStack;
import net.minecraft.util.MathHelper;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
public abstract class RBMKMiniPanelBase extends BlockContainer implements ISBRHUniversal {
public RBMKMiniPanelBase() {
super(Material.iron);
}
@Override public int getRenderType() { return renderID; }
@Override public boolean isOpaqueCube() { return false; }
@Override public boolean renderAsNormalBlock() { return false; }
@Override
@SideOnly(Side.CLIENT)
public boolean shouldSideBeRendered(IBlockAccess world, int x, int y, int z, int side) {
return true;
}
@Override
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack itemStack) {
int i = MathHelper.floor_double(player.rotationYaw * 4.0F / 360.0F + 0.5D) & 3;
if(i == 0) world.setBlockMetadataWithNotify(x, y, z, 2, 2);
if(i == 1) world.setBlockMetadataWithNotify(x, y, z, 5, 2);
if(i == 2) world.setBlockMetadataWithNotify(x, y, z, 3, 2);
if(i == 3) world.setBlockMetadataWithNotify(x, y, z, 4, 2);
}
@Override
public void renderInventoryBlock(Block block, int meta, int modelId, Object renderBlocks) {
GL11.glPushMatrix();
RenderBlocks renderer = (RenderBlocks) renderBlocks;
GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F);
GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
renderer.setRenderBounds(0.25D, 0D, 0D, 1D, 1D, 1D);
RenderBlocksNT.renderStandardInventoryBlock(block, meta, renderer);
GL11.glPopMatrix();
}
@Override
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, Object renderBlocks) {
RenderBlocksNT renderer = RenderBlocksNT.INSTANCE.setWorld(world);
Tessellator tessellator = Tessellator.instance;
tessellator.setBrightness(block.getMixedBrightnessForBlock(world, x, y, z));
tessellator.setColorOpaque_F(1, 1, 1);
int meta = world.getBlockMetadata(x, y, z);
renderer.setRenderBounds(meta == 4 ? 0.25D : 0D, 0D, meta == 2 ? 0.25D : 0D, meta == 5 ? 0.75D : 1D, 1D, meta == 3 ? 0.75D : 1D);
renderer.renderStandardBlock(block, x, y, z);
return true;
}
}

View File

@ -1,6 +1,6 @@
package com.hbm.blocks.machine.rbmk; package com.hbm.blocks.machine.rbmk;
import com.hbm.tileentity.TileEntityProxyInventory; import com.hbm.tileentity.TileEntityProxyCombo;
import com.hbm.tileentity.machine.rbmk.TileEntityRBMKRodReaSim; import com.hbm.tileentity.machine.rbmk.TileEntityRBMKRodReaSim;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
@ -14,13 +14,8 @@ public class RBMKRodReaSim extends RBMKRod {
@Override @Override
public TileEntity createNewTileEntity(World world, int meta) { public TileEntity createNewTileEntity(World world, int meta) {
if(meta >= this.offset) return new TileEntityRBMKRodReaSim();
if(meta >= this.offset) if(hasExtra(meta)) return new TileEntityProxyCombo().inventory();
return new TileEntityRBMKRodReaSim();
if(hasExtra(meta))
return new TileEntityProxyInventory();
return null; return null;
} }
} }

View File

@ -271,6 +271,11 @@ public class RecipesCommon {
public List<ItemStack> extractForNEI() { public List<ItemStack> extractForNEI() {
return Arrays.asList(new ItemStack[] {this.toStack()}); return Arrays.asList(new ItemStack[] {this.toStack()});
} }
@Override
public String toString() {
return this.stacksize + "x" + (this.item != null ? this.item.getUnlocalizedName() : "null") + "@" + this.meta;
}
} }
public static class NBTStack extends ComparableStack { public static class NBTStack extends ComparableStack {
@ -374,6 +379,11 @@ public class RecipesCommon {
return 0; return 0;
} }
@Override
public String toString() {
return this.stacksize + "x" + (this.item != null ? this.item.getUnlocalizedName() : "null") + "@" + this.meta + "?" + this.nbt;
}
} }
public static class OreDictStack extends AStack { public static class OreDictStack extends AStack {
@ -490,6 +500,11 @@ public class RecipesCommon {
return false; return false;
return true; return true;
} }
@Override
public String toString() {
return this.stacksize + "x" + this.name;
}
} }
public static class MetaBlock { public static class MetaBlock {

View File

@ -31,7 +31,7 @@ public class ContainerRBMKRod extends Container {
@Override @Override
public ItemStack slotClick(int index, int button, int mode, EntityPlayer player) { public ItemStack slotClick(int index, int button, int mode, EntityPlayer player) {
if(index == 0) { if(index == 0 && !player.capabilities.isCreativeMode) {
if(rbmk.coldEnoughForManual()) { if(rbmk.coldEnoughForManual()) {
return super.slotClick(index, button, mode, player); return super.slotClick(index, button, mode, player);

View File

@ -274,20 +274,18 @@ public class SILEXRecipes {
// MOX // // MOX //
recipes.put(new ComparableStack(ModItems.rbmk_pellet_mox, 1, i), new SILEXRecipe(600, 100, 1) recipes.put(new ComparableStack(ModItems.rbmk_pellet_mox, 1, i), new SILEXRecipe(600, 100, 1)
.addOut(new ItemStack(ModItems.nugget_mox_fuel), 84 - i * 20) .addOut(new ItemStack(ModItems.nugget_mox_fuel), 84 - i * 20)
.addOut(i < 1 ? new ItemStack(ModItems.nugget_pu239) : new ItemStack(ModItems.nugget_pu_mix), 6 + i * 4) .addOut(new ItemStack(ModItems.nugget_pu_mix), 6 + i * 4)
.addOut(new ItemStack(ModItems.nuclear_waste_long_tiny, 1, ItemWasteLong.WasteClass.URANIUM235.ordinal()), 2 + 3 * i) .addOut(new ItemStack(ModItems.nuclear_waste_long_tiny, 1, ItemWasteLong.WasteClass.URANIUM235.ordinal()), 2 + 3 * i)
.addOut(new ItemStack(ModItems.nuclear_waste_short_tiny, 1, ItemWasteShort.WasteClass.URANIUM235.ordinal()), 3 + 5 * i) .addOut(new ItemStack(ModItems.nuclear_waste_short_tiny, 1, ItemWasteShort.WasteClass.URANIUM235.ordinal()), 3 + 5 * i)
.addOut(new ItemStack(ModItems.nuclear_waste_short_tiny, 1, ItemWasteShort.WasteClass.PLUTONIUM239.ordinal()), 3 + 5 * i) .addOut(new ItemStack(ModItems.nuclear_waste_short_tiny, 1, ItemWasteShort.WasteClass.PLUTONIUM239.ordinal()), 5 + 8 * i) );
.addOut(new ItemStack(ModItems.nuclear_waste_short_tiny, 1, ItemWasteShort.WasteClass.PLUTONIUM240.ordinal()), 2 + 3 * i) );
//TODO: Readd xenon processing if/when the NEI handler can display more than 6 outputs properly recipes.put(new ComparableStack(ModItems.rbmk_pellet_mox, 1, i + 5), new SILEXRecipe(600, 100, 1)
recipes.put(new ComparableStack(ModItems.rbmk_pellet_mox, 1, i + 5), new SILEXRecipe(600, 100, 1) //Plutonium processing isn't possible w/o fucking up the NEI handler or removing xenon .addOut(new ItemStack(ModItems.powder_xe135_tiny), 1)
.addOut(new ItemStack(ModItems.nugget_mox_fuel), 84 - i * 20) //To prevent people from taking advantage of differing waste types, conform to the latter .addOut(new ItemStack(ModItems.nugget_mox_fuel), 83 - i * 20)
.addOut(i < 1 ? new ItemStack(ModItems.nugget_pu239) : new ItemStack(ModItems.nugget_pu_mix), 6 + i * 4) .addOut(new ItemStack(ModItems.nugget_pu_mix), 6 + i * 4)
.addOut(new ItemStack(ModItems.nuclear_waste_long_tiny, 1, ItemWasteLong.WasteClass.URANIUM235.ordinal()), 2 + 3 * i) .addOut(new ItemStack(ModItems.nuclear_waste_long_tiny, 1, ItemWasteLong.WasteClass.URANIUM235.ordinal()), 2 + 3 * i)
.addOut(new ItemStack(ModItems.nuclear_waste_short_tiny, 1, ItemWasteShort.WasteClass.URANIUM235.ordinal()), 3 + 5 * i) .addOut(new ItemStack(ModItems.nuclear_waste_short_tiny, 1, ItemWasteShort.WasteClass.URANIUM235.ordinal()), 3 + 5 * i)
.addOut(new ItemStack(ModItems.nuclear_waste_short_tiny, 1, ItemWasteShort.WasteClass.PLUTONIUM239.ordinal()), 3 + 5 * i) .addOut(new ItemStack(ModItems.nuclear_waste_short_tiny, 1, ItemWasteShort.WasteClass.PLUTONIUM239.ordinal()), 5 + 8 * i) );
.addOut(new ItemStack(ModItems.nuclear_waste_short_tiny, 1, ItemWasteShort.WasteClass.PLUTONIUM240.ordinal()), 2 + 3 * i) );
// LEAUS // // LEAUS //
recipes.put(new ComparableStack(ModItems.rbmk_pellet_leaus, 1, i), new SILEXRecipe(600, 100, 2) recipes.put(new ComparableStack(ModItems.rbmk_pellet_leaus, 1, i), new SILEXRecipe(600, 100, 2)

View File

@ -74,17 +74,21 @@ public class GenericRecipe {
public GenericRecipe setPools528(String... pools) { if(GeneralConfig.enable528) { this.blueprintPools = pools; for(String pool : pools) GenericRecipes.addToPool(pool, this); } return this; } public GenericRecipe setPools528(String... pools) { if(GeneralConfig.enable528) { this.blueprintPools = pools; for(String pool : pools) GenericRecipes.addToPool(pool, this); } return this; }
public GenericRecipe setGroup(String autoSwitch, GenericRecipes set) { this.autoSwitchGroup = autoSwitch; set.addToGroup(autoSwitch, this); return this; } public GenericRecipe setGroup(String autoSwitch, GenericRecipes set) { this.autoSwitchGroup = autoSwitch; set.addToGroup(autoSwitch, this); return this; }
public GenericRecipe inputItems(AStack... input) { this.inputItem = input; for(AStack stack : this.inputItem) if(exceedsStackLimit(stack)) throw new IllegalArgumentException("AStack in " + this.name + " exceeds stack limit!"); return this; } public GenericRecipe inputItems(AStack... input) { this.inputItem = input; for(AStack stack : this.inputItem) checkStackLimit(stack); return this; }
public GenericRecipe inputItemsEx(AStack... input) { if(!GeneralConfig.enableExpensiveMode) return this; this.inputItem = input; for(AStack stack : this.inputItem) if(exceedsStackLimit(stack)) throw new IllegalArgumentException("AStack in " + this.name + " exceeds stack limit!"); return this; } public GenericRecipe inputItemsEx(AStack... input) { if(!GeneralConfig.enableExpensiveMode) return this; this.inputItem = input; for(AStack stack : this.inputItem) checkStackLimit(stack); return this; }
public GenericRecipe inputFluids(FluidStack... input) { this.inputFluid = input; return this; } public GenericRecipe inputFluids(FluidStack... input) { this.inputFluid = input; return this; }
public GenericRecipe inputFluidsEx(FluidStack... input) { if(!GeneralConfig.enableExpensiveMode) return this; this.inputFluid = input; return this; } public GenericRecipe inputFluidsEx(FluidStack... input) { if(!GeneralConfig.enableExpensiveMode) return this; this.inputFluid = input; return this; }
public GenericRecipe outputItems(IOutput... output) { this.outputItem = output; return this; } public GenericRecipe outputItems(IOutput... output) { this.outputItem = output; return this; }
public GenericRecipe outputFluids(FluidStack... output) { this.outputFluid = output; return this; } public GenericRecipe outputFluids(FluidStack... output) { this.outputFluid = output; return this; }
private boolean exceedsStackLimit(AStack stack) { private void checkStackLimit(AStack stack) {
if(stack instanceof ComparableStack && stack.stacksize > ((ComparableStack) stack).item.getItemStackLimit(((ComparableStack) stack).toStack())) return true; boolean exceeds = false;
if(stack.stacksize > 64) return true; int max = 64;
return false; if(stack instanceof ComparableStack) {
ComparableStack comp = (ComparableStack) stack;
max = comp.item.getItemStackLimit(comp.toStack());
}
if(stack.stacksize > max) throw new IllegalArgumentException("AStack " + stack + " in " + this.name + " exceeds stack limit of " + max + "!");
} }
public GenericRecipe outputItems(ItemStack... output) { public GenericRecipe outputItems(ItemStack... output) {

View File

@ -411,6 +411,7 @@ public class ClientProxy extends ServerProxy {
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityCraneConsole.class, new RenderCraneConsole()); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityCraneConsole.class, new RenderCraneConsole());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityRBMKConsole.class, new RenderRBMKConsole()); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityRBMKConsole.class, new RenderRBMKConsole());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityRBMKDisplay.class, new RenderRBMKDisplay()); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityRBMKDisplay.class, new RenderRBMKDisplay());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityRBMKKeyPad.class, new RenderRBMKKeyPad());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityRBMKRod.class, new RenderRBMKFuelChannel()); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityRBMKRod.class, new RenderRBMKFuelChannel());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityRBMKRodReaSim.class, new RenderRBMKFuelChannel()); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityRBMKRodReaSim.class, new RenderRBMKFuelChannel());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityRBMKAutoloader.class, new RenderRBMKAutoloader()); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityRBMKAutoloader.class, new RenderRBMKAutoloader());

View File

@ -0,0 +1,31 @@
package com.hbm.render.tileentity;
import org.lwjgl.opengl.GL11;
import com.hbm.tileentity.machine.rbmk.TileEntityRBMKKeyPad;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.tileentity.TileEntity;
public class RenderRBMKKeyPad extends TileEntitySpecialRenderer {
@Override
public void renderTileEntityAt(TileEntity te, double x, double y, double z, float interp) {
GL11.glPushMatrix();
GL11.glTranslated(x + 0.5, y, z + 0.5);
GL11.glEnable(GL11.GL_CULL_FACE);
GL11.glEnable(GL11.GL_LIGHTING);
switch(te.getBlockMetadata()) {
case 2: GL11.glRotatef(90, 0F, 1F, 0F); break;
case 4: GL11.glRotatef(180, 0F, 1F, 0F); break;
case 3: GL11.glRotatef(270, 0F, 1F, 0F); break;
case 5: GL11.glRotatef(0, 0F, 1F, 0F); break;
}
TileEntityRBMKKeyPad keypad = (TileEntityRBMKKeyPad) te;
GL11.glPopMatrix();
}
}

View File

@ -403,6 +403,7 @@ public class TileMappings {
put(TileEntityCraneConsole.class, "tileentity_rbmk_crane_console"); put(TileEntityCraneConsole.class, "tileentity_rbmk_crane_console");
put(TileEntityRBMKConsole.class, "tileentity_rbmk_console"); put(TileEntityRBMKConsole.class, "tileentity_rbmk_console");
put(TileEntityRBMKDisplay.class, "tileentity_rbmk_display"); put(TileEntityRBMKDisplay.class, "tileentity_rbmk_display");
put(TileEntityRBMKKeyPad.class, "tileentity_rbmk_keypad");
put(TileEntityRBMKInlet.class, "tileentity_rbmk_inlet"); put(TileEntityRBMKInlet.class, "tileentity_rbmk_inlet");
put(TileEntityRBMKOutlet.class, "tileentity_rbmk_outlet"); put(TileEntityRBMKOutlet.class, "tileentity_rbmk_outlet");
put(TileEntityRBMKAutoloader.class, "tileentity_rbmk_autoloader"); put(TileEntityRBMKAutoloader.class, "tileentity_rbmk_autoloader");

View File

@ -0,0 +1,102 @@
package com.hbm.tileentity.machine.rbmk;
import com.hbm.tileentity.TileEntityLoadedBase;
import com.hbm.tileentity.network.RTTYSystem;
import com.hbm.util.BufferUtil;
import io.netty.buffer.ByteBuf;
public class TileEntityRBMKKeyPad extends TileEntityLoadedBase {
/* __________
* / /|
* /________ / |
* | __ __ | |
* ||__| |__|| |
* | __ __ | |
* ||__| |__|| /
* |_________|/
*/
public KeyUnit[] keys = new KeyUnit[4];
public TileEntityRBMKKeyPad() {
for(int i = 0; i < 4; i++) this.keys[i] = new KeyUnit();
}
@Override
public void updateEntity() {
if(!worldObj.isRemote) {
for(int i = 0; i < 4; i++) this.keys[i].update();
this.networkPackNT(50);
}
}
@Override
public void serialize(ByteBuf buf) {
super.serialize(buf);
for(int i = 0; i < 4; i++) this.keys[i].serialize(buf);
}
@Override
public void deserialize(ByteBuf buf) {
super.deserialize(buf);
for(int i = 0; i < 4; i++) this.keys[i].deserialize(buf);
}
public class KeyUnit {
/** If the output should be per tick, allows the "is pressed" state */
public boolean polling;
/** If the button is toggled, assuming polling is enabled */
public boolean isPressed;
/** Color of the button as rendered on the panel */
public int color;
/** Label on the button as rendered on the panel */
public String label;
/** What channel to send the command over */
public String rtty;
/** What to send when pressed */
public String command;
public void click() {
if(!polling) {
if(canSend()) RTTYSystem.broadcast(worldObj, rtty, command);
} else {
this.isPressed = !this.isPressed;
TileEntityRBMKKeyPad.this.markDirty();
}
}
public void update() {
if(polling && isPressed) {
if(canSend()) RTTYSystem.broadcast(worldObj, rtty, command);
}
}
public boolean canSend() {
return rtty != null && !rtty.isEmpty() && command != null && !command.isEmpty();
}
public void serialize(ByteBuf buf) {
buf.writeBoolean(polling);
if(polling) buf.writeBoolean(isPressed);
buf.writeInt(color);
BufferUtil.writeString(buf, label);
BufferUtil.writeString(buf, rtty);
BufferUtil.writeString(buf, command);
}
public void deserialize(ByteBuf buf) {
polling = buf.readBoolean();
if(polling) isPressed = buf.readBoolean();
color = buf.readInt();
label = BufferUtil.readString(buf);
rtty = BufferUtil.readString(buf);
command = BufferUtil.readString(buf);
}
}
}

View File

@ -8,6 +8,7 @@ import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Locale;
import java.util.Map.Entry; import java.util.Map.Entry;
import com.google.gson.Gson; import com.google.gson.Gson;
@ -443,6 +444,7 @@ public class DamageResistanceHandler {
@SubscribeEvent @SubscribeEvent
public void onEntityDamaged(LivingHurtEvent event) { public void onEntityDamaged(LivingHurtEvent event) {
event.ammount = calculateDamage(event.entityLiving, event.source, event.ammount, currentPDT, currentPDR); event.ammount = calculateDamage(event.entityLiving, event.source, event.ammount, currentPDT, currentPDR);
if(event.entityLiving instanceof IResistanceProvider) { if(event.entityLiving instanceof IResistanceProvider) {
IResistanceProvider irp = (IResistanceProvider) event.entityLiving; IResistanceProvider irp = (IResistanceProvider) event.entityLiving;
@ -454,10 +456,10 @@ public class DamageResistanceHandler {
if(source.isExplosion()) return CATEGORY_EXPLOSION; if(source.isExplosion()) return CATEGORY_EXPLOSION;
if(source.isFireDamage()) return CATEGORY_FIRE; if(source.isFireDamage()) return CATEGORY_FIRE;
if(source.isProjectile()) return CATEGORY_PHYSICAL; if(source.isProjectile()) return CATEGORY_PHYSICAL;
if(source.damageType.equals(DamageClass.LASER.name())) return CATEGORY_ENERGY; if(source.damageType.toLowerCase(Locale.US).equals(DamageClass.LASER.name().toLowerCase(Locale.US))) return CATEGORY_ENERGY;
if(source.damageType.equals(DamageClass.MICROWAVE.name())) return CATEGORY_ENERGY; if(source.damageType.toLowerCase(Locale.US).equals(DamageClass.MICROWAVE.name().toLowerCase(Locale.US))) return CATEGORY_ENERGY;
if(source.damageType.equals(DamageClass.SUBATOMIC.name())) return CATEGORY_ENERGY; if(source.damageType.toLowerCase(Locale.US).equals(DamageClass.SUBATOMIC.name().toLowerCase(Locale.US))) return CATEGORY_ENERGY;
if(source.damageType.equals(DamageClass.ELECTRIC.name())) return CATEGORY_ENERGY; if(source.damageType.toLowerCase(Locale.US).equals(DamageClass.ELECTRIC.name().toLowerCase(Locale.US))) return CATEGORY_ENERGY;
if(source == DamageSource.cactus) return CATEGORY_PHYSICAL; if(source == DamageSource.cactus) return CATEGORY_PHYSICAL;
if(source instanceof EntityDamageSource) return CATEGORY_PHYSICAL; if(source instanceof EntityDamageSource) return CATEGORY_PHYSICAL;
return source.damageType; return source.damageType;
@ -546,7 +548,7 @@ public class DamageResistanceHandler {
return source.isUnblockable() ? null : otherResistance; return source.isUnblockable() ? null : otherResistance;
} }
public ResistanceStats addExact(String type, float threshold, float resistance) { exactResistances.put(type, new Resistance(threshold, resistance)); return this; } public ResistanceStats addExact(String type, float threshold, float resistance) { exactResistances.put(type.toLowerCase(Locale.US), new Resistance(threshold, resistance)); return this; }
public ResistanceStats addCategory(String type, float threshold, float resistance) { categoryResistances.put(type, new Resistance(threshold, resistance)); return this; } public ResistanceStats addCategory(String type, float threshold, float resistance) { categoryResistances.put(type, new Resistance(threshold, resistance)); return this; }
public ResistanceStats setOther(float threshold, float resistance) { otherResistance = new Resistance(threshold, resistance); return this; } public ResistanceStats setOther(float threshold, float resistance) { otherResistance = new Resistance(threshold, resistance); return this; }