soot fog, hostile mob buffs, tiny mass storage, comparator output

This commit is contained in:
Boblet 2023-06-06 15:26:36 +02:00
parent 72078d6b03
commit 32ae24823a
18 changed files with 210 additions and 28 deletions

View File

@ -31,7 +31,6 @@ import com.hbm.tileentity.machine.storage.TileEntityFileCabinet;
import cpw.mods.fml.common.registry.GameRegistry;
import net.minecraft.block.Block;
import net.minecraft.block.BlockFalling;
import net.minecraft.block.BlockPane;
import net.minecraft.block.material.*;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.ItemBlock;
@ -1510,13 +1509,13 @@ public class ModBlocks {
reinforced_brick = new BlockGeneric(Material.rock).setBlockName("reinforced_brick").setCreativeTab(MainRegistry.blockTab).setHardness(15.0F).setResistance(8000.0F).setBlockTextureName(RefStrings.MODID + ":reinforced_brick");
reinforced_glass = new BlockNTMGlassCT(0, RefStrings.MODID + ":reinforced_glass", Material.rock).setBlockName("reinforced_glass").setCreativeTab(MainRegistry.blockTab).setLightOpacity(0).setHardness(15.0F).setResistance(200.0F);
reinforced_glass_pane = new BlockNTMGlassPane(1, RefStrings.MODID + ":reinforced_glass_pane",RefStrings.MODID + ":reinforced_glass_pane_edge", Material.rock, false).setBlockName("reinforced_glass_pane").setCreativeTab(MainRegistry.blockTab).setLightOpacity(1).setHardness(15.0F).setResistance(200.0F);
reinforced_glass_pane = new BlockNTMGlassPane(0, RefStrings.MODID + ":reinforced_glass_pane", RefStrings.MODID + ":reinforced_glass_pane_edge", Material.rock, false).setBlockName("reinforced_glass_pane").setCreativeTab(MainRegistry.blockTab).setLightOpacity(1).setHardness(15.0F).setResistance(200.0F);
reinforced_light = new BlockGeneric(Material.rock).setBlockName("reinforced_light").setCreativeTab(MainRegistry.blockTab).setLightLevel(1.0F).setHardness(15.0F).setResistance(300.0F).setBlockTextureName(RefStrings.MODID + ":reinforced_light");
reinforced_sand = new BlockGeneric(Material.rock).setBlockName("reinforced_sand").setCreativeTab(MainRegistry.blockTab).setHardness(15.0F).setResistance(400.0F).setBlockTextureName(RefStrings.MODID + ":reinforced_sand");
reinforced_lamp_off = new ReinforcedLamp(Material.rock, false).setBlockName("reinforced_lamp_off").setCreativeTab(MainRegistry.blockTab).setHardness(15.0F).setResistance(300.0F).setBlockTextureName(RefStrings.MODID + ":reinforced_lamp_off");
reinforced_lamp_on = new ReinforcedLamp(Material.rock, true).setBlockName("reinforced_lamp_on").setHardness(15.0F).setResistance(300.0F).setBlockTextureName(RefStrings.MODID + ":reinforced_lamp_on");
reinforced_laminate = new BlockNTMGlassCT(1, RefStrings.MODID + ":reinforced_laminate", Material.rock).setBlockName("reinforced_laminate").setCreativeTab(MainRegistry.blockTab).setLightOpacity(0).setHardness(15.0F).setResistance(1000.0F);
reinforced_laminate_pane = new BlockNTMGlassPane(1, RefStrings.MODID + ":reinforced_laminate_pane",RefStrings.MODID + ":reinforced_laminate_pane_edge", Material.rock, false).setBlockName("reinforced_laminate_pane").setCreativeTab(MainRegistry.blockTab).setLightOpacity(1).setHardness(15.0F).setResistance(1000.0F);
reinforced_laminate = new BlockNTMGlassCT(1, RefStrings.MODID + ":reinforced_laminate", Material.rock, true).setBlockName("reinforced_laminate").setCreativeTab(MainRegistry.blockTab).setLightOpacity(0).setHardness(15.0F).setResistance(1000.0F);
reinforced_laminate_pane = new BlockNTMGlassPane(1, RefStrings.MODID + ":reinforced_laminate_pane", RefStrings.MODID + ":reinforced_laminate_pane_edge", Material.rock, true).setBlockName("reinforced_laminate_pane").setCreativeTab(MainRegistry.blockTab).setLightOpacity(1).setHardness(15.0F).setResistance(1000.0F);
lamp_tritium_green_off = new ReinforcedLamp(Material.redstoneLight, false).setBlockName("lamp_tritium_green_off").setStepSound(Block.soundTypeGlass).setCreativeTab(MainRegistry.blockTab).setHardness(3.0F).setBlockTextureName(RefStrings.MODID + ":lamp_tritium_green_off");
lamp_tritium_green_on = new ReinforcedLamp(Material.redstoneLight, true).setBlockName("lamp_tritium_green_on").setStepSound(Block.soundTypeGlass).setHardness(3.0F).setBlockTextureName(RefStrings.MODID + ":lamp_tritium_green_on");

View File

@ -22,19 +22,23 @@ public class BlockNTMGlass extends BlockBreakable {
this.doesDrop = doesDrop;
}
@Override
public int quantityDropped(Random rand) {
return doesDrop ? 1 : 0;
}
@Override
@SideOnly(Side.CLIENT)
public int getRenderBlockPass() {
return renderLayer;
}
@Override
public boolean renderAsNormalBlock() {
return false;
}
@Override
protected boolean canSilkHarvest() {
return true;
}

View File

@ -1,5 +1,10 @@
package com.hbm.blocks.generic;
import java.util.Random;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.block.BlockPane;
import net.minecraft.block.material.Material;
import net.minecraft.world.IBlockAccess;
@ -25,21 +30,23 @@ public class BlockNTMGlassPane extends BlockPane
this.doesDrop = doesDrop;
this.opaque = true;
this.setLightOpacity(1);
}
public boolean canPaneConnectTo(IBlockAccess world, int x, int y, int z, ForgeDirection dir)
{
if (getIdFromBlock(world.getBlock(x,y,z)) == 0)
return false;
else
return true;
/*return canPaneConnectToBlock(world.getBlock(x, y, z)) ||
world.isSideSolid(x, y, z, dir.getOpposite(), false);*/
}
@Override
public boolean canPaneConnectTo(IBlockAccess world, int x, int y, int z, ForgeDirection dir) {
Block b = world.getBlock(x, y, z);
return super.canPaneConnectTo(world, x, y, z, dir) || b instanceof BlockNTMGlass;
}
@Override
@SideOnly(Side.CLIENT)
public int getRenderBlockPass() {
return renderLayer;
}
@Override
public int quantityDropped(Random rand) {
return doesDrop ? 1 : 0;
}
}

View File

@ -47,8 +47,8 @@ public class BlockMassStorage extends BlockContainer implements IBlockMulti, ILo
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconRegister) {
this.iconTop = new IIcon[3];
this.iconSide = new IIcon[3];
this.iconTop = new IIcon[4];
this.iconSide = new IIcon[4];
this.iconTop[0] = iconRegister.registerIcon(RefStrings.MODID + ":mass_storage_top_iron");
this.iconSide[0] = iconRegister.registerIcon(RefStrings.MODID + ":mass_storage_side_iron");
@ -56,14 +56,17 @@ public class BlockMassStorage extends BlockContainer implements IBlockMulti, ILo
this.iconSide[1] = iconRegister.registerIcon(RefStrings.MODID + ":mass_storage_side_desh");
this.iconTop[2] = iconRegister.registerIcon(RefStrings.MODID + ":mass_storage_top");
this.iconSide[2] = iconRegister.registerIcon(RefStrings.MODID + ":mass_storage_side");
this.iconTop[2] = iconRegister.registerIcon(RefStrings.MODID + ":mass_storage_top_wood");
this.iconSide[2] = iconRegister.registerIcon(RefStrings.MODID + ":mass_storage_side_wood");
}
@Override
@SideOnly(Side.CLIENT)
public void getSubBlocks(Item item, CreativeTabs tab, List list) {
for(int i = 0; i < getSubCount(); ++i) {
list.add(new ItemStack(item, 1, i));
}
list.add(new ItemStack(item, 1, 3));
list.add(new ItemStack(item, 1, 0));
list.add(new ItemStack(item, 1, 1));
list.add(new ItemStack(item, 1, 2));
}
@Override
@ -84,7 +87,7 @@ public class BlockMassStorage extends BlockContainer implements IBlockMulti, ILo
}
public int getCapacity(int meta) {
return meta == 0 ? 10_000 : meta == 1 ? 100_000 : meta == 2 ? 1_000_000 : 0;
return meta == 3 ? 100 : meta == 0 ? 10_000 : meta == 1 ? 100_000 : meta == 2 ? 1_000_000 : 0;
}
@Override
@ -286,4 +289,14 @@ public class BlockMassStorage extends BlockContainer implements IBlockMulti, ILo
list.add(String.format("%,d", stack.stackTagCompound.getInteger("stack")) + " / " + String.format("%,d", getCapacity(stack.getItemDamage())));
}
}
@Override
public boolean hasComparatorInputOverride() {
return true;
}
@Override
public int getComparatorInputOverride(World world, int x, int y, int z, int side) {
return ((TileEntityMassStorage) world.getTileEntity(x, y, z)).redstone;
}
}

View File

@ -11,6 +11,10 @@ import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.gameevent.TickEvent;
import cpw.mods.fml.common.gameevent.TickEvent.Phase;
import cpw.mods.fml.relauncher.Side;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.ai.attributes.AttributeModifier;
import net.minecraft.entity.monster.IMob;
import net.minecraft.nbt.CompressedStreamTools;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
@ -18,6 +22,7 @@ import net.minecraft.util.MathHelper;
import net.minecraft.world.ChunkCoordIntPair;
import net.minecraft.world.World;
import net.minecraft.world.WorldServer;
import net.minecraftforge.event.entity.living.LivingSpawnEvent;
import net.minecraftforge.event.world.WorldEvent;
public class PollutionHandler {
@ -25,6 +30,9 @@ public class PollutionHandler {
public static final String fileName = "hbmpollution.dat";
public static HashMap<World, PollutionPerWorld> perWorld = new HashMap();
/** Baserate of soot generation for a furnace-equivalent machine per second */
public static final float SOOT_PER_SECOND = 1F / 25F;
///////////////////////
/// UTILITY METHODS ///
///////////////////////
@ -145,8 +153,52 @@ public class PollutionHandler {
eggTimer++;
if(eggTimer < 60) return;
eggTimer = 0;
// TBI
for(Entry<World, PollutionPerWorld> entry : perWorld.entrySet()) {
HashMap<ChunkCoordIntPair, PollutionData> newPollution = new HashMap();
for(Entry<ChunkCoordIntPair, PollutionData> chunk : entry.getValue().pollution.entrySet()) {
int x = chunk.getKey().chunkXPos;
int z = chunk.getKey().chunkZPos;
PollutionData data = chunk.getValue();
float[] pollutionForNeightbors = new float[PollutionType.values().length];
int S = PollutionType.SOOT.ordinal();
int H = PollutionType.HEAVYMETAL.ordinal();
/* CALCULATION */
if(data.pollution[S] > 15) {
pollutionForNeightbors[S] = data.pollution[S] * 0.05F;
data.pollution[S] *= 0.8F;
} else {
data.pollution[S] *= 0.99F;
}
data.pollution[H] *= 0.999F;
/* SPREADING */
//apply new data to self
PollutionData newData = newPollution.get(chunk.getKey());
if(newData == null) newData = new PollutionData();
for(int i = 0; i < newData.pollution.length; i++) newData.pollution[i] += data.pollution[i];
newPollution.put(chunk.getKey(), newData);
//apply neighbor data to neighboring chunks
int[][] offsets = new int[][] {{1, 0}, {-1, 0}, {0, 1}, {0, -1}};
for(int[] offset : offsets) {
ChunkCoordIntPair offPos = new ChunkCoordIntPair(x + offset[0], z + offset[1]);
PollutionData offsetData = newPollution.get(offPos);
if(offsetData == null) offsetData = new PollutionData();
for(int i = 0; i < offsetData.pollution.length; i++) offsetData.pollution[i] += pollutionForNeightbors[i];
newPollution.put(offPos, offsetData);
}
}
entry.getValue().pollution = newPollution;
}
}
}
@ -213,4 +265,28 @@ public class PollutionHandler {
public static enum PollutionType {
SOOT, POISON, HEAVYMETAL, FALLOUT;
}
///////////////////
/// MOB EFFECTS ///
///////////////////
@SubscribeEvent
public void decorateMob(LivingSpawnEvent event) {
World world = event.world;
if(world.isRemote) return;
EntityLivingBase living = event.entityLiving;
PollutionData data = getPollutionData(world, (int) Math.floor(event.x), (int) Math.floor(event.y), (int) Math.floor(event.z));
if(data == null) return;
if(living instanceof IMob) {
if(data.pollution[PollutionType.SOOT.ordinal()] > 15) {
if(living.getEntityAttribute(SharedMonsterAttributes.maxHealth) != null) living.getEntityAttribute(SharedMonsterAttributes.maxHealth).applyModifier(new AttributeModifier("Soot Anger Health Increase", 2D, 1));
if(living.getEntityAttribute(SharedMonsterAttributes.attackDamage) != null) living.getEntityAttribute(SharedMonsterAttributes.attackDamage).applyModifier(new AttributeModifier("Soot Anger Damage Increase", 1.5D, 1));
}
}
}
}

View File

@ -295,6 +295,7 @@ public class CraftingManager {
addRecipeAuto(new ItemStack(ModBlocks.mass_storage, 1, 0), new Object[] { "ICI", "CLC", "ICI", 'I', TI.ingot(), 'C', ModBlocks.crate_steel, 'L', ModItems.circuit_copper });
addRecipeAuto(new ItemStack(ModBlocks.mass_storage, 1, 1), new Object[] { "PCP", "PMP", "PPP", 'P', DESH.ingot(), 'C', ModItems.circuit_red_copper, 'M', new ItemStack(ModBlocks.mass_storage, 1, 0) });
addRecipeAuto(new ItemStack(ModBlocks.mass_storage, 1, 2), new Object[] { "PCP", "PMP", "PPP", 'P', ANY_RESISTANTALLOY.ingot(), 'C', ModItems.circuit_gold, 'M', new ItemStack(ModBlocks.mass_storage, 1, 1) });
addRecipeAuto(new ItemStack(ModBlocks.mass_storage, 1, 2), new Object[] { "PPP", "PIP", "PPP", 'P', KEY_PLANKS, 'I', IRON.plate() });
addRecipeAuto(new ItemStack(ModBlocks.machine_autocrafter, 1), new Object[] { "SCS", "MWM", "SCS", 'S', STEEL.plate(), 'C', ModItems.circuit_copper, 'M', ModItems.motor, 'W', Blocks.crafting_table });
addRecipeAuto(new ItemStack(ModBlocks.machine_waste_drum, 1), new Object[] { "LRL", "BRB", "LRL", 'L', PB.ingot(), 'B', Blocks.iron_bars, 'R', ModItems.rod_quad_empty });
addRecipeAuto(new ItemStack(ModBlocks.machine_press, 1), new Object[] { "IRI", "IPI", "IBI", 'I', IRON.ingot(), 'R', Blocks.furnace, 'B', IRON.block(), 'P', Blocks.piston });

View File

@ -905,9 +905,9 @@ public class MainRegistry {
MinecraftForge.EVENT_BUS.register(radiationSystem);
FMLCommonHandler.instance().bus().register(radiationSystem);
/*PollutionHandler pollution = new PollutionHandler();
PollutionHandler pollution = new PollutionHandler();
MinecraftForge.EVENT_BUS.register(pollution);
FMLCommonHandler.instance().bus().register(pollution);*/
FMLCommonHandler.instance().bus().register(pollution);
if(event.getSide() == Side.CLIENT) {
HbmKeybinds.register();

View File

@ -3,14 +3,17 @@ package com.hbm.main;
import org.lwjgl.opengl.GL11;
import com.hbm.blocks.ICustomBlockHighlight;
import com.hbm.handler.pollution.PollutionHandler.PollutionType;
import com.hbm.items.armor.IArmorDisableModel;
import com.hbm.items.armor.IArmorDisableModel.EnumPlayerPart;
import com.hbm.packet.PermaSyncHandler;
import com.hbm.render.model.ModelMan;
import cpw.mods.fml.common.eventhandler.Event.Result;
import cpw.mods.fml.common.eventhandler.EventPriority;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import net.minecraft.block.Block;
import net.minecraft.client.Minecraft;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.client.renderer.entity.RenderManager;
@ -23,6 +26,9 @@ import net.minecraft.item.ItemStack;
import net.minecraft.util.MathHelper;
import net.minecraft.util.MovingObjectPosition;
import net.minecraftforge.client.event.DrawBlockHighlightEvent;
import net.minecraftforge.client.event.EntityViewRenderEvent.FogColors;
import net.minecraftforge.client.event.EntityViewRenderEvent.FogDensity;
import net.minecraftforge.client.event.EntityViewRenderEvent.RenderFogEvent;
import net.minecraftforge.client.event.RenderPlayerEvent;
public class ModEventHandlerRenderer {
@ -318,4 +324,30 @@ public class ModEventHandlerRenderer {
GL11.glPopMatrix();
}
}*/
@SubscribeEvent
public void setupFog(RenderFogEvent event) {
}
@SubscribeEvent(priority = EventPriority.LOW)
public void thickenFog(FogDensity event) {
float soot = PermaSyncHandler.pollution[PollutionType.SOOT.ordinal()];
if(soot > 10) {
//event.density = Math.min((soot - 5) * 0.01F, 0.5F);
GL11.glFogf(GL11.GL_FOG_START, 0.0F);
float farPlaneDistance = (float) (Minecraft.getMinecraft().gameSettings.renderDistanceChunks * 16);
GL11.glFogf(GL11.GL_FOG_END, Math.max(farPlaneDistance * 0.8F / (soot * 0.05F), 5F));
event.setCanceled(true);
}
}
@SubscribeEvent(priority = EventPriority.LOW)
public void tintFog(FogColors event) {
float soot = PermaSyncHandler.pollution[PollutionType.SOOT.ordinal()];
if(soot > 10) {
event.red = 0.15F;
event.green = 0.15F;
event.blue = 0.15F;
}
}
}

View File

@ -5,6 +5,9 @@ import java.util.HashSet;
import java.util.List;
import com.hbm.handler.ImpactWorldHandler;
import com.hbm.handler.pollution.PollutionHandler;
import com.hbm.handler.pollution.PollutionHandler.PollutionData;
import com.hbm.handler.pollution.PollutionHandler.PollutionType;
import com.hbm.potion.HbmPotion;
import com.hbm.saveddata.TomSaveData;
@ -21,6 +24,7 @@ import net.minecraft.world.World;
public class PermaSyncHandler {
public static HashSet<Integer> boykissers = new HashSet();
public static float[] pollution = new float[PollutionType.values().length];
public static void writePacket(ByteBuf buf, World world, EntityPlayerMP player) {
@ -42,6 +46,14 @@ public class PermaSyncHandler {
buf.writeShort((short) ids.size());
for(Integer i : ids) buf.writeInt(i);
/// SHITTY MEMES ///
/// POLLUTION ///
PollutionData pollution = PollutionHandler.getPollutionData(world, (int) Math.floor(player.posX), (int) Math.floor(player.posY), (int) Math.floor(player.posZ));
if(pollution == null) pollution = new PollutionData();
for(int i = 0; i < PollutionType.values().length; i++) {
buf.writeFloat(pollution.pollution[i]);
}
/// POLLUTION ///
}
public static void readPacket(ByteBuf buf, World world, EntityPlayer player) {
@ -58,5 +70,11 @@ public class PermaSyncHandler {
int ids = buf.readShort();
for(int i = 0; i < ids; i++) boykissers.add(buf.readInt());
/// SHITTY MEMES ///
/// POLLUTION ///
for(int i = 0; i < PollutionType.values().length; i++) {
pollution[i] = buf.readFloat();
}
/// POLLUTION ///
}
}

View File

@ -2,6 +2,8 @@ package com.hbm.tileentity.machine;
import java.util.List;
import com.hbm.handler.pollution.PollutionHandler;
import com.hbm.handler.pollution.PollutionHandler.PollutionType;
import com.hbm.inventory.FluidStack;
import com.hbm.inventory.container.ContainerFurnaceCombo;
import com.hbm.inventory.fluid.Fluids;
@ -119,6 +121,8 @@ public class TileEntityFurnaceCombination extends TileEntityMachineBase implemen
if(worldObj.getTotalWorldTime() % 10 == 0) this.worldObj.playSoundEffect(this.xCoord, this.yCoord + 1, this.zCoord, "hbm:weapon.flamethrowerShoot", 0.25F, 0.5F);
}
if(worldObj.getTotalWorldTime() % 20 == 0) PollutionHandler.incrementPollution(worldObj, xCoord, yCoord, zCoord, PollutionType.SOOT, PollutionHandler.SOOT_PER_SECOND * 3);
} else {
this.progress = 0;
}

View File

@ -1,5 +1,7 @@
package com.hbm.tileentity.machine;
import com.hbm.handler.pollution.PollutionHandler;
import com.hbm.handler.pollution.PollutionHandler.PollutionType;
import com.hbm.inventory.UpgradeManager;
import com.hbm.inventory.container.ContainerFurnaceIron;
import com.hbm.inventory.gui.GUIFurnaceIron;
@ -104,6 +106,7 @@ public class TileEntityFurnaceIron extends TileEntityMachineBase implements IGUI
this.progress = 0;
this.markDirty();
}
if(worldObj.getTotalWorldTime() % 20 == 0) PollutionHandler.incrementPollution(worldObj, xCoord, yCoord, zCoord, PollutionType.SOOT, PollutionHandler.SOOT_PER_SECOND);
} else {
this.progress = 0;
}

View File

@ -2,6 +2,8 @@ package com.hbm.tileentity.machine;
import java.util.List;
import com.hbm.handler.pollution.PollutionHandler;
import com.hbm.handler.pollution.PollutionHandler.PollutionType;
import com.hbm.inventory.container.ContainerFurnaceSteel;
import com.hbm.inventory.gui.GUIFurnaceSteel;
import com.hbm.tileentity.IGUIProvider;
@ -67,6 +69,7 @@ public class TileEntityFurnaceSteel extends TileEntityMachineBase implements IGU
progress[i] += burn;
this.heat -= burn;
this.wasOn = true;
if(worldObj.getTotalWorldTime() % 20 == 0) PollutionHandler.incrementPollution(worldObj, xCoord, yCoord, zCoord, PollutionType.SOOT, PollutionHandler.SOOT_PER_SECOND * 2);
}
lastItems[i] = slots[i];

View File

@ -1,5 +1,7 @@
package com.hbm.tileentity.machine.oil;
import com.hbm.handler.pollution.PollutionHandler;
import com.hbm.handler.pollution.PollutionHandler.PollutionType;
import com.hbm.inventory.FluidStack;
import com.hbm.inventory.container.ContainerMachineCoker;
import com.hbm.inventory.fluid.Fluids;
@ -98,6 +100,8 @@ public class TileEntityMachineCoker extends TileEntityMachineBase implements IFl
tanks[0].setFill(tanks[0].getFill() - fillReq);
}
}
if(worldObj.getTotalWorldTime() % 20 == 0) PollutionHandler.incrementPollution(worldObj, xCoord, yCoord, zCoord, PollutionType.SOOT, PollutionHandler.SOOT_PER_SECOND * 20);
}
for(DirPos pos : getConPos()) {

View File

@ -2,6 +2,8 @@ package com.hbm.tileentity.machine.oil;
import java.util.List;
import com.hbm.handler.pollution.PollutionHandler;
import com.hbm.handler.pollution.PollutionHandler.PollutionType;
import com.hbm.interfaces.IControlReceiver;
import com.hbm.interfaces.IFluidAcceptor;
import com.hbm.interfaces.IFluidContainer;
@ -157,6 +159,8 @@ public class TileEntityMachineGasFlare extends TileEntityMachineBase implements
if(worldObj.getTotalWorldTime() % 3 == 0)
this.worldObj.playSoundEffect(this.xCoord, this.yCoord + 11, this.zCoord, "hbm:weapon.flamethrowerShoot", 1.5F, 0.75F);
if(worldObj.getTotalWorldTime() % 20 == 0) PollutionHandler.incrementPollution(worldObj, xCoord, yCoord, zCoord, PollutionType.SOOT, PollutionHandler.SOOT_PER_SECOND * 5);
}
}
}

View File

@ -7,6 +7,8 @@ import java.util.Random;
import com.hbm.blocks.BlockDummyable;
import com.hbm.blocks.ModBlocks;
import com.hbm.handler.MultiblockHandlerXR;
import com.hbm.handler.pollution.PollutionHandler;
import com.hbm.handler.pollution.PollutionHandler.PollutionType;
import com.hbm.interfaces.IControlReceiver;
import com.hbm.interfaces.IFluidAcceptor;
import com.hbm.interfaces.IFluidContainer;
@ -319,6 +321,8 @@ public class TileEntityMachineRefinery extends TileEntityMachineBase implements
this.markDirty();
}
if(worldObj.getTotalWorldTime() % 20 == 0) PollutionHandler.incrementPollution(worldObj, xCoord, yCoord, zCoord, PollutionType.SOOT, PollutionHandler.SOOT_PER_SECOND * 5);
this.power -= 5;
}

View File

@ -21,6 +21,7 @@ public class TileEntityMassStorage extends TileEntityCrateBase implements INBTPa
private int stack = 0;
public boolean output = false;
private int capacity;
public int redstone = 0;
@SideOnly(Side.CLIENT) public ItemStack type;
@ -43,6 +44,13 @@ public class TileEntityMassStorage extends TileEntityCrateBase implements INBTPa
if(!worldObj.isRemote) {
int newRed = this.getStockpile() * 15 / this.capacity;
if(newRed != this.redstone) {
this.redstone = newRed;
this.markDirty();
}
if(slots[0] != null && slots[0].getItem() == ModItems.fluid_barrel_infinite) {
this.stack = this.getCapacity();
}
@ -132,6 +140,7 @@ public class TileEntityMassStorage extends TileEntityCrateBase implements INBTPa
this.stack = nbt.getInteger("stack");
this.output = nbt.getBoolean("output");
this.capacity = nbt.getInteger("capacity");
this.redstone = nbt.getByte("redstone");
if(this.capacity <= 0) {
this.capacity = 10_000;
@ -144,6 +153,7 @@ public class TileEntityMassStorage extends TileEntityCrateBase implements INBTPa
nbt.setInteger("stack", stack);
nbt.setBoolean("output", output);
nbt.setInteger("capacity", capacity);
nbt.setByte("redstone", (byte) redstone);
}
@Override

Binary file not shown.

After

Width:  |  Height:  |  Size: 526 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 545 B