mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
conveyor press, fixes
This commit is contained in:
parent
96c1986ae9
commit
db288d06c7
21
changelog
21
changelog
@ -1,3 +1,11 @@
|
||||
## Added
|
||||
* Conveyor press
|
||||
* An upgraded version of the electric press that can be integrated directly into conveyor belts
|
||||
* Each pressing operation will process however many items happen to be at the belt at the time, so given enough conveyor infrastructure it can be much faster than a normal electric press
|
||||
* Has no GUI, stamps are installed either by hand or via automation
|
||||
* Stamps can be removed with a screwdriver
|
||||
* Can only stamp single items to avoid issues with stack limits, so it's best to use ejection speed instead of stack ejection upgrades for the conveyor ejectors
|
||||
|
||||
## Changed
|
||||
* Chlorophyte rounds now deal 2x more damage than their standard counterparts instead of 1.5x
|
||||
* Chlorophyte rounds now penetrate multiple enemies
|
||||
@ -10,7 +18,18 @@
|
||||
* 5mm assemblies now yield 64 instead of 32 bullets
|
||||
* The production complexity and time for making thermoelectric elements in the assembler has been reduced
|
||||
* Thermoelectric elements can now also be made in a tier 2 anvil
|
||||
* Changed electric press recipe, crafting complexity has been reduced and the press now uses hydraulic pistons
|
||||
* Removed DFC emitter beam cap again since the core already imposes a natural limit due to fuel consumption
|
||||
* I don't know why anyone would need a DFC that strong anyway, but now you can have them again
|
||||
|
||||
## Fixed
|
||||
* Fixed logspam when pollution handler tries to save the pollution data for dimensions that have never been loaded before
|
||||
* Fixed dead leaves layer not being replacable by other blocks
|
||||
* Fixed dead leaves layer not being replacable by other blocks
|
||||
* Fixed rock layers like schist, hematite and sulfur caves not spawning at all
|
||||
* Fixed rock layers replacing end portal frames or bedrock
|
||||
* Fixed FEnSU instantly voiding all energy when sending
|
||||
* Fixed some conflict causing the nuke flash to be applied permanently
|
||||
* Fixed flux level not resetting when rods are above melting point with meltdowns disabled
|
||||
* Fixed crash caused by express delivery shells
|
||||
* Fixed 4 gauge solid steel slugs not being made from steel
|
||||
* Fixed missing lang entry for fluorite ore
|
||||
@ -1050,6 +1050,7 @@ public class ModBlocks {
|
||||
public static Block press_preheater;
|
||||
public static Block machine_press;
|
||||
public static Block machine_epress;
|
||||
public static Block machine_conveyor_press;
|
||||
|
||||
public static Block machine_siren;
|
||||
|
||||
@ -2265,6 +2266,7 @@ public class ModBlocks {
|
||||
press_preheater = new BlockBase(Material.iron).setBlockName("press_preheater").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":press_preheater");
|
||||
machine_press = new MachinePress(Material.iron).setBlockName("machine_press").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":machine_press");
|
||||
machine_epress = new MachineEPress(Material.iron).setBlockName("machine_epress").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":machine_epress");
|
||||
machine_conveyor_press = new MachineConveyorPress(Material.iron).setBlockName("machine_conveyor_press").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
machine_selenium = new MachineSeleniumEngine(Material.iron).setBlockName("machine_selenium").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":machine_selenium");
|
||||
reactor_research = new ReactorResearch(Material.iron).setBlockName("machine_reactor_small").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":machine_reactor_small");
|
||||
reactor_zirnox = new ReactorZirnox(Material.iron).setBlockName("machine_zirnox").setHardness(5.0F).setResistance(100.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
@ -3084,6 +3086,7 @@ public class ModBlocks {
|
||||
GameRegistry.registerBlock(press_preheater, press_preheater.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_press, machine_press.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_epress, machine_epress.getUnlocalizedName());
|
||||
register(machine_conveyor_press);
|
||||
register(heater_firebox);
|
||||
register(heater_oven);
|
||||
register(machine_ashpit);
|
||||
|
||||
173
src/main/java/com/hbm/blocks/machine/MachineConveyorPress.java
Normal file
173
src/main/java/com/hbm/blocks/machine/MachineConveyorPress.java
Normal file
@ -0,0 +1,173 @@
|
||||
package com.hbm.blocks.machine;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.blocks.ILookOverlay;
|
||||
import com.hbm.blocks.ITooltipProvider;
|
||||
import com.hbm.items.machine.ItemStamp;
|
||||
import com.hbm.tileentity.machine.TileEntityConveyorPress;
|
||||
import com.hbm.util.BobMathUtil;
|
||||
import com.hbm.util.I18nUtil;
|
||||
|
||||
import api.hbm.block.IToolable;
|
||||
import api.hbm.conveyor.IConveyorBelt;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.event.RenderGameOverlayEvent.Pre;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class MachineConveyorPress extends BlockDummyable implements IConveyorBelt, ILookOverlay, IToolable, ITooltipProvider {
|
||||
|
||||
public MachineConveyorPress(Material mat) {
|
||||
super(mat);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
if(meta >= 12) return new TileEntityConveyorPress();
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getDimensions() {
|
||||
return new int[] {2, 0, 0, 0, 0, 0};
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOffset() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
|
||||
if(world.isRemote) {
|
||||
return true;
|
||||
} else {
|
||||
|
||||
int[] pos = this.findCore(world, x, y, z);
|
||||
|
||||
if(pos == null)
|
||||
return false;
|
||||
|
||||
TileEntity te = world.getTileEntity(pos[0], pos[1], pos[2]);
|
||||
|
||||
if(!(te instanceof TileEntityConveyorPress))
|
||||
return false;
|
||||
|
||||
TileEntityConveyorPress press = (TileEntityConveyorPress) te;
|
||||
|
||||
if(player.getHeldItem() != null && player.getHeldItem().getItem() instanceof ItemStamp && press.slots[0] == null) {
|
||||
press.slots[0] = player.getHeldItem().copy();
|
||||
press.slots[0].stackSize = 1;
|
||||
player.getHeldItem().stackSize--;
|
||||
world.playSoundEffect(x + 0.5, y + 0.5, z + 0.5, "hbm:item.upgradePlug", 1.0F, 1.0F);
|
||||
press.markChanged();
|
||||
world.markBlockForUpdate(x, y, z);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
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) return false;
|
||||
|
||||
int[] pos = this.findCore(world, x, y, z);
|
||||
|
||||
if(pos == null)
|
||||
return false;
|
||||
|
||||
TileEntity te = world.getTileEntity(pos[0], pos[1], pos[2]);
|
||||
|
||||
if(!(te instanceof TileEntityConveyorPress))
|
||||
return false;
|
||||
|
||||
TileEntityConveyorPress press = (TileEntityConveyorPress) te;
|
||||
|
||||
if(press.slots[0] == null) return false;
|
||||
|
||||
if(!player.inventory.addItemStackToInventory(press.slots[0].copy())) {
|
||||
EntityItem item = new EntityItem(world, x + 0.5, y + this.maxY, z + 0.5, press.slots[0].copy());
|
||||
world.spawnEntityInWorld(item);
|
||||
} else {
|
||||
player.inventoryContainer.detectAndSendChanges();
|
||||
}
|
||||
|
||||
press.slots[0] = null;
|
||||
press.markChanged();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Vec3 getTravelLocation(World world, int x, int y, int z, Vec3 itemPos, double speed) {
|
||||
ForgeDirection dir = this.getTravelDirection(world, x, y, z, itemPos);
|
||||
Vec3 snap = this.getClosestSnappingPosition(world, x, y, z, itemPos);
|
||||
Vec3 dest = Vec3.createVectorHelper(snap.xCoord - dir.offsetX * speed, snap.yCoord - dir.offsetY * speed, snap.zCoord - dir.offsetZ * speed);
|
||||
Vec3 motion = Vec3.createVectorHelper((dest.xCoord - itemPos.xCoord), (dest.yCoord - itemPos.yCoord), (dest.zCoord - itemPos.zCoord));
|
||||
double len = motion.lengthVector();
|
||||
Vec3 ret = Vec3.createVectorHelper(itemPos.xCoord + motion.xCoord / len * speed, itemPos.yCoord + motion.yCoord / len * speed, itemPos.zCoord + motion.zCoord / len * speed);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public ForgeDirection getTravelDirection(World world, int x, int y, int z, Vec3 itemPos) {
|
||||
int meta = world.getBlockMetadata(x, y - 1, z) - offset;
|
||||
return ForgeDirection.getOrientation(meta).getRotation(ForgeDirection.UP);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Vec3 getClosestSnappingPosition(World world, int x, int y, int z, Vec3 itemPos) {
|
||||
|
||||
ForgeDirection dir = this.getTravelDirection(world, x, y, z, itemPos);
|
||||
itemPos.xCoord = MathHelper.clamp_double(itemPos.xCoord, x, x + 1);
|
||||
itemPos.zCoord = MathHelper.clamp_double(itemPos.zCoord, z, z + 1);
|
||||
double posX = x + 0.5;
|
||||
double posZ = z + 0.5;
|
||||
if(dir.offsetX != 0) posX = itemPos.xCoord;
|
||||
if(dir.offsetZ != 0) posZ = itemPos.zCoord;
|
||||
return Vec3.createVectorHelper(posX, y + 0.25, posZ);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canItemStay(World world, int x, int y, int z, Vec3 itemPos) {
|
||||
return world.getBlock(x, y - 1, z) == this && world.getBlockMetadata(x, y - 1, z) >= 12;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void printHook(Pre event, World world, int x, int y, int z) {
|
||||
int[] pos = this.findCore(world, x, y, z);
|
||||
|
||||
if(pos == null)
|
||||
return;
|
||||
|
||||
TileEntity te = world.getTileEntity(pos[0], pos[1], pos[2]);
|
||||
|
||||
if(!(te instanceof TileEntityConveyorPress))
|
||||
return;
|
||||
|
||||
TileEntityConveyorPress press = (TileEntityConveyorPress) te;
|
||||
List<String> text = new ArrayList();
|
||||
|
||||
text.add(BobMathUtil.getShortNumber(press.power) + "HE / " + BobMathUtil.getShortNumber(press.maxPower) + "HE");
|
||||
text.add("Installed stamp: " + ((press.syncStack == null || press.syncStack.getItem() == null) ? (EnumChatFormatting.RED + "NONE") : press.syncStack.getDisplayName()));
|
||||
|
||||
ILookOverlay.printGeneric(event, I18nUtil.resolveKey(getUnlocalizedName() + ".name"), 0xffff00, 0x404000, text);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean ext) {
|
||||
this.addStandardInfo(stack, player, list, ext);
|
||||
}
|
||||
}
|
||||
@ -196,7 +196,7 @@ public class WeaponRecipes {
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_12gauge, 12), new Object[] { " I ", "GCL", 'I', ModItems.pellet_buckshot, 'G', ModItems.ballistite, 'C', ModItems.casing_buckshot, 'L', ModItems.plate_polymer });
|
||||
CraftingManager.addRecipeAuto(ModItems.ammo_12gauge.stackFromEnum(12, Ammo12Gauge.PERCUSSION), new Object[] { "G", "C", 'G', ModItems.ballistite, 'C', ModItems.casing_buckshot });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_4gauge, 12), new Object[] { " I ", "GCL", 'I', ModItems.pellet_buckshot, 'G', ModItems.cordite, 'C', ModItems.casing_50, 'L', ModItems.plate_polymer });
|
||||
CraftingManager.addRecipeAuto(ModItems.ammo_4gauge.stackFromEnum(12, Ammo4Gauge.SLUG), new Object[] { " I ", "GCL", 'I', PB.ingot(), 'G', ModItems.cordite, 'C', ModItems.casing_50, 'L', ModItems.plate_polymer });
|
||||
CraftingManager.addRecipeAuto(ModItems.ammo_4gauge.stackFromEnum(12, Ammo4Gauge.SLUG), new Object[] { " I ", "GCL", 'I', STEEL.ingot(), 'G', ModItems.cordite, 'C', ModItems.casing_50, 'L', ModItems.plate_polymer });
|
||||
CraftingManager.addRecipeAuto(ModItems.ammo_4gauge.stackFromEnum(12, Ammo4Gauge.FLECHETTE), new Object[] { " I ", "GCL", 'I', ModItems.pellet_flechette, 'G', ModItems.cordite, 'C', ModItems.casing_50, 'L', ModItems.plate_polymer });
|
||||
CraftingManager.addRecipeAuto(ModItems.ammo_4gauge.stackFromEnum(4, Ammo4Gauge.EXPLOSIVE), new Object[] { " I ", "GCL", 'I', ModBlocks.tnt, 'G', ModItems.cordite, 'C', ModItems.casing_50, 'L', ModItems.plate_polymer });
|
||||
CraftingManager.addRecipeAuto(ModItems.ammo_4gauge.stackFromEnum(6, Ammo4Gauge.EXPLOSIVE), new Object[] { " I ", "GCL", 'I', ANY_PLASTICEXPLOSIVE.ingot(), 'G', ModItems.cordite, 'C', ModItems.casing_50, 'L', ModItems.plate_polymer });
|
||||
|
||||
@ -56,6 +56,7 @@ public class EntityArtilleryShell extends EntityThrowableNT implements IChunkLoa
|
||||
|
||||
@Override
|
||||
protected void entityInit() {
|
||||
super.entityInit();
|
||||
init(ForgeChunkManager.requestTicket(MainRegistry.instance, worldObj, Type.ENTITY));
|
||||
this.dataWatcher.addObject(10, new Integer(0));
|
||||
}
|
||||
|
||||
@ -13,6 +13,7 @@ import com.hbm.inventory.RecipesCommon.ComparableStack;
|
||||
import com.hbm.inventory.RecipesCommon.OreDictStack;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.items.ItemAmmoEnums;
|
||||
import com.hbm.items.ItemGenericPart.EnumPartType;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.machine.ItemAssemblyTemplate;
|
||||
import com.hbm.items.machine.ItemDrillbit.EnumDrillType;
|
||||
@ -281,7 +282,7 @@ public class AssemblerRecipes {
|
||||
makeRecipe(new ComparableStack(ModBlocks.machine_flare, 1), new AStack[] {new OreDictStack(STEEL.ingot(), 12), new OreDictStack(IRON.ingot(), 12), new OreDictStack(CU.plate528(), 4), new ComparableStack(ModItems.tank_steel, 1), new ComparableStack(ModBlocks.deco_pipe_quad, 8), new ComparableStack(ModItems.hull_small_steel, 4), new ComparableStack(ModItems.thermo_element, 3), },200);
|
||||
makeRecipe(new ComparableStack(ModBlocks.machine_coker, 1), new AStack[] {new OreDictStack(STEEL.plate(), 24), new OreDictStack(IRON.ingot(), 12), new OreDictStack(CU.plate528(), 8), new OreDictStack(RUBBER.ingot(), 4), new ComparableStack(ModItems.tank_steel, 2), new ComparableStack(ModBlocks.steel_grate, 4) },200);
|
||||
makeRecipe(new ComparableStack(ModBlocks.machine_refinery, 1), new AStack[] {new OreDictStack(STEEL.plate528(), 16), new OreDictStack(CU.plate(), 16), new ComparableStack(ModItems.hull_big_steel, 6), new ComparableStack(ModItems.pipes_steel, 2), new ComparableStack(ModItems.plate_polymer, 8), new ComparableStack(ModItems.circuit_red_copper, 1) },350);
|
||||
makeRecipe(new ComparableStack(ModBlocks.machine_epress, 1), new AStack[] {new OreDictStack(STEEL.plate(), 8), new ComparableStack(ModItems.plate_polymer, 4), new ComparableStack(ModItems.bolt_tungsten, 4), new ComparableStack(ModItems.coil_copper, 2), new ComparableStack(ModItems.motor, 1), new ComparableStack(ModItems.circuit_copper, 1), new OreDictStack(Fluids.LUBRICANT.getDict(1000)), },160);
|
||||
makeRecipe(new ComparableStack(ModBlocks.machine_epress, 1), new AStack[] {new OreDictStack(STEEL.plate(), 8), new ComparableStack(ModItems.plate_polymer, 4), new ComparableStack(ModItems.part_generic, 2, EnumPartType.PISTON_HYDRAULIC.ordinal()), new ComparableStack(ModItems.circuit_copper, 1) }, 100);
|
||||
makeRecipe(new ComparableStack(ModBlocks.machine_chemplant, 1), new AStack[] {new OreDictStack(STEEL.ingot(), 8), new OreDictStack(CU.plate528(), 6), new ComparableStack(ModItems.tank_steel, 4), new ComparableStack(ModItems.hull_big_steel, 1), new ComparableStack(ModItems.coil_tungsten, 3), new ComparableStack(ModItems.circuit_copper, 2), new ComparableStack(ModItems.circuit_red_copper, 1), new ComparableStack(ModItems.plate_polymer, 8), },200);
|
||||
makeRecipe(new ComparableStack(ModBlocks.machine_crystallizer, 1), new AStack[] {new ComparableStack(ModItems.hull_big_steel, 4), new ComparableStack(ModItems.pipes_steel, 1), new OreDictStack(DESH.ingot(), 4), new ComparableStack(ModItems.motor, 2), new ComparableStack(ModItems.blades_advanced_alloy, 2), new OreDictStack(STEEL.ingot(), 16), new OreDictStack(TI.plate(), 16), new ComparableStack(Blocks.glass, 4), new ComparableStack(ModItems.circuit_gold, 1), },400);
|
||||
makeRecipe(new ComparableStack(ModBlocks.machine_fluidtank, 1), new AStack[] {new OreDictStack(STEEL.ingot(), 2), new OreDictStack(STEEL.plate528(), 6), new ComparableStack(ModItems.hull_big_steel, 4), new OreDictStack(ANY_TAR.any(), 4), },150);
|
||||
|
||||
@ -287,6 +287,7 @@ public class ClientProxy extends ServerProxy {
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineCoker.class, new RenderCoker());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityFan.class, new RenderFan());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityPistonInserter.class, new RenderPistonInserter());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityConveyorPress.class, new RenderConveyorPress());
|
||||
//Foundry
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityFoundryBasin.class, new RenderFoundry());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityFoundryMold.class, new RenderFoundry());
|
||||
|
||||
@ -984,6 +984,8 @@ public class CraftingManager {
|
||||
addRecipeAuto(new ItemStack(ModBlocks.crane_unboxer), new Object[] { "WWW", "WPW", "CCC", 'W', KEY_STICK, 'P', Items.shears, 'C', ModBlocks.conveyor });
|
||||
addRecipeAuto(new ItemStack(ModBlocks.crane_router), new Object[] { "PIP", "ICI", "PIP", 'P', DictFrame.fromOne(ModItems.part_generic, EnumPartType.PISTON_PNEUMATIC), 'I', ModItems.plate_polymer, 'C', ModItems.circuit_copper });
|
||||
addRecipeAuto(new ItemStack(ModBlocks.crane_splitter), new Object[] { "III", "PCP", "III", 'P', DictFrame.fromOne(ModItems.part_generic, EnumPartType.PISTON_PNEUMATIC), 'I', STEEL.ingot(), 'C', ModItems.circuit_aluminium });
|
||||
|
||||
addRecipeAuto(new ItemStack(ModBlocks.machine_conveyor_press), new Object[] { "CPC", "CBC", "CCC", 'C', CU.plate(), 'P', ModBlocks.machine_epress, 'B', ModBlocks.conveyor });
|
||||
|
||||
addShapelessAuto(DictFrame.fromOne(ModItems.parts_legendary, EnumLegendaryType.TIER1), new Object[] { ModItems.ingot_chainsteel, ASBESTOS.ingot(), ModItems.gem_alexandrite });
|
||||
addShapelessAuto(DictFrame.fromOne(ModItems.parts_legendary, EnumLegendaryType.TIER1, 3), new Object[] { DictFrame.fromOne(ModItems.parts_legendary, EnumLegendaryType.TIER2) });
|
||||
|
||||
@ -12,10 +12,6 @@ import org.lwjgl.opengl.GL11;
|
||||
import com.hbm.blocks.ILookOverlay;
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.blocks.generic.BlockAshes;
|
||||
import com.hbm.blocks.rail.IRailNTM;
|
||||
import com.hbm.blocks.rail.IRailNTM.MoveContext;
|
||||
import com.hbm.blocks.rail.IRailNTM.RailCheckType;
|
||||
import com.hbm.blocks.rail.IRailNTM.RailContext;
|
||||
import com.hbm.config.GeneralConfig;
|
||||
import com.hbm.entity.mob.EntityHunterChopper;
|
||||
import com.hbm.entity.projectile.EntityChopperMine;
|
||||
@ -144,7 +140,8 @@ import net.minecraftforge.event.entity.player.ItemTooltipEvent;
|
||||
|
||||
public class ModEventHandlerClient {
|
||||
|
||||
public static int flashTimer;
|
||||
public static final int flashDuration = 5_000;
|
||||
public static long flashTimestamp;
|
||||
|
||||
@SubscribeEvent
|
||||
public void onOverlayRender(RenderGameOverlayEvent.Pre event) {
|
||||
@ -152,7 +149,7 @@ public class ModEventHandlerClient {
|
||||
EntityPlayer player = Minecraft.getMinecraft().thePlayer;
|
||||
|
||||
/// NUKE FLASH ///
|
||||
if(event.type == ElementType.CROSSHAIRS && flashTimer > 0) {
|
||||
if(event.type == ElementType.CROSSHAIRS && (flashTimestamp + flashDuration - System.currentTimeMillis()) > 0) {
|
||||
int width = event.resolution.getScaledWidth();
|
||||
int height = event.resolution.getScaledHeight();
|
||||
Tessellator tess = Tessellator.instance;
|
||||
@ -162,7 +159,7 @@ public class ModEventHandlerClient {
|
||||
GL11.glAlphaFunc(GL11.GL_GEQUAL, 0.0F);
|
||||
GL11.glDepthMask(false);
|
||||
tess.startDrawingQuads();
|
||||
float brightness = (flashTimer - event.partialTicks) / 200F;
|
||||
float brightness = (flashTimestamp + flashDuration - System.currentTimeMillis()) / (float) flashDuration;
|
||||
tess.setColorRGBA_F(1F, 1F, 1F, brightness * 0.8F);
|
||||
tess.addVertex(width, 0, 0);
|
||||
tess.addVertex(0, 0, 0);
|
||||
@ -1262,8 +1259,6 @@ public class ModEventHandlerClient {
|
||||
client.sendQueue.addToSendQueue(new C0CPacketInput(client.moveStrafing, client.moveForward, client.movementInput.jump, client.movementInput.sneak));
|
||||
}
|
||||
}
|
||||
|
||||
if(event.phase == Phase.START) if(flashTimer > 0) flashTimer--;
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
|
||||
@ -383,8 +383,8 @@ public class ModEventHandlerRenderer {
|
||||
@SubscribeEvent
|
||||
public void onRenderHUD(RenderGameOverlayEvent.Pre event) {
|
||||
|
||||
if(event.type == ElementType.HOTBAR && ModEventHandlerClient.flashTimer > 0) {
|
||||
double mult = (ModEventHandlerClient.flashTimer + event.partialTicks) * 0.01D;
|
||||
if(event.type == ElementType.HOTBAR && (ModEventHandlerClient.flashTimestamp + ModEventHandlerClient.flashDuration - System.currentTimeMillis()) > 0) {
|
||||
double mult = (ModEventHandlerClient.flashTimestamp + ModEventHandlerClient.flashDuration - System.currentTimeMillis()) / (double) ModEventHandlerClient.flashDuration * 2;
|
||||
double horizontal = MathHelper.clamp_double(Math.sin(System.currentTimeMillis() * 0.02), -0.7, 0.7) * 5;
|
||||
double vertical = MathHelper.clamp_double(Math.sin(System.currentTimeMillis() * 0.01 + 2), -0.7, 0.7) * 1;
|
||||
GL11.glTranslated(horizontal * mult, vertical * mult, 0);
|
||||
|
||||
@ -122,6 +122,7 @@ public class ResourceManager {
|
||||
public static final IModelCustom press_head = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/press_head.obj"));
|
||||
public static final IModelCustom epress_body = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/epress_body.obj"));
|
||||
public static final IModelCustom epress_head = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/epress_head.obj"));
|
||||
public static final IModelCustom conveyor_press = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/machines/conveyor_press.obj"));
|
||||
|
||||
//Assembler
|
||||
public static final IModelCustom assembler_body = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/assembler_new_body.obj"));
|
||||
@ -479,6 +480,8 @@ public class ResourceManager {
|
||||
public static final ResourceLocation press_head_tex = new ResourceLocation(RefStrings.MODID, "textures/models/press_head.png");
|
||||
public static final ResourceLocation epress_body_tex = new ResourceLocation(RefStrings.MODID, "textures/models/epress_body.png");
|
||||
public static final ResourceLocation epress_head_tex = new ResourceLocation(RefStrings.MODID, "textures/models/epress_head.png");
|
||||
public static final ResourceLocation conveyor_press_tex = new ResourceLocation(RefStrings.MODID, "textures/models/machines/conveyor_press.png");
|
||||
public static final ResourceLocation conveyor_press_belt_tex = new ResourceLocation(RefStrings.MODID, "textures/models/machines/conveyor_press_belt.png");
|
||||
|
||||
//Assembler
|
||||
public static final ResourceLocation assembler_body_tex = new ResourceLocation(RefStrings.MODID, "textures/models/assembler_base_new.png");
|
||||
|
||||
@ -37,7 +37,7 @@ public class RenderTorex extends Render {
|
||||
EntityNukeTorex cloud = (EntityNukeTorex)entity;
|
||||
cloudletWrapper(cloud, interp);
|
||||
if(cloud.ticksExisted < 101) flashWrapper(cloud, interp);
|
||||
if(cloud.ticksExisted < 10 && ModEventHandlerClient.flashTimer < 100) ModEventHandlerClient.flashTimer = 200;
|
||||
if(cloud.ticksExisted < 10 && System.currentTimeMillis() - ModEventHandlerClient.flashTimestamp > 1_000) ModEventHandlerClient.flashTimestamp = System.currentTimeMillis();
|
||||
if(fog) GL11.glEnable(GL11.GL_FOG);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
@ -0,0 +1,80 @@
|
||||
package com.hbm.render.tileentity;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.main.ResourceManager;
|
||||
import com.hbm.render.item.ItemRenderBase;
|
||||
import com.hbm.tileentity.machine.TileEntityConveyorPress;
|
||||
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.client.IItemRenderer;
|
||||
|
||||
public class RenderConveyorPress extends TileEntitySpecialRenderer implements IItemRendererProvider {
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntity tile, double x, double y, double z, float interp) {
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(x + 0.5, y, z + 0.5);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glEnable(GL11.GL_CULL_FACE);
|
||||
|
||||
switch(tile.getBlockMetadata() - BlockDummyable.offset) {
|
||||
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;
|
||||
}
|
||||
|
||||
TileEntityConveyorPress press = (TileEntityConveyorPress) tile;
|
||||
|
||||
bindTexture(ResourceManager.conveyor_press_tex);
|
||||
ResourceManager.conveyor_press.renderPart("Press");
|
||||
|
||||
if(press.syncStack != null) {
|
||||
GL11.glPushMatrix();
|
||||
double piston = press.lastPress + (press.renderPress - press.lastPress) * interp;
|
||||
GL11.glTranslated(0, -piston * 0.75, 0);
|
||||
ResourceManager.conveyor_press.renderPart("Piston");
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
bindTexture(ResourceManager.conveyor_press_belt_tex);
|
||||
|
||||
GL11.glMatrixMode(GL11.GL_TEXTURE);
|
||||
GL11.glLoadIdentity();
|
||||
int ticks = (int)(tile.getWorldObj().getTotalWorldTime() % 16) - 2;
|
||||
GL11.glTranslated(0, ticks / 16D, 0);
|
||||
GL11.glMatrixMode(GL11.GL_MODELVIEW);
|
||||
ResourceManager.conveyor_press.renderPart("Belt");
|
||||
GL11.glMatrixMode(GL11.GL_TEXTURE);
|
||||
GL11.glLoadIdentity();
|
||||
GL11.glMatrixMode(GL11.GL_MODELVIEW);
|
||||
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItemForRenderer() {
|
||||
return Item.getItemFromBlock(ModBlocks.machine_conveyor_press);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IItemRenderer getRenderer() {
|
||||
return new ItemRenderBase( ) {
|
||||
public void renderInventory() {
|
||||
GL11.glTranslated(0, -4, 0);
|
||||
GL11.glScaled(4.5, 4.5, 4.5);
|
||||
}
|
||||
public void renderCommon() {
|
||||
bindTexture(ResourceManager.conveyor_press_tex);
|
||||
ResourceManager.conveyor_press.renderPart("Press");
|
||||
ResourceManager.conveyor_press.renderPart("Piston");
|
||||
bindTexture(ResourceManager.conveyor_press_belt_tex);
|
||||
ResourceManager.conveyor_press.renderPart("Belt");
|
||||
}};
|
||||
}
|
||||
}
|
||||
@ -140,6 +140,7 @@ public class TileMappings {
|
||||
put(TileEntityDecon.class, "tileentity_decon");
|
||||
put(TileEntityMachineSatDock.class, "tileentity_miner_dock");
|
||||
put(TileEntityMachineEPress.class, "tileentity_electric_press");
|
||||
put(TileEntityConveyorPress.class, "tileentity_conveyor_press");
|
||||
put(TileEntityCoreEmitter.class, "tileentity_v0_emitter");
|
||||
put(TileEntityCoreReceiver.class, "tileentity_v0_receiver");
|
||||
put(TileEntityCoreInjector.class, "tileentity_v0_injector");
|
||||
|
||||
@ -0,0 +1,269 @@
|
||||
package com.hbm.tileentity.machine;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.entity.item.EntityMovingItem;
|
||||
import com.hbm.inventory.recipes.PressRecipes;
|
||||
import com.hbm.items.machine.ItemStamp;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.tileentity.TileEntityMachineBase;
|
||||
import com.hbm.util.fauxpointtwelve.DirPos;
|
||||
|
||||
import api.hbm.energy.IEnergyUser;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityConveyorPress extends TileEntityMachineBase implements IEnergyUser {
|
||||
|
||||
public int usage = 100;
|
||||
public long power = 0;
|
||||
public final static long maxPower = 50000;
|
||||
|
||||
public double speed = 0.125;
|
||||
public double press;
|
||||
public double renderPress;
|
||||
public double lastPress;
|
||||
private double syncPress;
|
||||
private int turnProgress;
|
||||
protected boolean isRetracting = false;
|
||||
private int delay;
|
||||
|
||||
public ItemStack syncStack;
|
||||
|
||||
public TileEntityConveyorPress() {
|
||||
super(1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
|
||||
if(!worldObj.isRemote) {
|
||||
|
||||
this.updateConnections();
|
||||
|
||||
if(delay <= 0) {
|
||||
|
||||
if(isRetracting) {
|
||||
|
||||
if(this.canRetract()) {
|
||||
this.press -= speed;
|
||||
this.power -= this.usage;
|
||||
|
||||
if(press <= 0) {
|
||||
press = 0;
|
||||
this.isRetracting = false;
|
||||
delay = 0;
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
if(this.canExtend()) {
|
||||
this.press += speed;
|
||||
this.power -= this.usage;
|
||||
|
||||
if(press >= 1) {
|
||||
press = 1;
|
||||
this.isRetracting = true;
|
||||
delay = 5;
|
||||
this.process();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
delay--;
|
||||
}
|
||||
|
||||
NBTTagCompound data = new NBTTagCompound();
|
||||
data.setLong("power", power);
|
||||
data.setDouble("press", press);
|
||||
if(slots[0] != null) {
|
||||
NBTTagCompound stack = new NBTTagCompound();
|
||||
slots[0].writeToNBT(stack);
|
||||
data.setTag("stack", stack);
|
||||
}
|
||||
|
||||
this.networkPack(data, 50);
|
||||
} else {
|
||||
|
||||
// approach-based interpolation, GO!
|
||||
this.lastPress = this.renderPress;
|
||||
|
||||
if(this.turnProgress > 0) {
|
||||
this.renderPress = this.renderPress + ((this.syncPress - this.renderPress) / (double) this.turnProgress);
|
||||
--this.turnProgress;
|
||||
} else {
|
||||
this.renderPress = this.syncPress;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected void updateConnections() {
|
||||
for(DirPos pos : getConPos()) this.trySubscribe(worldObj, pos.getX(), pos.getY(), pos.getZ(), pos.getDir());
|
||||
}
|
||||
|
||||
protected DirPos[] getConPos() {
|
||||
return new DirPos[] {
|
||||
new DirPos(xCoord + 1, yCoord, zCoord, Library.POS_X),
|
||||
new DirPos(xCoord - 1, yCoord, zCoord, Library.NEG_X),
|
||||
new DirPos(xCoord, yCoord, zCoord + 1, Library.POS_Z),
|
||||
new DirPos(xCoord, yCoord, zCoord - 1, Library.NEG_Z),
|
||||
};
|
||||
}
|
||||
|
||||
public boolean canExtend() {
|
||||
|
||||
if(this.power < usage) return false;
|
||||
if(slots[0] == null) return false;
|
||||
|
||||
List<EntityMovingItem> items = worldObj.getEntitiesWithinAABB(EntityMovingItem.class, AxisAlignedBB.getBoundingBox(xCoord, yCoord + 1, zCoord, xCoord + 1, yCoord + 1.5, zCoord + 1));
|
||||
if(items.isEmpty()) return false;
|
||||
|
||||
for(EntityMovingItem item : items) {
|
||||
ItemStack stack = item.getItemStack();
|
||||
if(PressRecipes.getOutput(stack, slots[0]) != null && stack.stackSize == 1) {
|
||||
|
||||
double d0 = 0.35;
|
||||
double d1 = 0.65;
|
||||
if(item.posX > xCoord + d0 && item.posX < xCoord + d1 && item.posZ > zCoord + d0 && item.posZ < zCoord + d1) {
|
||||
item.setPosition(xCoord + 0.5, item.posY, zCoord + 0.5);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public void process() {
|
||||
|
||||
List<EntityMovingItem> items = worldObj.getEntitiesWithinAABB(EntityMovingItem.class, AxisAlignedBB.getBoundingBox(xCoord, yCoord + 1, zCoord, xCoord + 1, yCoord + 1.5, zCoord + 1));
|
||||
|
||||
for(EntityMovingItem item : items) {
|
||||
ItemStack stack = item.getItemStack();
|
||||
ItemStack output = PressRecipes.getOutput(stack, slots[0]);
|
||||
|
||||
if(output != null && stack.stackSize == 1) {
|
||||
item.setDead();
|
||||
EntityMovingItem out = new EntityMovingItem(worldObj);
|
||||
out.setPosition(item.posX, item.posY, item.posZ);
|
||||
out.setItemStack(output.copy());
|
||||
worldObj.spawnEntityInWorld(out);
|
||||
}
|
||||
}
|
||||
|
||||
this.worldObj.playSoundEffect(this.xCoord, this.yCoord, this.zCoord, "hbm:block.pressOperate", 1.5F, 1.0F);
|
||||
|
||||
if(slots[0].getMaxDamage() != 0) {
|
||||
slots[0].setItemDamage(slots[0].getItemDamage() + 1);
|
||||
if(slots[0].getItemDamage() >= slots[0].getMaxDamage()) {
|
||||
slots[0] = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public boolean canRetract() {
|
||||
if(this.power < usage) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void networkUnpack(NBTTagCompound nbt) {
|
||||
this.power = nbt.getLong("power");
|
||||
this.syncPress = nbt.getInteger("press");
|
||||
|
||||
if(nbt.hasKey("stack")) {
|
||||
NBTTagCompound stack = nbt.getCompoundTag("stack");
|
||||
this.syncStack = ItemStack.loadItemStackFromNBT(stack);
|
||||
} else {
|
||||
this.syncStack = null;
|
||||
}
|
||||
|
||||
this.turnProgress = 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isItemValidForSlot(int i, ItemStack stack) {
|
||||
return stack.getItem() instanceof ItemStamp;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getAccessibleSlotsFromSide(int side) {
|
||||
return new int[] { 0 };
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInsertItem(int i, ItemStack itemStack, int j) {
|
||||
return this.isItemValidForSlot(i, itemStack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getPower() {
|
||||
return power;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getMaxPower() {
|
||||
return maxPower;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPower(long power) {
|
||||
this.power = power;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canConnect(ForgeDirection dir) {
|
||||
return dir != ForgeDirection.DOWN;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbt) {
|
||||
super.readFromNBT(nbt);
|
||||
this.power = nbt.getLong("power");
|
||||
this.press = nbt.getDouble("press");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbt) {
|
||||
super.writeToNBT(nbt);
|
||||
nbt.setLong("power", power);
|
||||
nbt.setDouble("press", press);
|
||||
}
|
||||
|
||||
AxisAlignedBB bb = null;
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getRenderBoundingBox() {
|
||||
|
||||
if(bb == null) {
|
||||
bb = AxisAlignedBB.getBoundingBox(
|
||||
xCoord - 1,
|
||||
yCoord,
|
||||
zCoord - 1,
|
||||
xCoord + 2,
|
||||
yCoord + 3,
|
||||
zCoord + 2
|
||||
);
|
||||
}
|
||||
|
||||
return bb;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public double getMaxRenderDistanceSquared() {
|
||||
return 65536.0D;
|
||||
}
|
||||
}
|
||||
@ -43,7 +43,6 @@ public class TileEntityCoreEmitter extends TileEntityMachineBase implements IEne
|
||||
public boolean isOn;
|
||||
public FluidTank tank;
|
||||
public long prev;
|
||||
public static long maxJoules = Long.MAX_VALUE / 100_000;
|
||||
|
||||
public static final int range = 50;
|
||||
|
||||
@ -99,8 +98,6 @@ public class TileEntityCoreEmitter extends TileEntityMachineBase implements IEne
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(this.getBlockMetadata());
|
||||
for(int i = 1; i <= range; i++) {
|
||||
|
||||
if(out > maxJoules) out = maxJoules;
|
||||
|
||||
beam = i;
|
||||
|
||||
int x = xCoord + dir.offsetX * i;
|
||||
@ -111,13 +108,11 @@ public class TileEntityCoreEmitter extends TileEntityMachineBase implements IEne
|
||||
TileEntity te = worldObj.getTileEntity(x, y, z);
|
||||
|
||||
if(block instanceof ILaserable) {
|
||||
|
||||
((ILaserable)block).addEnergy(worldObj, x, y, z, out * 98 / 100, dir);
|
||||
break;
|
||||
}
|
||||
|
||||
if(te instanceof ILaserable) {
|
||||
|
||||
((ILaserable)te).addEnergy(worldObj, x, y, z, out * 98 / 100, dir);
|
||||
break;
|
||||
}
|
||||
|
||||
@ -91,6 +91,8 @@ public class TileEntityRBMKRod extends TileEntityRBMKSlottedBase implements IRBM
|
||||
} else {
|
||||
this.meltdown();
|
||||
}
|
||||
this.fluxFast = 0;
|
||||
this.fluxSlow = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@ -1,9 +1,16 @@
|
||||
package com.hbm.tileentity.machine.storage;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import com.hbm.lib.Library;
|
||||
|
||||
import api.hbm.energy.IEnergyConductor;
|
||||
import api.hbm.energy.IEnergyConnector;
|
||||
import api.hbm.energy.IPowerNet;
|
||||
import api.hbm.energy.PowerNet;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
@ -28,7 +35,7 @@ public class TileEntityMachineFENSU extends TileEntityMachineBattery {
|
||||
power = Library.chargeItemsFromTE(slots, 1, power, getMaxPower());
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
this.transmitPowerFairly();
|
||||
this.transmitPower();
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
byte comp = this.getComparatorPower();
|
||||
@ -71,54 +78,61 @@ public class TileEntityMachineFENSU extends TileEntityMachineBattery {
|
||||
|
||||
short mode = (short) this.getRelevantMode();
|
||||
|
||||
ForgeDirection dir = ForgeDirection.DOWN;
|
||||
//HasSets to we don'T have any duplicates
|
||||
Set<IPowerNet> nets = new HashSet();
|
||||
Set<IEnergyConnector> consumers = new HashSet();
|
||||
|
||||
//iterate over all sides
|
||||
for(ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
|
||||
|
||||
TileEntity te = worldObj.getTileEntity(xCoord + dir.offsetX, yCoord + dir.offsetY, zCoord + dir.offsetZ);
|
||||
|
||||
if(te instanceof IEnergyConductor) {
|
||||
IEnergyConductor con = (IEnergyConductor) te;
|
||||
|
||||
if(con.getPowerNet() != null && con.getPowerNet().isSubscribed(this))
|
||||
con.getPowerNet().unsubscribe(this);
|
||||
}
|
||||
|
||||
if(mode == 1 || mode == 2) {
|
||||
if(te instanceof IEnergyConnector) {
|
||||
TileEntity te = worldObj.getTileEntity(xCoord + dir.offsetX, yCoord + dir.offsetY, zCoord + dir.offsetZ);
|
||||
|
||||
//if it's a cable, buffer both the network and all subscribers of the net
|
||||
if(te instanceof IEnergyConductor) {
|
||||
IEnergyConductor con = (IEnergyConductor) te;
|
||||
if(con.canConnect(dir.getOpposite()) && con.getPowerNet() != null) {
|
||||
nets.add(con.getPowerNet());
|
||||
con.getPowerNet().unsubscribe(this);
|
||||
consumers.addAll(con.getPowerNet().getSubscribers());
|
||||
}
|
||||
|
||||
//if it's just a consumer, buffer it as a subscriber
|
||||
} else if(te instanceof IEnergyConnector) {
|
||||
IEnergyConnector con = (IEnergyConnector) te;
|
||||
|
||||
long max = maxTransfer;
|
||||
long toTransfer = Math.min(max, this.power);
|
||||
long remainder = this.power - toTransfer;
|
||||
this.power = toTransfer;
|
||||
|
||||
long oldPower = this.power;
|
||||
long transfer = this.power - con.transferPower(this.power);
|
||||
this.power = oldPower - transfer;
|
||||
|
||||
power += remainder;
|
||||
}
|
||||
}
|
||||
|
||||
if(te instanceof IEnergyConductor) {
|
||||
IEnergyConductor con = (IEnergyConductor) te;
|
||||
|
||||
if(con.getPowerNet() != null) {
|
||||
if(mode == 2 || mode == 3) {
|
||||
if(con.getPowerNet().isSubscribed(this)) {
|
||||
con.getPowerNet().unsubscribe(this);
|
||||
}
|
||||
} else if(!con.getPowerNet().isSubscribed(this)) {
|
||||
con.getPowerNet().subscribe(this);
|
||||
if(con.canConnect(dir.getOpposite())) {
|
||||
consumers.add((IEnergyConnector) te);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//send power to buffered consumers, independent of nets
|
||||
if(this.power > 0 && (mode == mode_buffer || mode == mode_output)) {
|
||||
List<IEnergyConnector> con = new ArrayList();
|
||||
con.addAll(consumers);
|
||||
|
||||
if(PowerNet.trackingInstances == null) {
|
||||
PowerNet.trackingInstances = new ArrayList();
|
||||
}
|
||||
PowerNet.trackingInstances.clear();
|
||||
|
||||
nets.forEach(x -> {
|
||||
if(x instanceof PowerNet) PowerNet.trackingInstances.add((PowerNet) x);
|
||||
});
|
||||
|
||||
long toSend = Math.min(this.power, maxTransfer);
|
||||
long powerRemaining = this.power - toSend;
|
||||
this.power = PowerNet.fairTransfer(con, toSend) + powerRemaining;
|
||||
}
|
||||
|
||||
//resubscribe to buffered nets, if necessary
|
||||
if(mode == mode_buffer || mode == mode_input) {
|
||||
nets.forEach(x -> x.subscribe(this));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getPowerRemainingScaled(long i) {
|
||||
|
||||
double powerScaled = (double)power / (double)getMaxPower();
|
||||
|
||||
return (long)(i * powerScaled);
|
||||
}
|
||||
|
||||
|
||||
@ -3,6 +3,7 @@ package com.hbm.world.feature;
|
||||
import java.util.Random;
|
||||
|
||||
import com.hbm.blocks.BlockEnums.EnumBiomeType;
|
||||
import com.hbm.world.generator.DungeonToolbox;
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
@ -13,7 +14,7 @@ import net.minecraft.world.biome.BiomeGenBase.TempCategory;
|
||||
import net.minecraft.world.gen.NoiseGeneratorPerlin;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.event.terraingen.PopulateChunkEvent;
|
||||
import net.minecraftforge.event.terraingen.DecorateBiomeEvent;
|
||||
|
||||
public class BiomeCave {
|
||||
|
||||
@ -52,7 +53,7 @@ public class BiomeCave {
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onDecorate(PopulateChunkEvent.Pre event) {
|
||||
public void onDecorate(DecorateBiomeEvent.Pre event) {
|
||||
|
||||
World world = event.world;
|
||||
|
||||
@ -95,7 +96,7 @@ public class BiomeCave {
|
||||
private static void handleBiome(World world, int x, int y, int z, EnumBiomeType type) {
|
||||
Block target = world.getBlock(x, y, z);
|
||||
|
||||
if(target.isNormalCube()) {
|
||||
if(target.isNormalCube() && DungeonToolbox.allowedToReplace(target)) {
|
||||
|
||||
boolean shouldGen = false;
|
||||
|
||||
|
||||
@ -3,22 +3,22 @@ package com.hbm.world.feature;
|
||||
import java.util.Random;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.world.generator.DungeonToolbox;
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.gen.NoiseGeneratorPerlin;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.event.terraingen.PopulateChunkEvent;
|
||||
import net.minecraftforge.event.terraingen.DecorateBiomeEvent;
|
||||
|
||||
public class DeepLayer {
|
||||
|
||||
NoiseGeneratorPerlin noise;
|
||||
|
||||
@SubscribeEvent
|
||||
public void onDecorate(PopulateChunkEvent.Pre event) {
|
||||
public void onDecorate(DecorateBiomeEvent.Pre event) {
|
||||
|
||||
World world = event.world;
|
||||
if(world.provider == null || world.provider.dimensionId != 0) return;
|
||||
@ -51,7 +51,7 @@ public class DeepLayer {
|
||||
|
||||
Block target = world.getBlock(x, y, z);
|
||||
|
||||
if(target.isNormalCube() && target.getMaterial() == Material.rock && target != Blocks.bedrock) {
|
||||
if(target.isNormalCube() && target.getMaterial() == Material.rock && DungeonToolbox.allowedToReplace(target)) {
|
||||
|
||||
boolean lava = false;
|
||||
|
||||
|
||||
@ -5,6 +5,7 @@ import java.util.Random;
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.blocks.generic.BlockStalagmite;
|
||||
import com.hbm.inventory.RecipesCommon.MetaBlock;
|
||||
import com.hbm.world.generator.DungeonToolbox;
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraft.block.Block;
|
||||
@ -13,7 +14,7 @@ import net.minecraft.world.World;
|
||||
import net.minecraft.world.gen.NoiseGeneratorPerlin;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.event.terraingen.PopulateChunkEvent;
|
||||
import net.minecraftforge.event.terraingen.DecorateBiomeEvent;
|
||||
|
||||
public class OreCave {
|
||||
|
||||
@ -71,7 +72,7 @@ public class OreCave {
|
||||
|
||||
@SuppressWarnings("incomplete-switch")
|
||||
@SubscribeEvent
|
||||
public void onDecorate(PopulateChunkEvent.Pre event) {
|
||||
public void onDecorate(DecorateBiomeEvent.Pre event) {
|
||||
|
||||
World world = event.world;
|
||||
|
||||
@ -103,7 +104,7 @@ public class OreCave {
|
||||
for(int y = yLevel - range; y <= yLevel + range; y++) {
|
||||
Block genTarget = world.getBlock(x, y, z);
|
||||
|
||||
if(genTarget.isNormalCube() && (genTarget.getMaterial() == Material.rock || genTarget.getMaterial() == Material.ground)) {
|
||||
if(genTarget.isNormalCube() && (genTarget.getMaterial() == Material.rock || genTarget.getMaterial() == Material.ground) && DungeonToolbox.allowedToReplace(genTarget)) {
|
||||
|
||||
boolean shouldGen = false;
|
||||
boolean canGenFluid = event.rand.nextBoolean();
|
||||
|
||||
@ -3,6 +3,7 @@ package com.hbm.world.feature;
|
||||
import java.util.Random;
|
||||
|
||||
import com.hbm.inventory.RecipesCommon.MetaBlock;
|
||||
import com.hbm.world.generator.DungeonToolbox;
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraft.block.Block;
|
||||
@ -10,7 +11,7 @@ import net.minecraft.init.Blocks;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.gen.NoiseGeneratorPerlin;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.terraingen.PopulateChunkEvent;
|
||||
import net.minecraftforge.event.terraingen.DecorateBiomeEvent;
|
||||
|
||||
public class OreLayer {
|
||||
|
||||
@ -65,7 +66,7 @@ public class OreLayer {
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onDecorate(PopulateChunkEvent.Pre event) {
|
||||
public void onDecorate(DecorateBiomeEvent.Pre event) {
|
||||
|
||||
World world = event.world;
|
||||
|
||||
@ -99,7 +100,7 @@ public class OreLayer {
|
||||
if(event.rand.nextFloat() < density) {
|
||||
Block genTarget = world.getBlock(x, y, z);
|
||||
|
||||
if(genTarget.isReplaceableOreGen(world, x, y, z, target)) {
|
||||
if(genTarget.isReplaceableOreGen(world, x, y, z, target) && DungeonToolbox.allowedToReplace(genTarget)) {
|
||||
world.setBlock(x, y, z, ore.block, ore.meta, 2);
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,13 +2,15 @@ package com.hbm.world.feature;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import com.hbm.world.generator.DungeonToolbox;
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.gen.NoiseGeneratorPerlin;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.terraingen.PopulateChunkEvent;
|
||||
import net.minecraftforge.event.terraingen.DecorateBiomeEvent;
|
||||
|
||||
public class OreLayer3D {
|
||||
|
||||
@ -51,7 +53,7 @@ public class OreLayer3D {
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onDecorate(PopulateChunkEvent.Pre event) {
|
||||
public void onDecorate(DecorateBiomeEvent.Pre event) {
|
||||
|
||||
World world = event.world;
|
||||
|
||||
@ -74,7 +76,7 @@ public class OreLayer3D {
|
||||
if(nX * nY * nZ > threshold) {
|
||||
Block target = world.getBlock(x, y, z);
|
||||
|
||||
if(target.isNormalCube() && target.getMaterial() == Material.rock) {
|
||||
if(target.isNormalCube() && target.getMaterial() == Material.rock && DungeonToolbox.allowedToReplace(target)) {
|
||||
world.setBlock(x, y, z, block, meta, 2);
|
||||
}
|
||||
}
|
||||
|
||||
@ -3,20 +3,21 @@ package com.hbm.world.feature;
|
||||
import java.util.Random;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.world.generator.DungeonToolbox;
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.gen.NoiseGeneratorPerlin;
|
||||
import net.minecraftforge.event.terraingen.PopulateChunkEvent;
|
||||
import net.minecraftforge.event.terraingen.DecorateBiomeEvent;
|
||||
|
||||
public class SchistStratum {
|
||||
|
||||
NoiseGeneratorPerlin noise;
|
||||
|
||||
@SubscribeEvent
|
||||
public void onDecorate(PopulateChunkEvent.Pre event) {
|
||||
public void onDecorate(DecorateBiomeEvent.Pre event) {
|
||||
|
||||
if(this.noise == null) {
|
||||
this.noise = new NoiseGeneratorPerlin(new Random(event.world.getSeed()), 4);
|
||||
@ -51,7 +52,7 @@ public class SchistStratum {
|
||||
|
||||
Block target = world.getBlock(x, y, z);
|
||||
|
||||
if(target.isNormalCube() && target.getMaterial() == Material.rock) {
|
||||
if(target.isNormalCube() && target.getMaterial() == Material.rock && DungeonToolbox.allowedToReplace(target)) {
|
||||
world.setBlock(x, y, z, ModBlocks.stone_gneiss, 0, 2);
|
||||
}
|
||||
}
|
||||
|
||||
@ -94,4 +94,12 @@ public class DungeonToolbox {
|
||||
genFlowers.func_150550_a(flower, meta);
|
||||
genFlowers.generate(world, rand, x, y, z);
|
||||
}
|
||||
|
||||
public static boolean allowedToReplace(Block block) {
|
||||
|
||||
if(block == Blocks.end_portal_frame) return false;
|
||||
if(block == Blocks.bedrock) return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@ -2523,7 +2523,6 @@ item.oil_detector.bullseye=Ölvorkommen direkt untertage!
|
||||
item.oil_detector.detected=Ölvorkommen in der Nähe!
|
||||
item.oil_detector.noOil=Kein Öl gefunden.
|
||||
item.oil_tar.coal.name=Kohleteer
|
||||
item.oil_tar.name=Ölteer
|
||||
item.oil_tar.crude.name=Erdölteer
|
||||
item.oil_tar.crack.name=Crackölteer
|
||||
item.oil_tar.paraffin.name=Paraffinwachs
|
||||
@ -2533,6 +2532,7 @@ item.ore.asbestos=Asbest
|
||||
item.ore.borax=Borax
|
||||
item.ore.chlorocalcite=Chlorokalzit
|
||||
item.ore.copper=Kupfer
|
||||
item.ore.fluorite=Fluorit
|
||||
item.ore.gold=Gold
|
||||
item.ore.iron=Eisen
|
||||
item.ore.niobium=Niob
|
||||
@ -4011,6 +4011,8 @@ tile.machine_condenser.name=Dampfkondensierer
|
||||
tile.machine_controller.name=Reaktorfernsteuerung
|
||||
tile.machine_converter_he_rf.name=HE zu RF Konverter
|
||||
tile.machine_converter_rf_he.name=RF zu HE Konverter
|
||||
tile.machine_conveyor_press.name=Förderband-Presse
|
||||
tile.machine_conveyor_press.desc=Band bewegt sich von links nach rechts$Rechtsclick um Stempel zu montieren$Stempel kann mit Schraubenzieher entfernt werden
|
||||
tile.machine_crucible.name=Schmelztiegel
|
||||
tile.machine_crystallizer.name=Erzauflöser
|
||||
tile.machine_cyclotron.name=Zyklotron
|
||||
|
||||
@ -3291,6 +3291,7 @@ item.ore.asbestos=Asbestos
|
||||
item.ore.borax=Borax
|
||||
item.ore.chlorocalcite=Chlorocalcite
|
||||
item.ore.copper=Copper
|
||||
item.ore.fluorite=Fluorite
|
||||
item.ore.gold=Gold
|
||||
item.ore.iron=Iron
|
||||
item.ore.niobium=Niobium
|
||||
@ -4986,6 +4987,8 @@ tile.machine_condenser.name=Steam Condenser
|
||||
tile.machine_controller.name=Reactor Remote Control Block
|
||||
tile.machine_converter_he_rf.name=HE to RF Converter
|
||||
tile.machine_converter_rf_he.name=RF to HE Converter
|
||||
tile.machine_conveyor_press.name=Conveyor Press
|
||||
tile.machine_conveyor_press.desc=Conveyor moves left to right$Right click stamp to install$Use screwdriver to remove stamp
|
||||
tile.machine_crucible.name=Crucible
|
||||
tile.machine_crystallizer.name=Ore Acidizer
|
||||
tile.machine_cyclotron.name=Cyclotron
|
||||
|
||||
1042
src/main/resources/assets/hbm/models/machines/conveyor_press.obj
Normal file
1042
src/main/resources/assets/hbm/models/machines/conveyor_press.obj
Normal file
File diff suppressed because it is too large
Load Diff
Binary file not shown.
|
After Width: | Height: | Size: 546 B |
Binary file not shown.
|
After Width: | Height: | Size: 1.3 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 1.7 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 1.4 KiB |
Loading…
x
Reference in New Issue
Block a user