diff --git a/changelog b/changelog index 03232f545..9afc864be 100644 --- a/changelog +++ b/changelog @@ -1,62 +1,44 @@ ## Added -* Telex - * A basic message system using redstone over radio - * Allows messages to be sent at a rate of 20 characters per second - * Features things like text formatting, printing and the terminal bell -* Ground water pumps - * Come in steam-powered and electric variants - * Faster than their infinite barrel counterpart - * Need to be placed below Y:70 and on solid ground to work - * Compatible floor blocks include all dirt variants and sand, the pump will not work when placed on pure rock -* Schrabidate capacitor - * Can store 50GHE -* Express conveyor belts - * Work like regular single-lane conveyor belts but 3x faster -* Industrial smokestack - * An even larger smokestack, matching the size of the coker unit - * Reduced pollution by 90%, as opposed to the brick smokestack's 75% -* Power gauge - * Like the flow gauge pipe for cable networks - * Shows the total amount of power being transferred within the connected network -* Trenchmaster armor - * A new unique set of armor that is currently unobtainable - * Has new traits like faster reloads, a 33% chance of not using up ammo and step-assist +* Powered condenser + * A large form of the condenser that is 10x faster than the large cooling tower + * Needs 10HE per mB condensed (roughly 5% of the power output from steam, using industrial turbines) + * Allows for more compact setups, setups underground where cooling towers wouldn't fit, and ones with ridiculously high LPS throughput where multiple large cooling towers were necessary +* Transport drones + * Will move in a circular path between transport drone crates, loading and unloading either items or fluids + * Finally allows for automated long-range transport without ridiculously long conveyor belts or impractical pipelines + * Come in 4 variants, slow and express, each can be chunkloading or not + * To create a route, place crates in input and output mode, then add waypoints for avoiding obstacles, get a transport drone linker and click on each waypoint/crate in order, then shift-click to delete the last cached position from the linker (in order to not screw up future links) + * Waypoints can be adjusted in height, right click or shift-click to adjust the offset of the actual waypoint compared to the waypoint block. Make sure to adjust the waypoints before linking. + * Waypoints are unlimited in range, as all they do is tell drones "go to XYZ position", it's just necessary for the previous waypoint to be loaded during the linking process + * If there are no obstacles between the two crates, waypoints are entirely optional. +* Logistic drones + * An automated system that detects supply and demand and sends logistics drones to transport items + * Drone docks will detect logistics waypoints (different from transport waypoints!), providers and requesters in a 11x11 chunk range + * Docks, providers, requesters and waypoints will connect to each other automatically in a 5x5 chunk detection range with a maximum range of 24 blocks + * Logistics waypoints have an offset of 5 blocks which cannot be changed, unlike transport waypoints. The offset's direction obviously changes with the orientation of the waypoint block + * For debugging purposes, the connections are currently visible, this will be cchanged in the future + * Drones have a path depth of only 10 hops, pathfinding cannot go further than 10 waypoints/crates/docks + * Requests are created by requester crates if a request filter is set, and the requested item is not present in its buffer + * Provider offers are created automatically if a provider holds an item + * Docks will spawn a logistics drone if a drone is loaded (it can hold up to 9), the drone will path to the provider, then the requester, then back to the dock where it will try to jump back into its inventory + * A dock will randomly choose a provider-requester pair in its range every 5 seconds, to supply larger logistics networks, use more docks ## Changed * Updated russian localization -* The UAC pistol's UV now looks prettier -* The UAC pistol now fires a burst on right click -* CCGTs can no longer have smoke removed from them, on the count of there not being enough connections anyway. The pollution rate is now equivalent to three small furnaces -* The DFC receiver is now crafted with a block of DNT instead of sellafite corium, on the count of sellafite corium being near impossible to get -* Fireclay now has a third recipe, being craftable from clay, limestone and sand -* A whole clay block can now be combination smelted into a block of bricks -* The pipe clanking sound is now also used when placing regular pipes as opposed to only when pre-defined pipe items are used -* Josh now has a burst fire mode using RMB -* The smokestack's recipe has changed, now requiring a steel grate for catching ashes -* Simplified the decorated cobalt tool recipes, they now only require one cobalt tool and one hot bar of meteorite in an anvil -* Changed the starmetal tool recipes -* Cobalt armor is now crafted with steel armor and cobalt billets, making the armor substantially cheaper -* Sightly increased protection levels for the security armor and cobalt gear -* Cobalt, decorated cobalt and starmetal gear is now a lot more enchantable -* The ashpit now has a NEI handler, showing roughly how ash types are made -* Smokestacks now capture fly ash and are now compatible with ashpits -* Industrial smokestacks can also capture fine soot -* Reduced strings required for making coal filters, filters are now also available in tier 2 anvils -* Fireboxes and heating ovens can now be disassembled in tier 2 anvils, yielding most of the resources used for making them -* Signal beacons now only spawn half as often +* Retextured the groundwater pumps to be more NTM-like and less GTCE-like +* There is now a custom implementation used for falling block entities used by things like impulse grenades, the nuke's shockwave and anvils + * This should fix crashes caused by improper implementation of certain modded blocks not working with the falling block code + * This also makes it so that anvils render properly when falling + * The new falling blocks are a bit more janky and less smooth, most likely because of some hardcoded mojang hack that smoothens out the vanilla one that I couldn't find +* The redcoil capacitor has been reverted to use meta instead of NBT, making it easier to automate with meta-based filters ## Fixed -* Fixed the bomber not spawning if the chunkloading radios is too small -* Fixed a couple spelling mistakes like BFB fuel being called ZFB and the broken ZIRNOX -* Potentially fixed a compat issue where galacticraft moon soil isn't shreddable into NTM moon turf -* Hopefully fixed the disappearing fluid bug once and for all -* Fixed lag caused by the radiation system needlessly loading chunks -* Fixed secret folders giving volatile templates instead of persistent ones -* Fixed the ore dict registry happening in a later loading phase instead of PreInit which should fix some compatibility issues -* Hopefully fixed issue where the tom impact effects will last even when switching worlds -* Fixed logspam caused by custom machine crafting handler -* Fixed issue with the assemblers and chemplants where recipes with larger input requirements would break the input funnel -* Fixed crash caused by reloading when the ammo item is in the last slot -* Power and fluid networks will no longer transfer amounts less or equal than 0, preventing negative values and removing unnecessary operations where nothing would happen anyways -* Fixed bug where damage sources that bypass iframes would deal significantly more damage if the victim has taken a lot of damage prior -* Fixed duplicate balefire shell existing, the one that was usable was not the one that was craftable +* Fixed issue where for certain system locales, the thousand separator would display as an NBS which can't be rendered using mc's font renderer, yielding an ugly unknown glyph +* Fixed critical IO issue where assemblers and chemical plants would ignore side IO restrictions and import/export items from slots that they really shouldn't +* Combination ovens no longer produce soot when not in use +* The power detector now has the connection priority "HIGH", which should fix issues where they don't receive any power in larger networks due to their low network weight +* Fixed power gauge blocks sometimes crashing servers because of improper OC compat, the compat has been removed for the time being +* Fixed blocks with the "Any" ore dict prefix being shreddable, converting things from ore dict groups +* Fixed fusion reactor exploding into un-welded magnets, wasting tons of steel in the process +* Fixed assemblers not saving their power buffer or progress +* Fixed combined cycle gas turbine creating 25x more soot than it's supposed to diff --git a/gradle.properties b/gradle.properties index f918fa348..3bce5673c 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,6 +1,6 @@ mod_version=1.0.27 # Empty build number makes a release type -mod_build_number=4724 +mod_build_number=4739 credits=HbMinecraft, rodolphito (explosion algorithms), grangerave (explosion algorithms),\ \ Hoboy (textures, models), Doctor17 (russian localization), Drillgon200 (effects, models,\ diff --git a/src/main/java/com/hbm/config/WorldConfig.java b/src/main/java/com/hbm/config/WorldConfig.java index 7e389cec0..46add586c 100644 --- a/src/main/java/com/hbm/config/WorldConfig.java +++ b/src/main/java/com/hbm/config/WorldConfig.java @@ -26,8 +26,8 @@ public class WorldConfig { public static int cinnebarSpawn = 1; public static int oilcoalSpawn = 128; public static int gassshaleSpawn = 5; - public static int gasbubbleSpawn = 4; - public static int explosivebubbleSpawn = 8; + public static int gasbubbleSpawn = 12; + public static int explosivebubbleSpawn = 0; public static int cobaltSpawn = 2; public static int oilSpawn = 100; public static int bedrockOilSpawn = 200; @@ -133,10 +133,10 @@ public class WorldConfig { rareSpawn = CommonConfig.createConfigInt(config, CATEGORY_OREGEN, "2.14_rareEarthSpawnRate", "Amount of rare earth ore veins per chunk", 6); oilcoalSpawn = CommonConfig.createConfigInt(config, CATEGORY_OREGEN, "2.15_oilCoalSpawnRate", "Spawns an oily coal vein every nTH chunk", 128); gassshaleSpawn = CommonConfig.createConfigInt(config, CATEGORY_OREGEN, "2.16_gasShaleSpawnRate", "Amount of oil shale veins per chunk", 5); - gasbubbleSpawn = CommonConfig.createConfigInt(config, CATEGORY_OREGEN, "2.17_gasBubbleSpawnRate", "Spawns a gas bubble every nTH chunk", 4); + gasbubbleSpawn = CommonConfig.createConfigInt(config, CATEGORY_OREGEN, "2.17_gasBubbleSpawnRate", "Spawns a gas bubble every nTH chunk", 12); cinnebarSpawn = CommonConfig.createConfigInt(config, CATEGORY_OREGEN, "2.18_cinnebarSpawnRate", "Amount of cinnebar ore veins per chunk", 1); cobaltSpawn = CommonConfig.createConfigInt(config, CATEGORY_OREGEN, "2.18_cobaltSpawnRate", "Amount of cobalt ore veins per chunk", 2); - explosivebubbleSpawn = CommonConfig.createConfigInt(config, CATEGORY_OREGEN, "2.19_explosiveBubbleSpawnRate", "Spawns an explosive gas bubble every nTH chunk", 8); + explosivebubbleSpawn = CommonConfig.createConfigInt(config, CATEGORY_OREGEN, "2.19_explosiveBubbleSpawnRate", "Spawns an explosive gas bubble every nTH chunk", 0); alexandriteSpawn = CommonConfig.createConfigInt(config, CATEGORY_OREGEN, "2.20_alexandriteSpawnRate", "Spawns an alexandrite vein every nTH chunk", 100); oilSpawn = CommonConfig.createConfigInt(config, CATEGORY_OREGEN, "2.21_oilSpawnRate", "Spawns an oil bubble every nTH chunk", 100); bedrockOilSpawn = CommonConfig.createConfigInt(config, CATEGORY_OREGEN, "2.22_bedrockOilSpawnRate", "Spawns a bedrock oil node every nTH chunk", 200); diff --git a/src/main/java/com/hbm/entity/item/EntityDroneBase.java b/src/main/java/com/hbm/entity/item/EntityDroneBase.java index c27ab56d1..5cc0e4e97 100644 --- a/src/main/java/com/hbm/entity/item/EntityDroneBase.java +++ b/src/main/java/com/hbm/entity/item/EntityDroneBase.java @@ -55,7 +55,7 @@ public abstract class EntityDroneBase extends Entity { @Override protected boolean canTriggerWalking() { - return true; + return false; } @Override diff --git a/src/main/java/com/hbm/entity/item/EntityRequestDrone.java b/src/main/java/com/hbm/entity/item/EntityRequestDrone.java index 30d22ab20..0b5294516 100644 --- a/src/main/java/com/hbm/entity/item/EntityRequestDrone.java +++ b/src/main/java/com/hbm/entity/item/EntityRequestDrone.java @@ -4,6 +4,8 @@ import java.util.ArrayList; import java.util.List; import com.hbm.inventory.RecipesCommon.AStack; +import com.hbm.inventory.RecipesCommon.ComparableStack; +import com.hbm.inventory.RecipesCommon.OreDictStack; import com.hbm.items.ModItems; import com.hbm.items.tool.ItemDrone.EnumDroneType; import com.hbm.tileentity.network.TileEntityDroneDock; @@ -11,6 +13,7 @@ import com.hbm.tileentity.network.TileEntityDroneProvider; import com.hbm.tileentity.network.TileEntityDroneRequester; import com.hbm.util.fauxpointtwelve.BlockPos; +import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; @@ -42,7 +45,6 @@ public class EntityRequestDrone extends EntityDroneBase { if(nextActionTimer > 0) { nextActionTimer--; } else { - nextActionTimer = 5; if(program.isEmpty()) { this.setDead(); //self-destruct if no further operations are pending @@ -51,13 +53,11 @@ public class EntityRequestDrone extends EntityDroneBase { } Object next = program.get(0); - System.out.println("next action: " + next); program.remove(0); if(next instanceof BlockPos) { BlockPos pos = (BlockPos) next; this.setTarget(pos.getX() + 0.5, pos.getY(), pos.getZ() + 0.5); - System.out.println("targetting"); } else if(next instanceof AStack && heldItem == null) { AStack aStack = (AStack) next; @@ -72,13 +72,14 @@ public class EntityRequestDrone extends EntityDroneBase { if(stack != null && aStack.matchesRecipe(stack, true)) { this.heldItem = stack.copy(); this.setAppearance(1); + worldObj.playSoundEffect(posX, posY, posZ, "hbm:item.unpack", 0.5F, 0.75F); provider.slots[i] = null; provider.markDirty(); break; } } } - System.out.println("loading"); + nextActionTimer = 5; } else if(next == DroneProgram.UNLOAD && this.heldItem != null) { TileEntity tile = worldObj.getTileEntity((int) Math.floor(posX), (int) Math.floor(posY - 1), (int) Math.floor(posZ)); @@ -106,11 +107,12 @@ public class EntityRequestDrone extends EntityDroneBase { if(this.heldItem == null) { this.setAppearance(0); + worldObj.playSoundEffect(posX, posY, posZ, "hbm:item.unpack", 0.5F, 0.75F); } requester.markDirty(); } - System.out.println("unloading"); + nextActionTimer = 5; } else if(next == DroneProgram.DOCK) { TileEntity tile = worldObj.getTileEntity((int) Math.floor(posX), (int) Math.floor(posY - 1), (int) Math.floor(posZ)); @@ -121,6 +123,7 @@ public class EntityRequestDrone extends EntityDroneBase { if(dock.slots[i] == null) { this.setDead(); dock.slots[i] = new ItemStack(ModItems.drone, 1, EnumDroneType.REQUEST.ordinal()); + this.worldObj.playSoundEffect(dock.xCoord + 0.5, dock.yCoord + 0.5, dock.zCoord + 0.5, "hbm:block.storageClose", 2.0F, 1.0F); break; } } @@ -130,7 +133,6 @@ public class EntityRequestDrone extends EntityDroneBase { this.setDead(); this.entityDropItem(new ItemStack(ModItems.drone, 1, EnumDroneType.REQUEST.ordinal()), 1F); } - System.out.println("docking"); } } } @@ -144,17 +146,43 @@ public class EntityRequestDrone extends EntityDroneBase { @Override protected void readEntityFromNBT(NBTTagCompound nbt) { + super.readEntityFromNBT(nbt); if(nbt.hasKey("held")) { NBTTagCompound stack = nbt.getCompoundTag("held"); this.heldItem = ItemStack.loadItemStackFromNBT(stack); } + + nextActionTimer = 5; this.dataWatcher.updateObject(10, nbt.getByte("app")); + + int size = nbt.getInteger("programSize"); + + for(int i = 0; i < size; i++) { + NBTTagCompound data = nbt.getCompoundTag("program" + i); + String pType = data.getString("type"); + + if("pos".equals(pType)) { + int[] pos = data.getIntArray("pos"); + this.program.add(new BlockPos(pos[0], pos[1], pos[2])); + } else if("unload".equals(pType)) { + this.program.add(DroneProgram.UNLOAD); + } else if("dock".equals(pType)) { + this.program.add(DroneProgram.DOCK); + } else if("comp".equals(pType)) { + ComparableStack comp = new ComparableStack(Item.getItemById(nbt.getInteger("id")), 1, nbt.getInteger("meta")); + this.program.add(comp); + } else if("dict".equals(pType)) { + OreDictStack dict = new OreDictStack(nbt.getString("dict")); + this.program.add(dict); + } + } } @Override protected void writeEntityToNBT(NBTTagCompound nbt) { + super.writeEntityToNBT(nbt); if(heldItem != null) { NBTTagCompound stack = new NBTTagCompound(); @@ -163,5 +191,42 @@ public class EntityRequestDrone extends EntityDroneBase { } nbt.setByte("app", this.dataWatcher.getWatchableObjectByte(10)); + + int size = this.program.size(); + nbt.setInteger("programSize", size); + + for(int i = 0; i < size; i++) { + NBTTagCompound data = new NBTTagCompound(); + Object p = this.program.get(i); + + if(p instanceof BlockPos) { + BlockPos pos = (BlockPos) p; + data.setString("type", "pos"); + data.setIntArray("pos", new int[] {pos.getX(), pos.getY(), pos.getZ()}); + } else if(p instanceof AStack) { + + // neither of these wretched fungii works correctly, but so long as the pathing works (which it does), it means that the drone will + // eventually return to the dock and not got lost, and simply retry the task + if(p instanceof ComparableStack) { + ComparableStack comp = (ComparableStack) p; + data.setString("type", "comp"); + data.setInteger("id", Item.getIdFromItem(comp.item)); + data.setInteger("meta", comp.meta); + } else { + OreDictStack dict = (OreDictStack) p; + data.setString("type", "dict"); + data.setString("dict", dict.name); + } + + } else if(p == DroneProgram.UNLOAD) { + data.setString("type", "unload"); + + } else if(p == DroneProgram.DOCK) { + data.setString("type", "dock"); + + } + + nbt.setTag("program" + i, data); + } } } diff --git a/src/main/java/com/hbm/lib/RefStrings.java b/src/main/java/com/hbm/lib/RefStrings.java index 3df3c0458..26b7c4ac5 100644 --- a/src/main/java/com/hbm/lib/RefStrings.java +++ b/src/main/java/com/hbm/lib/RefStrings.java @@ -3,7 +3,7 @@ package com.hbm.lib; public class RefStrings { public static final String MODID = "hbm"; public static final String NAME = "Hbm's Nuclear Tech Mod"; - public static final String VERSION = "1.0.27 BETA (4724)"; + public static final String VERSION = "1.0.27 BETA (4739)"; //HBM's Beta Naming Convention: //V T (X) //V -> next release version diff --git a/src/main/java/com/hbm/main/CraftingManager.java b/src/main/java/com/hbm/main/CraftingManager.java index a45c039a8..936ab410b 100644 --- a/src/main/java/com/hbm/main/CraftingManager.java +++ b/src/main/java/com/hbm/main/CraftingManager.java @@ -29,6 +29,7 @@ import com.hbm.items.machine.ItemBattery; import com.hbm.items.special.ItemCircuitStarComponent.CircuitComponentType; import com.hbm.items.special.ItemHolotapeImage.EnumHoloImage; import com.hbm.items.special.ItemPlasticScrap.ScrapType; +import com.hbm.items.tool.ItemDrone.EnumDroneType; import com.hbm.items.tool.ItemGuideBook.BookType; import com.hbm.util.EnchantmentUtil; @@ -993,6 +994,23 @@ public class CraftingManager { 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 }); + + addRecipeAuto(new ItemStack(ModItems.drone, 1, EnumDroneType.PATROL.ordinal()), new Object[] { "PPP", "HCH", " B ", 'P', STEEL.plate(), 'H', ModItems.hull_small_steel, 'C', ModItems.circuit_copper, 'B', ModBlocks.crate_steel }); + addRecipeAuto(new ItemStack(ModItems.drone, 1, EnumDroneType.PATROL_CHUNKLOADING.ordinal()), new Object[] { "E", "D", 'E', Items.ender_pearl, 'D', new ItemStack(ModItems.drone, 1, EnumDroneType.PATROL.ordinal()) }); + addRecipeAuto(new ItemStack(ModItems.drone, 1, EnumDroneType.PATROL_EXPRESS.ordinal()), new Object[] { " P ", "KDK", " P ", 'P', ModItems.plate_desh, 'K', Fluids.KEROSENE.getDict(1_000), 'D', new ItemStack(ModItems.drone, 1, EnumDroneType.PATROL.ordinal()) }); + addRecipeAuto(new ItemStack(ModItems.drone, 1, EnumDroneType.PATROL_EXPRESS_CHUNKLOADING.ordinal()), new Object[] { "E", "D", 'E', Items.ender_pearl, 'D', new ItemStack(ModItems.drone, 1, EnumDroneType.PATROL_EXPRESS.ordinal()) }); + addRecipeAuto(new ItemStack(ModItems.drone, 1, EnumDroneType.PATROL_EXPRESS_CHUNKLOADING.ordinal()), new Object[] { " P ", "KDK", " P ", 'P', ModItems.plate_desh, 'K', Fluids.KEROSENE.getDict(1_000), 'D', new ItemStack(ModItems.drone, 1, EnumDroneType.PATROL_CHUNKLOADING.ordinal()) }); + addShapelessAuto(new ItemStack(ModItems.drone, 1, EnumDroneType.PATROL.ordinal()), new Object[] { new ItemStack(ModItems.drone, 1, EnumDroneType.PATROL_CHUNKLOADING.ordinal()) }); + addShapelessAuto(new ItemStack(ModItems.drone, 1, EnumDroneType.PATROL_EXPRESS.ordinal()), new Object[] { new ItemStack(ModItems.drone, 1, EnumDroneType.PATROL_EXPRESS_CHUNKLOADING.ordinal()) }); + addRecipeAuto(new ItemStack(ModItems.drone, 1, EnumDroneType.REQUEST.ordinal()), new Object[] { "E", "D", 'E', ModItems.circuit_red_copper, 'D', new ItemStack(ModItems.drone, 1, EnumDroneType.PATROL_EXPRESS.ordinal()) }); + + addRecipeAuto(new ItemStack(ModItems.drone_linker), new Object[] { "T", "C", 'T', ModBlocks.drone_waypoint, 'C', ModItems.circuit_copper }); + addRecipeAuto(new ItemStack(ModBlocks.drone_waypoint, 4), new Object[] { "G", "T", "C", 'G', KEY_GREEN, 'T', Blocks.redstone_torch, 'C', ModItems.circuit_aluminium }); + addRecipeAuto(new ItemStack(ModBlocks.drone_crate), new Object[] { "T", "C", 'T', ModBlocks.drone_waypoint, 'C', ModBlocks.crate_steel }); + addRecipeAuto(new ItemStack(ModBlocks.drone_waypoint_request, 4), new Object[] { "G", "T", "C", 'G', KEY_BLUE, 'T', Blocks.redstone_torch, 'C', ModItems.circuit_copper }); + addRecipeAuto(new ItemStack(ModBlocks.drone_crate), new Object[] { "T", "C", "B", 'T', ModBlocks.drone_waypoint_request, 'C', ModBlocks.crate_steel, 'B', ModItems.circuit_red_copper }); + addRecipeAuto(new ItemStack(ModBlocks.drone_crate_requester), new Object[] { "T", "C", "B", 'T', ModBlocks.drone_waypoint_request, 'C', ModBlocks.crate_steel, 'B', KEY_YELLOW }); + addRecipeAuto(new ItemStack(ModBlocks.drone_crate_provider), new Object[] { "T", "C", "B", 'T', ModBlocks.drone_waypoint_request, 'C', ModBlocks.crate_steel, 'B', KEY_ORANGE }); 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) }); diff --git a/src/main/java/com/hbm/tileentity/machine/TileEntityMachineTurbineGas.java b/src/main/java/com/hbm/tileentity/machine/TileEntityMachineTurbineGas.java index 32d1df24d..b506f3f6b 100644 --- a/src/main/java/com/hbm/tileentity/machine/TileEntityMachineTurbineGas.java +++ b/src/main/java/com/hbm/tileentity/machine/TileEntityMachineTurbineGas.java @@ -300,7 +300,7 @@ public class TileEntityMachineTurbineGas extends TileEntityMachineBase implement } double consumption = fuelMaxCons.containsKey(tanks[0].getTankType()) ? fuelMaxCons.get(tanks[0].getTankType()) : 5D; - if(worldObj.getTotalWorldTime() % 20 == 0 && tanks[0].getTankType() != Fluids.OXYHYDROGEN) PollutionHandler.incrementPollution(worldObj, xCoord, yCoord, zCoord, PollutionType.SOOT, 3F); + if(worldObj.getTotalWorldTime() % 20 == 0 && tanks[0].getTankType() != Fluids.OXYHYDROGEN) PollutionHandler.incrementPollution(worldObj, xCoord, yCoord, zCoord, PollutionType.SOOT, PollutionHandler.SOOT_PER_SECOND * 3); makePower(consumption, throttle); } diff --git a/src/main/java/com/hbm/tileentity/machine/storage/TileEntityBarrel.java b/src/main/java/com/hbm/tileentity/machine/storage/TileEntityBarrel.java index ac0cd0be4..495f38ca6 100644 --- a/src/main/java/com/hbm/tileentity/machine/storage/TileEntityBarrel.java +++ b/src/main/java/com/hbm/tileentity/machine/storage/TileEntityBarrel.java @@ -110,8 +110,10 @@ public class TileEntityBarrel extends TileEntityMachineBase implements IFluidAcc this.sendingBrake = false; age++; - if(age >= 20) + if(age >= 20) { age = 0; + this.markChanged(); + } if((mode == 1 || mode == 2) && (age == 9 || age == 19)) fillFluidInit(tank.getTankType()); diff --git a/src/main/java/com/hbm/tileentity/machine/storage/TileEntityMachineFluidTank.java b/src/main/java/com/hbm/tileentity/machine/storage/TileEntityMachineFluidTank.java index ec0d5ae57..00486dfda 100644 --- a/src/main/java/com/hbm/tileentity/machine/storage/TileEntityMachineFluidTank.java +++ b/src/main/java/com/hbm/tileentity/machine/storage/TileEntityMachineFluidTank.java @@ -113,8 +113,10 @@ public class TileEntityMachineFluidTank extends TileEntityMachineBase implements if(!hasExploded) { age++; - if(age >= 20) + if(age >= 20) { age = 0; + this.markChanged(); + } this.sendingBrake = true; tank.setFill(TileEntityBarrel.transmitFluidFairly(worldObj, tank, this, tank.getFill(), this.mode == 0 || this.mode == 1, this.mode == 1 || this.mode == 2, getConPos())); diff --git a/src/main/java/com/hbm/tileentity/network/RequestNetwork.java b/src/main/java/com/hbm/tileentity/network/RequestNetwork.java index cb1116004..8f98a9eb6 100644 --- a/src/main/java/com/hbm/tileentity/network/RequestNetwork.java +++ b/src/main/java/com/hbm/tileentity/network/RequestNetwork.java @@ -76,8 +76,24 @@ public class RequestNetwork { this.reachableNodes = new HashedSet(reachableNodes); this.lease = System.currentTimeMillis(); } + @Override public int hashCode() { return pos.hashCode(); } - @Override public boolean equals(Object o) { return pos.equals(o); } + @Override public boolean equals(Object toCompare) { + if(this == toCompare) { + return true; + } else if(!(toCompare instanceof PathNode)) { + return false; + } else { + PathNode node = (PathNode) toCompare; + if(this.pos.getX() != node.pos.getX()) { + return false; + } else if(this.pos.getY() != node.pos.getY()) { + return false; + } else { + return this.pos.getZ() == node.pos.getZ(); + } + } + } } /** Node created by providers, lists available items */ diff --git a/src/main/java/com/hbm/tileentity/network/TileEntityDroneCrate.java b/src/main/java/com/hbm/tileentity/network/TileEntityDroneCrate.java index eb530096d..8a304914c 100644 --- a/src/main/java/com/hbm/tileentity/network/TileEntityDroneCrate.java +++ b/src/main/java/com/hbm/tileentity/network/TileEntityDroneCrate.java @@ -114,6 +114,7 @@ public class TileEntityDroneCrate extends TileEntityMachineBase implements IGUIP if(loaded) { this.markDirty(); drone.setAppearance(1); + worldObj.playSoundEffect(xCoord + 0.5, yCoord + 0.5, zCoord + 0.5, "hbm:item.unpack", 0.5F, 0.75F); } } @@ -136,7 +137,10 @@ public class TileEntityDroneCrate extends TileEntityMachineBase implements IGUIP this.markDirty(); - if(emptied) drone.setAppearance(0); + if(emptied) { + drone.setAppearance(0); + worldObj.playSoundEffect(xCoord + 0.5, yCoord + 0.5, zCoord + 0.5, "hbm:item.unpack", 0.5F, 0.75F); + } } protected void loadFluid(EntityDeliveryDrone drone) { @@ -147,6 +151,7 @@ public class TileEntityDroneCrate extends TileEntityMachineBase implements IGUIP drone.fluid = new FluidStack(tank.getTankType(), tank.getFill()); this.tank.setFill(0); drone.setAppearance(2); + worldObj.playSoundEffect(xCoord + 0.5, yCoord + 0.5, zCoord + 0.5, "hbm:item.unpack", 0.5F, 0.75F); this.markDirty(); } @@ -167,6 +172,7 @@ public class TileEntityDroneCrate extends TileEntityMachineBase implements IGUIP tank.setFill(tank.getMaxFill()); drone.fluid.fill = overshoot; } + worldObj.playSoundEffect(xCoord + 0.5, yCoord + 0.5, zCoord + 0.5, "hbm:item.unpack", 0.5F, 0.75F); this.markDirty(); } diff --git a/src/main/java/com/hbm/tileentity/network/TileEntityDroneDock.java b/src/main/java/com/hbm/tileentity/network/TileEntityDroneDock.java index 3aa212846..82b6b93f0 100644 --- a/src/main/java/com/hbm/tileentity/network/TileEntityDroneDock.java +++ b/src/main/java/com/hbm/tileentity/network/TileEntityDroneDock.java @@ -28,7 +28,7 @@ import net.minecraft.world.World; public class TileEntityDroneDock extends TileEntityRequestNetworkContainer implements IGUIProvider { - public static final int pathingDepth = 5; + public static final int pathingDepth = 10; public TileEntityDroneDock() { super(9); @@ -122,6 +122,7 @@ public class TileEntityDroneDock extends TileEntityRequestNetworkContainer imple drone.program.add(DroneProgram.DOCK); worldObj.spawnEntityInWorld(drone); + this.worldObj.playSoundEffect(xCoord + 0.5, yCoord + 0.5, zCoord + 0.5, "hbm:block.storageOpen", 2.0F, 1.0F); return true; } diff --git a/src/main/java/com/hbm/tileentity/network/TileEntityDroneRequester.java b/src/main/java/com/hbm/tileentity/network/TileEntityDroneRequester.java index b3a7a942d..75ff11bf5 100644 --- a/src/main/java/com/hbm/tileentity/network/TileEntityDroneRequester.java +++ b/src/main/java/com/hbm/tileentity/network/TileEntityDroneRequester.java @@ -74,6 +74,18 @@ public class TileEntityDroneRequester extends TileEntityRequestNetworkContainer public boolean canExtractItem(int i, ItemStack stack, int j) { return true; } + + @Override + public void readFromNBT(NBTTagCompound nbt) { + super.readFromNBT(nbt); + this.matcher.readFromNBT(nbt); + } + + @Override + public void writeToNBT(NBTTagCompound nbt) { + super.writeToNBT(nbt); + this.matcher.writeToNBT(nbt); + } @Override public Container provideContainer(int ID, EntityPlayer player, World world, int x, int y, int z) { diff --git a/src/main/java/com/hbm/tileentity/network/TileEntityRequestNetwork.java b/src/main/java/com/hbm/tileentity/network/TileEntityRequestNetwork.java index 4e385f5d1..3e241d394 100644 --- a/src/main/java/com/hbm/tileentity/network/TileEntityRequestNetwork.java +++ b/src/main/java/com/hbm/tileentity/network/TileEntityRequestNetwork.java @@ -3,15 +3,11 @@ package com.hbm.tileentity.network; import java.util.HashMap; import java.util.Iterator; -import com.hbm.packet.AuxParticlePacketNT; -import com.hbm.packet.PacketDispatcher; import com.hbm.tileentity.network.RequestNetwork.PathNode; import com.hbm.util.HashedSet; import com.hbm.util.ParticleUtil; import com.hbm.util.fauxpointtwelve.BlockPos; -import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint; -import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.MovingObjectPosition; import net.minecraft.util.Vec3; @@ -59,18 +55,19 @@ public abstract class TileEntityRequestNetwork extends TileEntity { // draw debug crap for(PathNode known : knownNodes) { - ParticleUtil.spawnDebugLine(worldObj, + if(reachableNodes.contains(known)) ParticleUtil.spawnDebugLine(worldObj, pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5, (known.pos.getX() - pos.getX()) / 2D, (known.pos.getY() - pos.getY()) / 2D, (known.pos.getZ() - pos.getZ()) / 2D, reachableNodes.contains(known) ? 0x00ff00 : 0xff0000); } - NBTTagCompound data = new NBTTagCompound(); + /*NBTTagCompound data = new NBTTagCompound(); data.setString("type", "debug"); data.setInteger("color", 0x0000ff); data.setFloat("scale", 1.5F); data.setString("text", knownNodes.size() + " / " + reachableNodes.size() + " / " + localNodes.size()); PacketDispatcher.wrapper.sendToAllAround(new AuxParticlePacketNT(data, pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5), new TargetPoint(this.worldObj.provider.dimensionId, xCoord, yCoord, zCoord, 50)); + */ //both following checks run the `hasPath` function which is costly, so it only runs one op at a time diff --git a/src/main/java/com/hbm/util/HashedSet.java b/src/main/java/com/hbm/util/HashedSet.java index 861862206..cdb13cdee 100644 --- a/src/main/java/com/hbm/util/HashedSet.java +++ b/src/main/java/com/hbm/util/HashedSet.java @@ -9,10 +9,13 @@ import java.util.Set; import org.apache.commons.lang3.NotImplementedException; /** - * Through whichever mechanism, HashSets allow for multiple instances with the same hash, even though they already has that hash during instantiation - * How is this possible? I don't know and I don't want to know. + * A crude implementation of the HashSet with a few key differences: + * - instead of being stored as the key, the objects are stored as values in the underlying HashMap with the hash being the key + * - consequently, things with matching hash are considered the same, skipping the equals check + * - no equals check means that collisions are possible, so be careful + * - the underlying HashMap is accessible, which means that the instances can be grabbed out of the HashedSet if a hash is supplied * - * This is a crude recreation using a HashMap and, instead of whichever braindead bullshit HashSet does, this HashMap uses the hashCode() as the key and the object as the value. + * This sack of crap was only intended for the drone request network code * * @author hbm * diff --git a/src/main/java/com/hbm/util/fauxpointtwelve/BlockPos.java b/src/main/java/com/hbm/util/fauxpointtwelve/BlockPos.java index c09a2dcc6..0113b4817 100644 --- a/src/main/java/com/hbm/util/fauxpointtwelve/BlockPos.java +++ b/src/main/java/com/hbm/util/fauxpointtwelve/BlockPos.java @@ -69,10 +69,10 @@ public class BlockPos { return this.z; } - /** 1.12 vanilla implementation */ + /** modified 1.12 vanilla implementation */ @Override public int hashCode() { - return (this.getY() + this.getZ() * 31) * 31 + this.getX(); + return (this.getY() + this.getZ() * 27644437) * 27644437 + this.getX(); } @Override diff --git a/src/main/resources/assets/hbm/lang/de_DE.lang b/src/main/resources/assets/hbm/lang/de_DE.lang index 27a103ca0..e4131a9d4 100644 --- a/src/main/resources/assets/hbm/lang/de_DE.lang +++ b/src/main/resources/assets/hbm/lang/de_DE.lang @@ -309,6 +309,10 @@ container.dfcStabilizer=DFC-Stabilisator container.dfc_core=Dunkler Fusionskern container.diFurnace=Hochofen container.diFurnaceRTG=Atomarer Hochofen +container.droneCrate=Transportdronen-Kiste +container.droneDock=Dock +container.droneProvider=Anbieter +container.droneRequester=Abnehmer container.electricFurnace=Elektrischer Ofen container.epress=Hydraulische Presse container.factoryAdvanced=Fortgeschrittene Fabrik @@ -1703,6 +1707,12 @@ item.drillbit_steel_diamond.name=Stahl-Bohrspitze (Diamantbeschichtung) item.drillbit_tcalloy.name=Technetiumstahl-Bohrspitze item.drillbit_tcalloy_diamond.name=Technetiumstahl-Bohrspitze (Diamantbeschichtung) item.drill_titanium.name=Titanbohrer +item.drone.patrol.name=Transportdrone +item.drone.patrol_chunkloading.name=Chunkladende Transportdrone +item.drone.patrol_express.name=Express-Transportdrone +item.drone.patrol_express_chunkloading.name=Chunkladende Express-Transportdrone +item.drone.request.name=Logistikdrone +item.drone_linker.name=Transportdronen-Linker item.ducttape.name=Klebeband item.dust.name=Staub item.dynosphere_base.name=Blanke Dynosphere @@ -3825,6 +3835,12 @@ tile.dfc_stabilizer.name=DFC-Stabilisator tile.dirt_dead.name=Tote Erde tile.dirt_oily.name=Ölige Erde tile.drill_pipe.name=Bohrgestänge +tile.drone_crate.name=Transportdronen-Kiste +tile.drone_crate_provider.name=Logistik-Anbieterkiste +tile.drone_crate_requester.name=Logistik-Abnehmerkiste +tile.drone_dock.name=Logistikdronen-Dock +tile.drone_waypoint.name=Transportdronen-Wegpunkt +tile.drone_waypoint_request.name=Logistikdronen-Wegpunkt tile.door_bunker.name=Bunkertür tile.door_metal.name=Metalltür tile.door_office.name=Bürotür diff --git a/src/main/resources/assets/hbm/lang/en_US.lang b/src/main/resources/assets/hbm/lang/en_US.lang index 06a1b2a17..be8530bcf 100644 --- a/src/main/resources/assets/hbm/lang/en_US.lang +++ b/src/main/resources/assets/hbm/lang/en_US.lang @@ -666,6 +666,10 @@ container.dfcReceiver=DFC Receiver container.dfcStabilizer=DFC Stabilizer container.diFurnace=Blast Furnace container.diFurnaceRTG=Nuclear Blast Furnace +container.droneCrate=Transport Drone Crate +container.droneDock=Dock +container.droneProvider=Provider +container.droneRequester=Requester container.electricFurnace=Electric Furnace container.epress=Electric Press container.factoryAdvanced=Advanced Factory @@ -2386,6 +2390,9 @@ item.door_bunker.name=Bunker Door item.door_metal.name=Metal Door item.door_office.name=Office Door item.dosimeter.name=Dosimeter +item.drax.name=Terra Drill +item.drax_mk2.name=Hardened Terra Drill +item.drax_mk3.name=Schrabidic Terra Drill item.drillbit_desh.name=Desh Drillbit item.drillbit_desh_diamond.name=Desh Drillbit (Diamond-Tipped) item.drillbit_ferro.name=Ferrouranium Drillbit @@ -2397,9 +2404,12 @@ item.drillbit_steel_diamond.name=Steel Drillbit (Diamond-Tipped) item.drillbit_tcalloy.name=Technetium Steel Drillbit item.drillbit_tcalloy_diamond.name=Technetium Steel Drillbit (Diamond-Tipped) item.drill_titanium.name=Titanium Drill -item.drax.name=Terra Drill -item.drax_mk2.name=Hardened Terra Drill -item.drax_mk3.name=Schrabidic Terra Drill +item.drone.patrol.name=Transport Drone +item.drone.patrol_chunkloading.name=Chunkloading Transport Drone +item.drone.patrol_express.name=Express Transport Drone +item.drone.patrol_express_chunkloading.name=Chunkloading Express Transport Drone +item.drone.request.name=Logistics Drone +item.drone_linker.name=Transport Drone Linker item.ducttape.name=Duct Tape item.dust.name=Dust item.dust.desc=I hate dust! @@ -4794,6 +4804,13 @@ tile.dfc_stabilizer.name=DFC Stabilizer tile.dirt_dead.name=Dead Dirt tile.dirt_oily.name=Oily Dirt tile.drill_pipe.name=Drill Pipe +tile.drone_crate.name=Transport Drone Crate +tile.drone_crate_provider.name=Logistics Provider Crate +tile.drone_crate_requester.name=Logistics Requester Crate +tile.drone_dock.name=Logistics Drone Dock +tile.drone_waypoint.name=Transport Drone Waypoint +tile.drone_waypoint.desc=Waypoint for transport drones$Use a transport drone linker to set the path$Click on each waypoint and crate in sequence to create the path,$then shift-click to clear the saved position$Right-click or shift-click the waypoint to change the waypoint's offset +tile.drone_waypoint_request.name=Logistics Drone Waypoint tile.door_bunker.name=Bunker Door tile.door_metal.name=Metal Door tile.door_office.name=Office Door diff --git a/src/main/resources/assets/hbm/textures/models/machines/drone.png b/src/main/resources/assets/hbm/textures/models/machines/drone.png index 3e55db165..66c3240ba 100644 Binary files a/src/main/resources/assets/hbm/textures/models/machines/drone.png and b/src/main/resources/assets/hbm/textures/models/machines/drone.png differ diff --git a/src/main/resources/assets/hbm/textures/models/machines/drone_express.png b/src/main/resources/assets/hbm/textures/models/machines/drone_express.png index e21509910..af1d99522 100644 Binary files a/src/main/resources/assets/hbm/textures/models/machines/drone_express.png and b/src/main/resources/assets/hbm/textures/models/machines/drone_express.png differ diff --git a/src/main/resources/assets/hbm/textures/models/machines/drone_request.png b/src/main/resources/assets/hbm/textures/models/machines/drone_request.png index 082c3f67d..314d79655 100644 Binary files a/src/main/resources/assets/hbm/textures/models/machines/drone_request.png and b/src/main/resources/assets/hbm/textures/models/machines/drone_request.png differ