chunkier fatman, silicon compat

This commit is contained in:
Bob 2022-10-22 23:55:54 +02:00
parent bd4976f6f6
commit 56d719d049
20 changed files with 3876 additions and 774 deletions

View File

@ -4,6 +4,7 @@ import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.Random; import java.util.Random;
import com.hbm.blocks.IBlockMulti;
import com.hbm.blocks.ITooltipProvider; import com.hbm.blocks.ITooltipProvider;
import com.hbm.blocks.ModBlocks; import com.hbm.blocks.ModBlocks;
import com.hbm.entity.projectile.EntityShrapnel; import com.hbm.entity.projectile.EntityShrapnel;
@ -28,7 +29,7 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.EnumChatFormatting;
import net.minecraft.world.World; import net.minecraft.world.World;
public class BlockVolcano extends BlockContainer implements ITooltipProvider { public class BlockVolcano extends BlockContainer implements ITooltipProvider, IBlockMulti {
public BlockVolcano() { public BlockVolcano() {
super(Material.iron); super(Material.iron);
@ -39,6 +40,11 @@ public class BlockVolcano extends BlockContainer implements ITooltipProvider {
return new TileEntityVolcanoCore(); return new TileEntityVolcanoCore();
} }
@Override
public int getSubCount() {
return 5;
}
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void getSubBlocks(Item item, CreativeTabs tab, List list) { public void getSubBlocks(Item item, CreativeTabs tab, List list) {
@ -299,7 +305,7 @@ public class BlockVolcano extends BlockContainer implements ITooltipProvider {
/* count per tick, radius, depth */ /* count per tick, radius, depth */
private Object[] surfaceMeltingParams() { private Object[] surfaceMeltingParams() {
return this.getBlockMetadata() == META_SMOLDERING ? new Object[] {2, 50D, 10D} : null; return this.getBlockMetadata() == META_SMOLDERING ? new Object[] {50, 50D, 10D} : null;
} }
private int getUpdateRate() { private int getUpdateRate() {
@ -307,7 +313,7 @@ public class BlockVolcano extends BlockContainer implements ITooltipProvider {
case META_STATIC_EXTINGUISHING: return 60 * 60 * 20; //once per hour case META_STATIC_EXTINGUISHING: return 60 * 60 * 20; //once per hour
case META_GROWING_ACTIVE: case META_GROWING_ACTIVE:
case META_GROWING_EXTINGUISHING: return 60 * 60 * 20 / 250; //250x per hour case META_GROWING_EXTINGUISHING: return 60 * 60 * 20 / 250; //250x per hour
default: return 1; default: return 10;
} }
} }

View File

@ -48,6 +48,6 @@ public class RadiationConfig {
disableExplosive = CommonConfig.createConfigBool(config, CATEGORY_HAZ, "HAZ_03_disableExplosive", "When turned off, all explosive hazards are disabled", false); disableExplosive = CommonConfig.createConfigBool(config, CATEGORY_HAZ, "HAZ_03_disableExplosive", "When turned off, all explosive hazards are disabled", false);
disableHydro = CommonConfig.createConfigBool(config, CATEGORY_HAZ, "HAZ_04_disableHydroactive", "When turned off, all hydroactive hazards are disabled", false); disableHydro = CommonConfig.createConfigBool(config, CATEGORY_HAZ, "HAZ_04_disableHydroactive", "When turned off, all hydroactive hazards are disabled", false);
disableBlinding = CommonConfig.createConfigBool(config, CATEGORY_HAZ, "HAZ_05_disableBlinding", "When turned off, all blinding hazards are disabled", false); disableBlinding = CommonConfig.createConfigBool(config, CATEGORY_HAZ, "HAZ_05_disableBlinding", "When turned off, all blinding hazards are disabled", false);
disableFibrosis = CommonConfig.createConfigBool(config, CATEGORY_HAZ, "HAZ_06_disableFibrosis", "When turned off, all firbosis hazards are disabled", false); disableFibrosis = CommonConfig.createConfigBool(config, CATEGORY_HAZ, "HAZ_06_disableFibrosis", "When turned off, all fibrosis hazards are disabled", false);
} }
} }

View File

@ -23,6 +23,11 @@ public class EntityMeteor extends Entity {
@Override @Override
public void onUpdate() { public void onUpdate() {
if(!worldObj.isRemote && !WorldConfig.enableMeteorStrikes) {
this.setDead();
return;
}
this.prevPosX = this.posX; this.prevPosX = this.posX;
this.prevPosY = this.posY; this.prevPosY = this.posY;
this.prevPosZ = this.posZ; this.prevPosZ = this.posZ;

View File

@ -16,62 +16,49 @@ public class ContainerSafe extends Container {
public ContainerSafe(InventoryPlayer invPlayer, TileEntitySafe tedf) { public ContainerSafe(InventoryPlayer invPlayer, TileEntitySafe tedf) {
diFurnace = tedf; diFurnace = tedf;
for(int i = 0; i < 3; i++) for(int i = 0; i < 3; i++) {
{ for(int j = 0; j < 5; j++) {
for(int j = 0; j < 5; j++)
{
this.addSlotToContainer(new Slot(tedf, j + i * 5, 8 + j * 18 + 18 * 2, 18 + i * 18)); this.addSlotToContainer(new Slot(tedf, j + i * 5, 8 + j * 18 + 18 * 2, 18 + i * 18));
} }
} }
for(int i = 0; i < 3; i++) for(int i = 0; i < 3; i++) {
{ for(int j = 0; j < 9; j++) {
for(int j = 0; j < 9; j++)
{
this.addSlotToContainer(new Slot(invPlayer, j + i * 9 + 9, 8 + j * 18, 84 + i * 18 + 2)); this.addSlotToContainer(new Slot(invPlayer, j + i * 9 + 9, 8 + j * 18, 84 + i * 18 + 2));
} }
} }
for(int i = 0; i < 9; i++) for(int i = 0; i < 9; i++) {
{
this.addSlotToContainer(new Slot(invPlayer, i, 8 + i * 18, 142 + 2)); this.addSlotToContainer(new Slot(invPlayer, i, 8 + i * 18, 142 + 2));
} }
} }
@Override @Override
public ItemStack transferStackInSlot(EntityPlayer p_82846_1_, int par2) public ItemStack transferStackInSlot(EntityPlayer p_82846_1_, int par2) {
{
ItemStack var3 = null; ItemStack var3 = null;
Slot var4 = (Slot) this.inventorySlots.get(par2); Slot var4 = (Slot) this.inventorySlots.get(par2);
if (var4 != null && var4.getHasStack()) if(var4 != null && var4.getHasStack()) {
{
ItemStack var5 = var4.getStack(); ItemStack var5 = var4.getStack();
var3 = var5.copy(); var3 = var5.copy();
if (par2 <= diFurnace.getSizeInventory() - 1) { if(par2 <= diFurnace.getSizeInventory() - 1) {
if (!this.mergeItemStack(var5, diFurnace.getSizeInventory(), this.inventorySlots.size(), true)) if(!this.mergeItemStack(var5, diFurnace.getSizeInventory(), this.inventorySlots.size(), true)) {
{
return null; return null;
} }
} } else if(!this.mergeItemStack(var5, 0, diFurnace.getSizeInventory(), false)) {
else if (!this.mergeItemStack(var5, 0, diFurnace.getSizeInventory(), false)) return null;
{
return null;
} }
if (var5.stackSize == 0) if(var5.stackSize == 0) {
{
var4.putStack((ItemStack) null); var4.putStack((ItemStack) null);
} } else {
else
{
var4.onSlotChanged(); var4.onSlotChanged();
} }
} }
return var3; return var3;
} }
@Override @Override
public boolean canInteractWith(EntityPlayer player) { public boolean canInteractWith(EntityPlayer player) {

View File

@ -10,7 +10,6 @@ import com.hbm.inventory.fluid.Fluids;
import com.hbm.items.ModItems; import com.hbm.items.ModItems;
import com.hbm.items.machine.ItemFluidIcon; import com.hbm.items.machine.ItemFluidIcon;
import com.hbm.util.I18nUtil; import com.hbm.util.I18nUtil;
import com.hbm.util.Tuple.Pair;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;

View File

@ -155,7 +155,6 @@ public class ShredderRecipes extends SerializableRecipe {
ShredderRecipes.setRecipe(Blocks.cobblestone, new ItemStack(Blocks.gravel, 1)); ShredderRecipes.setRecipe(Blocks.cobblestone, new ItemStack(Blocks.gravel, 1));
ShredderRecipes.setRecipe(Blocks.stonebrick, new ItemStack(Blocks.gravel, 1)); ShredderRecipes.setRecipe(Blocks.stonebrick, new ItemStack(Blocks.gravel, 1));
ShredderRecipes.setRecipe(Blocks.gravel, new ItemStack(Blocks.sand, 1)); ShredderRecipes.setRecipe(Blocks.gravel, new ItemStack(Blocks.sand, 1));
ShredderRecipes.setRecipe(Blocks.sand, new ItemStack(ModItems.dust, 2));
ShredderRecipes.setRecipe(Blocks.brick_block, new ItemStack(Items.clay_ball, 4)); ShredderRecipes.setRecipe(Blocks.brick_block, new ItemStack(Items.clay_ball, 4));
ShredderRecipes.setRecipe(Blocks.brick_stairs, new ItemStack(Items.clay_ball, 3)); ShredderRecipes.setRecipe(Blocks.brick_stairs, new ItemStack(Items.clay_ball, 3));
ShredderRecipes.setRecipe(Items.flower_pot, new ItemStack(Items.clay_ball, 3)); ShredderRecipes.setRecipe(Items.flower_pot, new ItemStack(Items.clay_ball, 3));
@ -196,6 +195,13 @@ public class ShredderRecipes extends SerializableRecipe {
ShredderRecipes.setRecipe(Items.poisonous_potato, new ItemStack(ModItems.powder_poison, 1)); ShredderRecipes.setRecipe(Items.poisonous_potato, new ItemStack(ModItems.powder_poison, 1));
ShredderRecipes.setRecipe(ModBlocks.ore_tektite_osmiridium, new ItemStack(ModItems.powder_tektite, 1)); ShredderRecipes.setRecipe(ModBlocks.ore_tektite_osmiridium, new ItemStack(ModItems.powder_tektite, 1));
List<ItemStack> silicon = OreDictionary.getOres("itemSilicon");
if(!silicon.isEmpty()) {
ShredderRecipes.setRecipe(Blocks.sand, silicon.get(0).copy());
} else {
ShredderRecipes.setRecipe(Blocks.sand, new ItemStack(ModItems.dust, 2));
}
for(int i = 0; i < 5; i++) ShredderRecipes.setRecipe(new ItemStack(Items.skull, 1, i), new ItemStack(ModItems.biomass)); for(int i = 0; i < 5; i++) ShredderRecipes.setRecipe(new ItemStack(Items.skull, 1, i), new ItemStack(ModItems.biomass));
/* Crystal processing */ /* Crystal processing */

View File

@ -153,11 +153,20 @@ public class ItemRBMKRod extends Item {
double coreHeat = this.getCoreHeat(stack); double coreHeat = this.getCoreHeat(stack);
coreHeat += outFlux * heat; coreHeat += outFlux * heat;
this.setCoreHeat(stack, coreHeat);
this.setCoreHeat(stack, rectify(coreHeat));
return outFlux; return outFlux;
} }
private double rectify(double num) {
if(num > 1_000_000D) num = 1_000_000D;
if(num < 20D || Double.isNaN(num)) num = 20D;
return num;
}
/** /**
* Heat up the core based on the outFlux, then move some heat to the hull * Heat up the core based on the outFlux, then move some heat to the hull
* @param stack * @param stack
@ -174,8 +183,8 @@ public class ItemRBMKRod extends Item {
coreHeat -= mid * this.diffusion * RBMKDials.getFuelDiffusionMod(world) * mod; coreHeat -= mid * this.diffusion * RBMKDials.getFuelDiffusionMod(world) * mod;
hullHeat += mid * this.diffusion * RBMKDials.getFuelDiffusionMod(world) * mod; hullHeat += mid * this.diffusion * RBMKDials.getFuelDiffusionMod(world) * mod;
this.setCoreHeat(stack, coreHeat); this.setCoreHeat(stack, rectify(coreHeat));
this.setHullHeat(stack, hullHeat); this.setHullHeat(stack, rectify(hullHeat));
} }
} }

View File

@ -3,7 +3,7 @@ package com.hbm.lib;
public class RefStrings { public class RefStrings {
public static final String MODID = "hbm"; public static final String MODID = "hbm";
public static final String NAME = "Hbm's Nuclear Tech Mod"; public static final String NAME = "Hbm's Nuclear Tech Mod";
public static final String VERSION = "1.0.27 BETA (4389)"; public static final String VERSION = "1.0.27 BETA (4395)";
//HBM's Beta Naming Convention: //HBM's Beta Naming Convention:
//V T (X) //V T (X)
//V -> next release version //V -> next release version

View File

@ -230,7 +230,7 @@ public class ResourceManager {
//Bombs //Bombs
public static final IModelCustom bomb_gadget = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/TheGadget3.obj")); public static final IModelCustom bomb_gadget = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/TheGadget3.obj"));
public static final IModelCustom bomb_boy = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/LilBoy1.obj")); public static final IModelCustom bomb_boy = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/LilBoy1.obj"));
public static final IModelCustom bomb_man = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/FatMan.obj")); public static final IModelCustom bomb_man = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/FatMan.obj")).asDisplayList();
public static final IModelCustom bomb_mike = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/IvyMike.obj")); public static final IModelCustom bomb_mike = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/IvyMike.obj"));
public static final IModelCustom bomb_tsar = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/TsarBomba.obj")); public static final IModelCustom bomb_tsar = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/TsarBomba.obj"));
public static final IModelCustom bomb_prototype = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/Prototype.obj")); public static final IModelCustom bomb_prototype = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/Prototype.obj"));

View File

@ -442,20 +442,6 @@ public class ItemRenderLibrary {
ResourceManager.bomb_boy.renderAll(); ResourceManager.bomb_boy.renderAll();
}}); }});
renderers.put(Item.getItemFromBlock(ModBlocks.nuke_man), new ItemRenderBase() {
public void renderInventory() {
GL11.glTranslated(0, -2, 0);
GL11.glScaled(5.5, 5.5, 5.5);
}
public void renderCommon() {
GL11.glRotated(180, 0, 1, 0);
GL11.glTranslated(-0.75, 0, 0);
GL11.glDisable(GL11.GL_CULL_FACE);
bindTexture(ResourceManager.bomb_man_tex);
ResourceManager.bomb_man.renderAll();
GL11.glEnable(GL11.GL_CULL_FACE);
}});
renderers.put(Item.getItemFromBlock(ModBlocks.nuke_mike), new ItemRenderBase() { renderers.put(Item.getItemFromBlock(ModBlocks.nuke_mike), new ItemRenderBase() {
public void renderInventory() { public void renderInventory() {
GL11.glTranslated(0, -5, 0); GL11.glTranslated(0, -5, 0);

View File

@ -2,38 +2,64 @@ package com.hbm.render.tileentity;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
import com.hbm.blocks.ModBlocks;
import com.hbm.main.ResourceManager; import com.hbm.main.ResourceManager;
import com.hbm.render.item.ItemRenderBase;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.item.Item;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.client.IItemRenderer;
public class RenderNukeMan extends TileEntitySpecialRenderer { public class RenderNukeMan extends TileEntitySpecialRenderer implements IItemRendererProvider {
@Override @Override
public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float f) public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float f) {
{ GL11.glPushMatrix();
GL11.glPushMatrix(); GL11.glTranslated(x + 0.5D, y, z + 0.5D);
GL11.glTranslated(x + 0.5D, y, z + 0.5D); GL11.glEnable(GL11.GL_LIGHTING);
GL11.glEnable(GL11.GL_LIGHTING); GL11.glDisable(GL11.GL_CULL_FACE);
GL11.glDisable(GL11.GL_CULL_FACE); switch(tileEntity.getBlockMetadata()) {
switch(tileEntity.getBlockMetadata()) case 3: GL11.glRotatef(90, 0F, 1F, 0F); break;
{ case 5: GL11.glRotatef(180, 0F, 1F, 0F); break;
case 3: case 2: GL11.glRotatef(270, 0F, 1F, 0F); break;
GL11.glRotatef(90, 0F, 1F, 0F); break; case 4: GL11.glRotatef(0, 0F, 1F, 0F); break;
case 5:
GL11.glRotatef(180, 0F, 1F, 0F); break;
case 2:
GL11.glRotatef(270, 0F, 1F, 0F); break;
case 4:
GL11.glRotatef(0, 0F, 1F, 0F); break;
} }
bindTexture(ResourceManager.bomb_man_tex); GL11.glShadeModel(GL11.GL_SMOOTH);
ResourceManager.bomb_man.renderAll(); bindTexture(ResourceManager.bomb_man_tex);
ResourceManager.bomb_man.renderAll();
GL11.glShadeModel(GL11.GL_FLAT);
GL11.glEnable(GL11.GL_CULL_FACE); GL11.glEnable(GL11.GL_CULL_FACE);
GL11.glPopMatrix(); GL11.glPopMatrix();
} }
@Override
public Item getItemForRenderer() {
return Item.getItemFromBlock(ModBlocks.nuke_man);
}
@Override
public IItemRenderer getRenderer() {
return new ItemRenderBase() {
public void renderInventory() {
GL11.glTranslated(0, -2, 0);
GL11.glScaled(5, 5, 5);
}
public void renderCommon() {
GL11.glRotated(180, 0, 1, 0);
GL11.glTranslated(-0.75, 0, 0);
GL11.glShadeModel(GL11.GL_SMOOTH);
GL11.glDisable(GL11.GL_CULL_FACE);
bindTexture(ResourceManager.bomb_man_tex);
ResourceManager.bomb_man.renderAll();
GL11.glEnable(GL11.GL_CULL_FACE);
GL11.glShadeModel(GL11.GL_FLAT);
}
};
}
} }

View File

@ -46,10 +46,11 @@ public class TileEntityCore extends TileEntityMachineBase {
if(!worldObj.isRemote) { if(!worldObj.isRemote) {
int chunkX = xCoord << 4; int chunkX = xCoord >> 4;
int chunkZ = zCoord << 4; int chunkZ = zCoord >> 4;
lastTickValid = worldObj.getChunkProvider().chunkExists(chunkX + 1, chunkZ + 1) && lastTickValid = worldObj.getChunkProvider().chunkExists(chunkX, chunkZ) &&
worldObj.getChunkProvider().chunkExists(chunkX + 1, chunkZ + 1) &&
worldObj.getChunkProvider().chunkExists(chunkX + 1, chunkZ - 1) && worldObj.getChunkProvider().chunkExists(chunkX + 1, chunkZ - 1) &&
worldObj.getChunkProvider().chunkExists(chunkX - 1, chunkZ + 1) && worldObj.getChunkProvider().chunkExists(chunkX - 1, chunkZ + 1) &&
worldObj.getChunkProvider().chunkExists(chunkX - 1, chunkZ - 1); worldObj.getChunkProvider().chunkExists(chunkX - 1, chunkZ - 1);

View File

@ -46,7 +46,7 @@ public class TileEntityRBMKHeater extends TileEntityRBMKSlottedBase implements I
double heatCap = this.getConversionHeat(feed.getTankType()); double heatCap = this.getConversionHeat(feed.getTankType());
double heatProvided = this.heat - heatCap; double heatProvided = this.heat - heatCap;
if(heatProvided > 0) { if(heatProvided > 0 && steam.getTankType() != Fluids.NONE) {
double capacity = feed.getTankType().heatCap; double capacity = feed.getTankType().heatCap;
int converted = (int)Math.floor(heatProvided / capacity); int converted = (int)Math.floor(heatProvided / capacity);

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 321 B

After

Width:  |  Height:  |  Size: 521 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 7.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

View File

@ -3,7 +3,7 @@
"modid": "hbm", "modid": "hbm",
"name": "Hbm's Nuclear Tech", "name": "Hbm's Nuclear Tech",
"description": "A mod that adds weapons, nuclear themed stuff and machines", "description": "A mod that adds weapons, nuclear themed stuff and machines",
"version":"1.0.27_X4389", "version":"1.0.27_X4395",
"mcversion": "1.7.10", "mcversion": "1.7.10",
"url": "", "url": "",
"updateUrl": "", "updateUrl": "",