From 4972f4023a16ab00d30894aeefe0cc0ffa4d6d70 Mon Sep 17 00:00:00 2001 From: Boblet Date: Tue, 11 Feb 2025 16:46:14 +0100 Subject: [PATCH] thorn glognuts for only 5 bintar --- changelog | 3 + .../java/com/hbm/crafting/ToolRecipes.java | 5 +- .../com/hbm/handler/BobmazonOfferFactory.java | 144 ++------- .../hbm/inventory/gui/GUIScreenBobmazon.java | 283 +++++++++--------- src/main/java/com/hbm/items/ModItems.java | 15 +- .../java/com/hbm/items/tool/ItemCatalog.java | 6 +- src/main/java/com/hbm/main/MainRegistry.java | 4 + .../packet/toserver/ItemBobmazonPacket.java | 30 +- src/main/java/com/hbm/uninos/GenNode.java | 18 +- .../java/com/hbm/uninos/INetworkProvider.java | 5 + src/main/java/com/hbm/uninos/INodeNet.java | 2 +- .../java/com/hbm/uninos/UniNodespace.java | 55 ++-- .../networkproviders/PowerProvider.java | 13 + .../com/hbm/uninos/networks/PowerNetwork.java | 16 + src/main/java/com/hbm/util/Tuple.java | 8 +- src/main/resources/assets/hbm/lang/de_DE.lang | 1 + src/main/resources/assets/hbm/lang/en_US.lang | 1 + .../assets/hbm/textures/gui/gui_bobmazon.png | Bin 4226 -> 4181 bytes .../assets/hbm/textures/items/bobmazon.png | Bin 344 -> 363 bytes .../hbm/textures/items/bobmazon_machines.png | Bin 344 -> 0 bytes .../hbm/textures/items/bobmazon_materials.png | Bin 356 -> 0 bytes .../hbm/textures/items/bobmazon_tools.png | Bin 362 -> 0 bytes .../hbm/textures/items/bobmazon_weapons.png | Bin 335 -> 0 bytes 23 files changed, 259 insertions(+), 350 deletions(-) create mode 100644 src/main/java/com/hbm/uninos/networkproviders/PowerProvider.java create mode 100644 src/main/java/com/hbm/uninos/networks/PowerNetwork.java delete mode 100644 src/main/resources/assets/hbm/textures/items/bobmazon_machines.png delete mode 100644 src/main/resources/assets/hbm/textures/items/bobmazon_materials.png delete mode 100644 src/main/resources/assets/hbm/textures/items/bobmazon_tools.png delete mode 100644 src/main/resources/assets/hbm/textures/items/bobmazon_weapons.png diff --git a/changelog b/changelog index 9a1af5f24..c7046e5fb 100644 --- a/changelog +++ b/changelog @@ -12,6 +12,9 @@ * Meteorite dungeons now use a new structure system * The rooms have been completely changed, and the dungeons are no longer single-level with fixed room sizes * Dungeons no longer lag the game to hell when generating +* Decimated bobmazon + * All books have been merged into one with way fewer offers + * Sells things like basic gear, MREs, plushies, snow globes, and certain things only found in worldgen like jungle tree saplings and NTM flowers (including mustard willow) ## Fixed * Fixed items being annihilated when shift clicking them into the particle source diff --git a/src/main/java/com/hbm/crafting/ToolRecipes.java b/src/main/java/com/hbm/crafting/ToolRecipes.java index 113b4c80a..b56361021 100644 --- a/src/main/java/com/hbm/crafting/ToolRecipes.java +++ b/src/main/java/com/hbm/crafting/ToolRecipes.java @@ -163,10 +163,7 @@ public class ToolRecipes { CraftingManager.addRecipeAuto(new ItemStack(ModItems.boltgun), new Object[] { "DPS", " RD", " D ", 'D', DURA.ingot(), 'P', DictFrame.fromOne(ModItems.part_generic, EnumPartType.PISTON_PNEUMATIC), 'R', RUBBER.ingot(), 'S', STEEL.shell() }); //Bobmazon - CraftingManager.addShapelessAuto(new ItemStack(ModItems.bobmazon_materials), new Object[] { Items.book, Items.gold_nugget, Items.string }); - CraftingManager.addShapelessAuto(new ItemStack(ModItems.bobmazon_machines), new Object[] { Items.book, Items.gold_nugget, KEY_RED }); - CraftingManager.addShapelessAuto(new ItemStack(ModItems.bobmazon_weapons), new Object[] { Items.book, Items.gold_nugget, KEY_GRAY }); - CraftingManager.addShapelessAuto(new ItemStack(ModItems.bobmazon_tools), new Object[] { Items.book, Items.gold_nugget, KEY_GREEN }); + CraftingManager.addShapelessAuto(new ItemStack(ModItems.bobmazon), new Object[] { Items.book, Items.gold_nugget, Items.string, KEY_BLUE }); //Carts CraftingManager.addRecipeAuto(ItemModMinecart.createCartItem(EnumCartBase.WOOD, EnumMinecart.EMPTY), new Object[] { "P P", "WPW", 'P',KEY_SLAB, 'W', KEY_PLANKS }); diff --git a/src/main/java/com/hbm/handler/BobmazonOfferFactory.java b/src/main/java/com/hbm/handler/BobmazonOfferFactory.java index 26fcfd55b..e0b3c4560 100644 --- a/src/main/java/com/hbm/handler/BobmazonOfferFactory.java +++ b/src/main/java/com/hbm/handler/BobmazonOfferFactory.java @@ -4,6 +4,10 @@ import java.util.ArrayList; import java.util.List; import com.hbm.blocks.ModBlocks; +import com.hbm.blocks.generic.BlockConcreteColoredExt.EnumConcreteType; +import com.hbm.blocks.generic.BlockNTMFlower.EnumFlowerType; +import com.hbm.blocks.generic.BlockPlushie.PlushieType; +import com.hbm.blocks.generic.BlockSnowglobe.SnowglobeType; import com.hbm.inventory.fluid.Fluids; import com.hbm.inventory.gui.GUIScreenBobmazon.Offer; import com.hbm.inventory.gui.GUIScreenBobmazon.Requirement; @@ -14,124 +18,38 @@ import com.hbm.items.special.ItemKitCustom; import com.hbm.items.special.ItemKitNBT; import com.hbm.items.weapon.sedna.factory.GunFactory.EnumAmmo; +import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; public class BobmazonOfferFactory { - public static List materials = new ArrayList(); - public static List machines = new ArrayList(); - public static List weapons = new ArrayList(); - public static List tools = new ArrayList(); + public static List standard = new ArrayList(); public static List special = new ArrayList(); public static void init() { - materials.clear(); - machines.clear(); - weapons.clear(); - tools.clear(); + standard.clear(); special.clear(); - int inflation = 5; - materials.add(new Offer(new ItemStack(ModItems.ingot_uranium), Requirement.NUCLEAR, 6 * inflation)); - materials.add(new Offer(new ItemStack(ModItems.ingot_u233), Requirement.NUCLEAR, 20 * inflation)); - materials.add(new Offer(new ItemStack(ModItems.ingot_u238), Requirement.NUCLEAR, 15 * inflation)); - materials.add(new Offer(new ItemStack(ModItems.ingot_th232), Requirement.NUCLEAR, 4 * inflation)); - materials.add(new Offer(new ItemStack(ModItems.ingot_plutonium), Requirement.NUCLEAR, 25 * inflation)); - materials.add(new Offer(new ItemStack(ModItems.ingot_titanium), Requirement.STEEL, 2 * inflation)); - materials.add(new Offer(new ItemStack(ModItems.ingot_copper), Requirement.STEEL, 2 * inflation)); - materials.add(new Offer(new ItemStack(ModItems.ingot_red_copper), Requirement.STEEL, 4 * inflation)); - materials.add(new Offer(new ItemStack(ModItems.ingot_tungsten), Requirement.STEEL, 3 * inflation)); - materials.add(new Offer(new ItemStack(ModItems.ingot_aluminium), Requirement.STEEL, 2 * inflation)); - materials.add(new Offer(new ItemStack(ModItems.ingot_steel), Requirement.STEEL, 4 * inflation)); - materials.add(new Offer(new ItemStack(ModItems.ingot_lead), Requirement.STEEL, 2 * inflation)); - materials.add(new Offer(new ItemStack(ModItems.ingot_polymer), Requirement.OIL, 8 * inflation)); - materials.add(new Offer(new ItemStack(ModItems.ingot_uranium_fuel), Requirement.NUCLEAR, 18 * inflation)); - materials.add(new Offer(new ItemStack(ModItems.ingot_thorium_fuel), Requirement.NUCLEAR, 16 * inflation)); - materials.add(new Offer(new ItemStack(ModItems.ingot_desh), Requirement.OIL, 16 * inflation)); - materials.add(new Offer(new ItemStack(ModItems.ingot_saturnite), Requirement.STEEL, 8 * inflation)); - materials.add(new Offer(new ItemStack(ModItems.lithium), Requirement.CHEMICS, 6 * inflation)); - materials.add(new Offer(new ItemStack(ModItems.solid_fuel), Requirement.OIL, 4 * inflation)); - materials.add(new Offer(new ItemStack(ModItems.lignite), Requirement.STEEL, 2 * inflation)); - materials.add(new Offer(new ItemStack(ModItems.canister_full, 1, Fluids.OIL.getID()), Requirement.OIL, 4 * inflation)); - materials.add(new Offer(new ItemStack(ModItems.canister_full, 1, Fluids.DIESEL.getID()), Requirement.OIL, 16 * inflation)); - materials.add(new Offer(new ItemStack(ModItems.canister_full, 1, Fluids.PETROIL.getID()), Requirement.OIL, 12 * inflation)); - materials.add(new Offer(new ItemStack(ModItems.canister_full, 1, Fluids.GASOLINE.getID()), Requirement.OIL, 20 * inflation)); - materials.add(new Offer(new ItemStack(ModItems.canister_full, 1, Fluids.KEROSENE.getID()), Requirement.OIL, 20 * inflation)); - materials.add(new Offer(new ItemStack(ModItems.canister_full, 1, Fluids.NITAN.getID()), Requirement.OIL, 100 * inflation)); - materials.add(new Offer(new ItemStack(ModItems.gas_full, 1, Fluids.PETROLEUM.getID()), Requirement.OIL, 8 * inflation)); - materials.add(new Offer(new ItemStack(ModItems.motor), Requirement.ASSEMBLY, 12 * inflation)); - materials.add(new Offer(new ItemStack(ModItems.rtg_unit), Requirement.NUCLEAR, 25 * inflation)); - materials.add(new Offer(new ItemStack(ModItems.pellet_gas), Requirement.CHEMICS, 4 * inflation)); - materials.add(new Offer(new ItemStack(ModItems.magnetron), Requirement.ASSEMBLY, 10 * inflation)); - materials.add(new Offer(new ItemStack(ModItems.pellet_rtg), Requirement.NUCLEAR, 27 * inflation)); - materials.add(new Offer(new ItemStack(ModItems.piston_selenium), Requirement.ASSEMBLY, 12 * inflation)); - materials.add(new Offer(ItemBattery.getFullBattery(ModItems.battery_advanced), Requirement.ASSEMBLY, 15 * inflation)); - materials.add(new Offer(ItemBattery.getFullBattery(ModItems.battery_lithium), Requirement.CHEMICS, 30 * inflation)); - materials.add(new Offer(new ItemStack(ModItems.arc_electrode), Requirement.ASSEMBLY, 15 * inflation)); - materials.add(new Offer(new ItemStack(ModItems.fuse), Requirement.ASSEMBLY, 5 * inflation)); - - machines.add(new Offer(new ItemStack(ModBlocks.concrete_smooth, 16), Requirement.CHEMICS, 32 * inflation)); - machines.add(new Offer(new ItemStack(ModBlocks.brick_compound, 8), Requirement.CHEMICS, 48 * inflation)); - machines.add(new Offer(new ItemStack(ModBlocks.barbed_wire, 16), Requirement.ASSEMBLY, 12 * inflation)); - machines.add(new Offer(new ItemStack(ModBlocks.machine_siren), Requirement.ASSEMBLY, 12 * inflation)); - machines.add(new Offer(new ItemStack(ModBlocks.vault_door), Requirement.CHEMICS, 250 * inflation)); - machines.add(new Offer(new ItemStack(ModBlocks.blast_door), Requirement.CHEMICS, 120 * inflation)); - machines.add(new Offer(new ItemStack(ModBlocks.machine_epress), Requirement.OIL, 60 * inflation)); - machines.add(new Offer(new ItemStack(ModBlocks.machine_difurnace_off), Requirement.STEEL, 26 * inflation)); - machines.add(new Offer(new ItemStack(ModBlocks.machine_gascent), Requirement.OIL, 100 * inflation)); - machines.add(new Offer(new ItemStack(ModBlocks.machine_diesel), Requirement.CHEMICS, 65 * inflation)); - machines.add(new Offer(new ItemStack(ModBlocks.machine_geo), Requirement.CHEMICS, 30 * inflation)); - machines.add(new Offer(new ItemStack(ModBlocks.machine_battery), Requirement.ASSEMBLY, 30 * inflation)); - machines.add(new Offer(new ItemStack(ModBlocks.machine_lithium_battery), Requirement.CHEMICS, 60 * inflation)); - machines.add(new Offer(new ItemStack(ModBlocks.machine_assembler), Requirement.ASSEMBLY, 30 * inflation)); - machines.add(new Offer(new ItemStack(ModBlocks.machine_chemplant), Requirement.CHEMICS, 50 * inflation)); - machines.add(new Offer(new ItemStack(ModBlocks.machine_shredder), Requirement.ASSEMBLY, 45 * inflation)); - machines.add(new Offer(new ItemStack(ModBlocks.machine_well), Requirement.OIL, 40 * inflation)); - machines.add(new Offer(new ItemStack(ModBlocks.machine_refinery), Requirement.OIL, 80 * inflation)); - machines.add(new Offer(new ItemStack(ModBlocks.absorber), Requirement.CHEMICS, 10 * inflation)); - machines.add(new Offer(new ItemStack(ModBlocks.absorber_green), Requirement.OIL, 25 * inflation)); - machines.add(new Offer(new ItemStack(ModBlocks.decon), Requirement.CHEMICS, 15 * inflation)); - - weapons.add(new Offer(new ItemStack(ModItems.loot_10), Requirement.OIL, 50 * inflation)); - weapons.add(new Offer(new ItemStack(ModItems.loot_15), Requirement.OIL, 65 * inflation)); - weapons.add(new Offer(new ItemStack(ModItems.loot_misc), Requirement.NUCLEAR, 65 * inflation)); - weapons.add(new Offer(new ItemStack(ModBlocks.launch_pad), Requirement.OIL, 95 * inflation)); - weapons.add(new Offer(new ItemStack(ModBlocks.machine_radar), Requirement.OIL, 90 * inflation)); - weapons.add(new Offer(new ItemStack(ModItems.designator), Requirement.CHEMICS, 35 * inflation)); - weapons.add(new Offer(new ItemStack(ModItems.designator_range), Requirement.CHEMICS, 50 * inflation)); - weapons.add(new Offer(new ItemStack(ModItems.sat_chip), Requirement.CHEMICS, 35 * inflation)); - weapons.add(new Offer(new ItemStack(ModItems.turret_chip), Requirement.CHEMICS, 80 * inflation)); - weapons.add(new Offer(new ItemStack(ModBlocks.mine_ap, 4), Requirement.ASSEMBLY, 25 * inflation)); - weapons.add(new Offer(new ItemStack(ModBlocks.emp_bomb), Requirement.CHEMICS, 90 * inflation)); - weapons.add(new Offer(new ItemStack(ModBlocks.det_cord, 16), Requirement.ASSEMBLY, 50 * inflation)); - weapons.add(new Offer(new ItemStack(ModBlocks.det_charge), Requirement.CHEMICS, 25 * inflation)); - weapons.add(new Offer(new ItemStack(ModItems.detonator), Requirement.ASSEMBLY, 15 * inflation)); - weapons.add(new Offer(new ItemStack(ModItems.detonator_laser), Requirement.CHEMICS, 60 * inflation)); - weapons.add(new Offer(new ItemStack(ModItems.defuser), Requirement.OIL, 5 * inflation)); - - tools.add(new Offer(new ItemStack(ModBlocks.crate_can, 1), Requirement.STEEL, 20 * inflation)); - tools.add(new Offer(new ItemStack(ModBlocks.machine_keyforge), Requirement.STEEL, 10 * inflation)); - tools.add(new Offer(new ItemStack(ModBlocks.machine_satlinker), Requirement.CHEMICS, 50 * inflation)); - tools.add(new Offer(new ItemStack(ModItems.oil_detector), Requirement.CHEMICS, 45 * inflation)); - tools.add(new Offer(new ItemStack(ModItems.geiger_counter), Requirement.CHEMICS, 10 * inflation)); - tools.add(new Offer(new ItemStack(ModItems.key), Requirement.STEEL, 2 * inflation)); - tools.add(new Offer(new ItemStack(ModItems.padlock), Requirement.STEEL, 5 * inflation)); - tools.add(new Offer(new ItemStack(ModItems.padlock_reinforced), Requirement.OIL, 15 * inflation)); - tools.add(new Offer(new ItemStack(ModItems.syringe_antidote, 6), Requirement.STEEL, 10 * inflation)); - tools.add(new Offer(new ItemStack(ModItems.syringe_metal_stimpak, 4), Requirement.STEEL, 10 * inflation)); - tools.add(new Offer(new ItemStack(ModItems.syringe_metal_medx, 4), Requirement.STEEL, 10 * inflation)); - tools.add(new Offer(new ItemStack(ModItems.radaway, 6), Requirement.ASSEMBLY, 30 * inflation)); - tools.add(new Offer(new ItemStack(ModItems.radaway_strong, 3), Requirement.ASSEMBLY, 35 * inflation)); - tools.add(new Offer(new ItemStack(ModItems.radx, 4), Requirement.ASSEMBLY, 20 * inflation)); - tools.add(new Offer(new ItemStack(ModItems.pill_iodine, 6), Requirement.ASSEMBLY, 20 * inflation)); - tools.add(new Offer(new ItemStack(ModItems.gas_mask_filter, 1), Requirement.ASSEMBLY, 5 * inflation)); - tools.add(new Offer(new ItemStack(ModItems.gun_kit_1, 4), Requirement.OIL, 20 * inflation)); - tools.add(new Offer(new ItemStack(ModItems.gun_kit_2, 2), Requirement.OIL, 45 * inflation)); - tools.add(new Offer(new ItemStack(ModItems.hazmat_kit), Requirement.ASSEMBLY, 40 * inflation)); - tools.add(new Offer(new ItemStack(ModItems.hazmat_red_kit), Requirement.CHEMICS, 100 * inflation)); - tools.add(new Offer(new ItemStack(ModItems.hazmat_grey_kit), Requirement.OIL, 160 * inflation)); + //gear + standard.add(new Offer(new ItemStack(Blocks.torch, 64), Requirement.NONE, 2)); + standard.add(new Offer(new ItemStack(ModItems.definitelyfood, 16), Requirement.NONE, 4)); + standard.add(new Offer(new ItemStack(ModItems.nitra, 4), Requirement.CHEMICS, 16)); + standard.add(new Offer(new ItemStack(ModItems.gun_kit_1, 1), Requirement.ASSEMBLY, 16)); + standard.add(new Offer(new ItemStack(ModItems.geiger_counter, 1), Requirement.NONE, 16)); + standard.add(new Offer(new ItemStack(ModItems.matchstick, 16), Requirement.STEEL, 2)); + //plants + standard.add(new Offer(new ItemStack(Blocks.sapling, 1, 3), Requirement.STEEL, 12, 9)); + standard.add(new Offer(new ItemStack(ModBlocks.plant_flower, 1, EnumFlowerType.FOXGLOVE.ordinal()), Requirement.STEEL, 16, 5)); + standard.add(new Offer(new ItemStack(ModBlocks.plant_flower, 1, EnumFlowerType.TOBACCO.ordinal()), Requirement.STEEL, 16, 9)); + standard.add(new Offer(new ItemStack(ModBlocks.plant_flower, 1, EnumFlowerType.NIGHTSHADE.ordinal()), Requirement.STEEL, 16, 3)); + standard.add(new Offer(new ItemStack(ModBlocks.plant_flower, 1, EnumFlowerType.WEED.ordinal()), Requirement.STEEL, 4, 10)); + standard.add(new Offer(new ItemStack(ModBlocks.plant_flower, 1, EnumFlowerType.CD0.ordinal()), Requirement.NUCLEAR, 64, 8)); + //deco + for(EnumConcreteType conc : EnumConcreteType.values()) standard.add(new Offer(new ItemStack(ModBlocks.concrete_colored_ext, 16, conc.ordinal()), Requirement.CHEMICS, 4)); + for(SnowglobeType globe : SnowglobeType.values()) standard.add(new Offer(new ItemStack(ModBlocks.snowglobe, 1, globe.ordinal()), Requirement.CHEMICS, 128)); + for(int i = 1; i < PlushieType.values().length; i++) standard.add(new Offer(new ItemStack(ModBlocks.plushie, 1, i), Requirement.OIL, 16, i < 3 ? 10 : 0)); special.add(new Offer(new ItemStack(Items.iron_ingot, 64), Requirement.STEEL, 1)); special.add(new Offer(new ItemStack(ModItems.ingot_steel, 64), Requirement.STEEL, 1)); @@ -160,8 +78,8 @@ public class BobmazonOfferFactory { special.add(new Offer(new ItemStack(ModItems.grenade_kit), Requirement.STEEL, 5)); special.add(new Offer(new ItemStack(ModItems.jetpack_vector), Requirement.STEEL, 2)); special.add(new Offer(new ItemStack(ModItems.jetpack_tank), Requirement.STEEL, 2)); - special.add(new Offer(new ItemStack(ModItems.gun_kit_1, 10), Requirement.STEEL, 1)); - special.add(new Offer(new ItemStack(ModItems.gun_kit_2, 5), Requirement.STEEL, 3)); + special.add(new Offer(new ItemStack(ModItems.gun_kit_1, 1), Requirement.STEEL, 1)); + special.add(new Offer(new ItemStack(ModItems.gun_kit_2, 1), Requirement.STEEL, 3)); special.add(new Offer(new ItemStack(ModBlocks.struct_launcher_core, 1), Requirement.STEEL, 3)); special.add(new Offer(new ItemStack(ModBlocks.struct_launcher_core_large, 1), Requirement.STEEL, 3)); special.add(new Offer(new ItemStack(ModBlocks.struct_launcher, 40), Requirement.STEEL, 7)); @@ -242,17 +160,13 @@ public class BobmazonOfferFactory { new ItemStack(ModItems.ammo_standard, 64, EnumAmmo.CAPACITOR_OVERCHARGE.ordinal()), new ItemStack(ModItems.ammo_standard, 64, EnumAmmo.CAPACITOR_OVERCHARGE.ordinal()), new ItemStack(ModItems.ammo_standard, 64, EnumAmmo.CAPACITOR_OVERCHARGE.ordinal()) - ).setStackDisplayName("Frenchman's Reward"), Requirement.HIDDEN, 32)); + ).setStackDisplayName("Frenchie's Reward"), Requirement.HIDDEN, 32)); } public static List getOffers(ItemStack stack) { if(stack != null) { - - if(stack.getItem() == ModItems.bobmazon_materials) return materials; - if(stack.getItem() == ModItems.bobmazon_machines) return machines; - if(stack.getItem() == ModItems.bobmazon_weapons) return weapons; - if(stack.getItem() == ModItems.bobmazon_tools) return tools; + if(stack.getItem() == ModItems.bobmazon) return standard; if(stack.getItem() == ModItems.bobmazon_hidden) return special; } diff --git a/src/main/java/com/hbm/inventory/gui/GUIScreenBobmazon.java b/src/main/java/com/hbm/inventory/gui/GUIScreenBobmazon.java index 14ed3b483..bd74622e5 100644 --- a/src/main/java/com/hbm/inventory/gui/GUIScreenBobmazon.java +++ b/src/main/java/com/hbm/inventory/gui/GUIScreenBobmazon.java @@ -5,6 +5,7 @@ import java.util.Arrays; import java.util.List; import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; import com.hbm.items.ModItems; import com.hbm.lib.RefStrings; @@ -21,89 +22,88 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.item.ItemStack; import net.minecraft.stats.Achievement; +import net.minecraft.stats.AchievementList; import net.minecraft.util.ResourceLocation; public class GUIScreenBobmazon extends GuiScreen { - - protected static final ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/gui_bobmazon.png"); - protected int xSize = 176; - protected int ySize = 229; - protected int guiLeft; - protected int guiTop; - int currentPage = 0; - List offers = new ArrayList(); - List buttons = new ArrayList(); - private final EntityPlayer player; - - public GUIScreenBobmazon(EntityPlayer player, List offers) { - - this.player = player; - this.offers = offers; - } - - int getPageCount() { - return (int)Math.ceil((offers.size() - 1) / 3); - } - - public void updateScreen() { - if(currentPage < 0) - currentPage = 0; - if(currentPage > getPageCount()) - currentPage = getPageCount(); - - if(this.player.getHeldItem() != null && this.player.getHeldItem().getItem() == ModItems.bobmazon_hidden && player.getDisplayName().equals("SolsticeUnlimitd")) - this.mc.thePlayer.closeScreen(); - } - - public void drawScreen(int mouseX, int mouseY, float f) - { - this.drawDefaultBackground(); - this.drawGuiContainerBackgroundLayer(f, mouseX, mouseY); - GL11.glDisable(GL11.GL_LIGHTING); - this.drawGuiContainerForegroundLayer(mouseX, mouseY); - GL11.glEnable(GL11.GL_LIGHTING); - } - - public void initGui() - { - super.initGui(); - this.guiLeft = (this.width - this.xSize) / 2; - this.guiTop = (this.height - this.ySize) / 2; + protected static final ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/gui_bobmazon.png"); + protected int xSize = 176 + 41; + protected int ySize = 229; + protected int guiLeft; + protected int guiTop; + int currentPage = 0; + List offers = new ArrayList(); + List buttons = new ArrayList(); + private final EntityPlayer player; - updateButtons(); - } - - protected void updateButtons() { - - if(!buttons.isEmpty()) - buttons.clear(); - - for(int i = currentPage * 3; i < Math.min(currentPage * 3 + 3, offers.size()); i++) { - buttons.add(new FolderButton(guiLeft + 34, guiTop + 35 + (54 * (int)Math.floor(i)) - currentPage * 3 * 54, offers.get(i))); - } + public GUIScreenBobmazon(EntityPlayer player, List offers) { - if(currentPage != 0) - buttons.add(new FolderButton(guiLeft + 25 - 18, guiTop + 26 + (27 * 3), 1, "Previous")); - if(currentPage != getPageCount()) - buttons.add(new FolderButton(guiLeft + 25 + (27 * 4) + 18, guiTop + 26 + (27 * 3), 2, "Next")); - } + this.player = player; + + this.offers = offers; + } + + int getPageCount() { + return (int) Math.ceil((offers.size() - 1) / 3); + } + + public void updateScreen() { + if(currentPage < 0) + currentPage = 0; + if(currentPage > getPageCount()) + currentPage = getPageCount(); + + if(this.player.getHeldItem() != null && this.player.getHeldItem().getItem() == ModItems.bobmazon_hidden && player.getDisplayName().equals("SolsticeUnlimitd")) + this.mc.thePlayer.closeScreen(); + } + + public void drawScreen(int mouseX, int mouseY, float f) { + this.drawDefaultBackground(); + this.drawGuiContainerBackgroundLayer(f, mouseX, mouseY); + GL11.glDisable(GL11.GL_LIGHTING); + this.drawGuiContainerForegroundLayer(mouseX, mouseY); + GL11.glEnable(GL11.GL_LIGHTING); + } + + public void initGui() { + super.initGui(); + this.guiLeft = (this.width - this.xSize) / 2; + this.guiTop = (this.height - this.ySize) / 2; + + updateButtons(); + } + + protected void updateButtons() { + + if(!buttons.isEmpty()) + buttons.clear(); + + for(int i = currentPage * 3; i < Math.min(currentPage * 3 + 3, offers.size()); i++) { + buttons.add(new FolderButton(guiLeft + 34, guiTop + 35 + (54 * (int) Math.floor(i)) - currentPage * 3 * 54, offers.get(i))); + } + + if(currentPage != 0) + buttons.add(new FolderButton(guiLeft + 25 - 18, guiTop + 26 + (27 * 3), 1, "Previous")); + if(currentPage != getPageCount()) + buttons.add(new FolderButton(guiLeft + 25 + (27 * 4) + 18 + 41, guiTop + 26 + (27 * 3), 2, "Next")); + } + + protected void mouseClicked(int i, int j, int k) { + try { + for(FolderButton b : buttons) + if(b.isMouseOnButton(i, j)) + b.executeAction(); + } catch(Exception ex) { + updateButtons(); + } + } - protected void mouseClicked(int i, int j, int k) { - try { - for(FolderButton b : buttons) - if(b.isMouseOnButton(i, j)) - b.executeAction(); - } catch (Exception ex) { - updateButtons(); - } - } - protected void drawGuiContainerForegroundLayer(int i, int j) { - this.fontRendererObj.drawString(I18n.format((currentPage + 1) + "/" + (getPageCount() + 1)), + this.fontRendererObj.drawString(I18n.format((currentPage + 1) + "/" + (getPageCount() + 1)), guiLeft + this.xSize / 2 - this.fontRendererObj.getStringWidth(I18n.format((currentPage + 1) + "/" + (getPageCount() + 1))) / 2, guiTop + 205, 4210752); - + for(FolderButton b : buttons) if(b.isMouseOnButton(i, j)) b.drawString(i, j); @@ -118,73 +118,73 @@ public class GUIScreenBobmazon extends GuiScreen { b.drawButton(b.isMouseOnButton(i, j)); for(FolderButton b : buttons) b.drawIcon(b.isMouseOnButton(i, j)); - - for(int d = currentPage * 3; d < Math.min(currentPage * 3 + 3, offers.size()); d++) { - offers.get(d).drawRequirement(this, guiLeft + 34, guiTop + 53 + (54 * (int)Math.floor(d)) - currentPage * 3 * 54); - } + + for(int d = currentPage * 3; d < Math.min(currentPage * 3 + 3, offers.size()); d++) { + offers.get(d).drawRequirement(this, guiLeft + 34, guiTop + 53 + (54 * (int) Math.floor(d)) - currentPage * 3 * 54); + } } - - protected void keyTyped(char p_73869_1_, int p_73869_2_) - { - if (p_73869_2_ == 1 || p_73869_2_ == this.mc.gameSettings.keyBindInventory.getKeyCode()) - { - this.mc.thePlayer.closeScreen(); - } - - } - + + protected void keyTyped(char p_73869_1_, int p_73869_2_) { + if(p_73869_2_ == 1 || p_73869_2_ == this.mc.gameSettings.keyBindInventory.getKeyCode()) { + this.mc.thePlayer.closeScreen(); + } + + } + class FolderButton { - + int xPos; int yPos; - //0: regular, 1: prev, 2: next + // 0: regular, 1: prev, 2: next int type; String info; Offer offer; - + public FolderButton(int x, int y, int t, String i) { xPos = x; yPos = y; type = t; info = i; } - + public FolderButton(int x, int y, Offer offer) { xPos = x; yPos = y; type = 0; this.offer = offer; } - + public void updateButton(int mouseX, int mouseY) { } - + public boolean isMouseOnButton(int mouseX, int mouseY) { return xPos <= mouseX && xPos + 18 > mouseX && yPos < mouseY && yPos + 18 >= mouseY; } - + public void drawButton(boolean b) { Minecraft.getMinecraft().getTextureManager().bindTexture(texture); - drawTexturedModalRect(xPos, yPos, b ? 176 + 18 : 176, type == 1 ? 18 : (type == 2 ? 36 : 0), 18, 18); + drawTexturedModalRect(xPos, yPos, b ? 176 + 41 + 18 : 176 + 41, type == 1 ? 18 : (type == 2 ? 36 : 0), 18, 18); } - + public void drawIcon(boolean b) { try { - GL11.glDisable(GL11.GL_LIGHTING); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); if(offer != null) { + RenderHelper.enableGUIStandardItemLighting(); itemRender.renderItemAndEffectIntoGUI(fontRendererObj, mc.getTextureManager(), offer.offer, xPos + 1, yPos + 1); } - GL11.glEnable(GL11.GL_LIGHTING); - } catch(Exception x) { } + } catch(Exception x) { + } } - + public void drawString(int x, int y) { if(info == null || info.isEmpty()) return; - + func_146283_a(Arrays.asList(new String[] { info }), x, y); } - + public void executeAction() { mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F)); if(type == 0) { @@ -200,21 +200,21 @@ public class GUIScreenBobmazon extends GuiScreen { } } } - + @Override public boolean doesGuiPauseGame() { return false; } - + public static class Offer { - + public ItemStack offer; public Requirement requirement; public int cost; public int rating; public String comment; public String author; - + public Offer(ItemStack offer, Requirement requirement, int cost, int rating, String comment, String author) { this.offer = offer; this.requirement = requirement; @@ -223,82 +223,81 @@ public class GUIScreenBobmazon extends GuiScreen { this.comment = comment; this.author = author; } - + public Offer(ItemStack offer, Requirement requirement, int cost) { - this.offer = offer; - this.requirement = requirement; - this.cost = cost; - this.rating = 0; - this.comment = "No Ratings"; - this.author = ""; + this(offer, requirement, cost, 0); } - + + public Offer(ItemStack offer, Requirement requirement, int cost, int rating) { + this(offer, requirement, cost, rating, "No Ratings", ""); + } + public void drawRequirement(GUIScreenBobmazon gui, int x, int y) { try { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); RenderHelper.enableGUIStandardItemLighting(); - GL11.glColor3f(1F, 1F, 1F); + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); Minecraft.getMinecraft().getTextureManager().bindTexture(texture); - gui.drawTexturedModalRect(x + 19, y - 4, 176, 62, 39, 8); - gui.drawTexturedModalRect(x + 19, y - 4, 176, 54, rating, 8); - + gui.drawTexturedModalRect(x + 19, y - 4, 176 + 41, 62, 39, 8); + gui.drawTexturedModalRect(x + 19, y - 4, 176 + 41, 54, rating, 8); + String count = ""; if(offer.stackSize > 1) count = " x" + offer.stackSize; GL11.glPushMatrix(); - - float scale = 0.65F; + float scale = 0.5F; GL11.glScalef(scale, scale, scale); - gui.fontRendererObj.drawString(I18n.format(offer.getDisplayName()) + count, (int)((x + 20) / scale), (int)((y - 12) / scale), 4210752); - + gui.fontRendererObj.drawString(I18n.format(offer.getDisplayName()) + count, (int) ((x + 20) / scale), (int) ((y - 12) / scale), 4210752); GL11.glPopMatrix(); - + String price = cost + " Cap"; if(cost != 1) price += "s"; gui.fontRendererObj.drawString(price, x + 62, y - 3, 4210752); - + GL11.glPushMatrix(); - - GL11.glScalef(0.5F, 0.5F, 0.5F); - - if(!author.isEmpty()) - gui.fontRendererObj.drawString("- " + author, (x + 20) * 2, (y + 18) * 2, 0x222222); - gui.fontRendererObj.drawString(comment, (x + 20) * 2, (y + 8) * 2, 0x222222); - + + GL11.glScalef(0.5F, 0.5F, 0.5F); + + if(!author.isEmpty()) + gui.fontRendererObj.drawString("- " + author, (x + 20) * 2, (y + 18) * 2, 0x222222); + gui.fontRendererObj.drawString(comment, (x + 20) * 2, (y + 8) * 2, 0x222222); + GL11.glPopMatrix(); - - GL11.glDisable(GL11.GL_LIGHTING); if(offer != null) { + GL11.glEnable(GL11.GL_LIGHTING); gui.itemRender.renderItemAndEffectIntoGUI(gui.fontRendererObj, gui.mc.getTextureManager(), requirement.achievement.theItemStack, x + 1, y + 1); } - GL11.glEnable(GL11.GL_LIGHTING); - - } catch(Exception ex) { } + + } catch(Exception ex) { + } } - + } - + public enum Requirement { + NONE(AchievementList.openInventory), STEEL(MainRegistry.achBlastFurnace), ASSEMBLY(MainRegistry.achAssembly), CHEMICS(MainRegistry.achChemplant), OIL(MainRegistry.achDesh), NUCLEAR(MainRegistry.achTechnetium), HIDDEN(MainRegistry.bobHidden); - + private Requirement(Achievement achievement) { this.achievement = achievement; } - + public boolean fullfills(EntityPlayerMP player) { - + return player.func_147099_x().hasAchievementUnlocked(achievement); } - + public Achievement achievement; } diff --git a/src/main/java/com/hbm/items/ModItems.java b/src/main/java/com/hbm/items/ModItems.java index dad87d730..2682975d5 100644 --- a/src/main/java/com/hbm/items/ModItems.java +++ b/src/main/java/com/hbm/items/ModItems.java @@ -1226,10 +1226,7 @@ public class ModItems { public static Item siren_track; public static Item fluid_duct; - public static Item bobmazon_materials; - public static Item bobmazon_machines; - public static Item bobmazon_weapons; - public static Item bobmazon_tools; + public static Item bobmazon; public static Item bobmazon_hidden; public static Item launch_code_piece; @@ -4225,10 +4222,7 @@ public class ModItems { siren_track = new ItemCassette().setUnlocalizedName("siren_track").setMaxStackSize(1).setCreativeTab(MainRegistry.templateTab).setTextureName(RefStrings.MODID + ":cassette"); fluid_duct = new ItemFluidDuct().setUnlocalizedName("fluid_duct").setCreativeTab(MainRegistry.templateTab).setTextureName(RefStrings.MODID + ":duct"); - bobmazon_materials = new ItemCatalog().setUnlocalizedName("bobmazon_materials").setMaxStackSize(1).setCreativeTab(MainRegistry.templateTab).setTextureName(RefStrings.MODID + ":bobmazon_materials"); - bobmazon_machines = new ItemCatalog().setUnlocalizedName("bobmazon_machines").setMaxStackSize(1).setCreativeTab(MainRegistry.templateTab).setTextureName(RefStrings.MODID + ":bobmazon_machines"); - bobmazon_weapons = new ItemCatalog().setUnlocalizedName("bobmazon_weapons").setMaxStackSize(1).setCreativeTab(MainRegistry.templateTab).setTextureName(RefStrings.MODID + ":bobmazon_weapons"); - bobmazon_tools = new ItemCatalog().setUnlocalizedName("bobmazon_tools").setMaxStackSize(1).setCreativeTab(MainRegistry.templateTab).setTextureName(RefStrings.MODID + ":bobmazon_tools"); + bobmazon = new ItemCatalog().setUnlocalizedName("bobmazon").setMaxStackSize(1).setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":bobmazon"); bobmazon_hidden = new ItemCatalog().setUnlocalizedName("bobmazon_hidden").setMaxStackSize(1).setCreativeTab(null).setTextureName(RefStrings.MODID + ":bobmazon_special"); euphemium_helmet = new ArmorEuphemium(MainRegistry.aMatEuph, 0).setUnlocalizedName("euphemium_helmet").setMaxStackSize(1).setTextureName(RefStrings.MODID + ":euphemium_helmet"); @@ -5840,10 +5834,7 @@ public class ModItems { GameRegistry.registerItem(journal_pip, journal_pip.getUnlocalizedName()); GameRegistry.registerItem(journal_bj, journal_bj.getUnlocalizedName()); GameRegistry.registerItem(journal_silver, journal_silver.getUnlocalizedName()); - GameRegistry.registerItem(bobmazon_materials, bobmazon_materials.getUnlocalizedName()); - GameRegistry.registerItem(bobmazon_machines, bobmazon_machines.getUnlocalizedName()); - GameRegistry.registerItem(bobmazon_weapons, bobmazon_weapons.getUnlocalizedName()); - GameRegistry.registerItem(bobmazon_tools, bobmazon_tools.getUnlocalizedName()); + GameRegistry.registerItem(bobmazon, bobmazon.getUnlocalizedName()); GameRegistry.registerItem(bobmazon_hidden, bobmazon_hidden.getUnlocalizedName()); //Hydraulic Press Stamps diff --git a/src/main/java/com/hbm/items/tool/ItemCatalog.java b/src/main/java/com/hbm/items/tool/ItemCatalog.java index 1f679a88a..5bf610aa7 100644 --- a/src/main/java/com/hbm/items/tool/ItemCatalog.java +++ b/src/main/java/com/hbm/items/tool/ItemCatalog.java @@ -20,10 +20,7 @@ public class ItemCatalog extends Item implements IGUIProvider { @Override public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) { - - if(world.isRemote) - player.openGui(MainRegistry.instance, 0, world, 0, 0, 0); - + if(world.isRemote) player.openGui(MainRegistry.instance, 0, world, 0, 0, 0); return stack; } @@ -46,7 +43,6 @@ public class ItemCatalog extends Item implements IGUIProvider { public Object provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) { if(BobmazonOfferFactory.getOffers(player.getHeldItem()) != null) return new GUIScreenBobmazon(player, BobmazonOfferFactory.getOffers(player.getHeldItem())); - return null; } } diff --git a/src/main/java/com/hbm/main/MainRegistry.java b/src/main/java/com/hbm/main/MainRegistry.java index bb4402ad2..091ac20de 100644 --- a/src/main/java/com/hbm/main/MainRegistry.java +++ b/src/main/java/com/hbm/main/MainRegistry.java @@ -1643,6 +1643,10 @@ public class MainRegistry { ignoreMappings.add("hbm:item.pellet_canister"); ignoreMappings.add("hbm:item.pellet_claws"); ignoreMappings.add("hbm:item.pellet_flechette"); + ignoreMappings.add("hbm:item.bobmazon_materials"); + ignoreMappings.add("hbm:item.bobmazon_machines"); + ignoreMappings.add("hbm:item.bobmazon_weapons"); + ignoreMappings.add("hbm:item.bobmazon_tools"); /// REMAP /// remapItems.put("hbm:item.gadget_explosive8", ModItems.early_explosive_lenses); diff --git a/src/main/java/com/hbm/packet/toserver/ItemBobmazonPacket.java b/src/main/java/com/hbm/packet/toserver/ItemBobmazonPacket.java index 9866b4596..712dc766e 100644 --- a/src/main/java/com/hbm/packet/toserver/ItemBobmazonPacket.java +++ b/src/main/java/com/hbm/packet/toserver/ItemBobmazonPacket.java @@ -24,21 +24,11 @@ public class ItemBobmazonPacket implements IMessage { int offer; - public ItemBobmazonPacket() - { - - } + public ItemBobmazonPacket() { } - public ItemBobmazonPacket(EntityPlayer player, Offer offer) - { - if(player.getHeldItem() != null && player.getHeldItem().getItem() == ModItems.bobmazon_materials) - this.offer = BobmazonOfferFactory.materials.indexOf(offer); - if(player.getHeldItem() != null && player.getHeldItem().getItem() == ModItems.bobmazon_machines) - this.offer = BobmazonOfferFactory.machines.indexOf(offer); - if(player.getHeldItem() != null && player.getHeldItem().getItem() == ModItems.bobmazon_weapons) - this.offer = BobmazonOfferFactory.weapons.indexOf(offer); - if(player.getHeldItem() != null && player.getHeldItem().getItem() == ModItems.bobmazon_tools) - this.offer = BobmazonOfferFactory.tools.indexOf(offer); + public ItemBobmazonPacket(EntityPlayer player, Offer offer) { + if(player.getHeldItem() != null && player.getHeldItem().getItem() == ModItems.bobmazon) + this.offer = BobmazonOfferFactory.standard.indexOf(offer); if(player.getHeldItem() != null && player.getHeldItem().getItem() == ModItems.bobmazon_hidden) this.offer = BobmazonOfferFactory.special.indexOf(offer); } @@ -62,16 +52,8 @@ public class ItemBobmazonPacket implements IMessage { World world = p.worldObj; Offer offer = null; - if(p.getHeldItem() != null && p.getHeldItem().getItem() == ModItems.bobmazon_materials) - offer = BobmazonOfferFactory.materials.get(m.offer); - if(p.getHeldItem() != null && p.getHeldItem().getItem() == ModItems.bobmazon_machines) - offer = BobmazonOfferFactory.machines.get(m.offer); - if(p.getHeldItem() != null && p.getHeldItem().getItem() == ModItems.bobmazon_weapons) - offer = BobmazonOfferFactory.weapons.get(m.offer); - if(p.getHeldItem() != null && p.getHeldItem().getItem() == ModItems.bobmazon_tools) - offer = BobmazonOfferFactory.tools.get(m.offer); - if(p.getHeldItem() != null && p.getHeldItem().getItem() == ModItems.bobmazon_hidden) - offer = BobmazonOfferFactory.special.get(m.offer); + if(p.getHeldItem() != null && p.getHeldItem().getItem() == ModItems.bobmazon) offer = BobmazonOfferFactory.standard.get(m.offer); + if(p.getHeldItem() != null && p.getHeldItem().getItem() == ModItems.bobmazon_hidden) offer = BobmazonOfferFactory.special.get(m.offer); if(offer == null) { p.addChatMessage(new ChatComponentText("[BOBMAZON] There appears to be a mismatch between the offer you have requested and the offers that exist.")); diff --git a/src/main/java/com/hbm/uninos/GenNode.java b/src/main/java/com/hbm/uninos/GenNode.java index d9c3d8001..6f7390019 100644 --- a/src/main/java/com/hbm/uninos/GenNode.java +++ b/src/main/java/com/hbm/uninos/GenNode.java @@ -1,20 +1,19 @@ package com.hbm.uninos; -import com.hbm.uninos.UniNodespace.UniNodeWorld; import com.hbm.util.fauxpointtwelve.BlockPos; import com.hbm.util.fauxpointtwelve.DirPos; -public class GenNode { +public class GenNode { - public long id; public BlockPos[] positions; public DirPos[] connections; public INodeNet net; public boolean expired = false; public boolean recentlyChanged = true; + public T networkProvider; - public GenNode(BlockPos... positions) { - this.id = UniNodeWorld.nextId++; + public GenNode(T provider, BlockPos... positions) { + this.networkProvider = provider; this.positions = positions; } @@ -40,12 +39,3 @@ public class GenNode { this.recentlyChanged = true; } } - -/* - * - * ok so here's the deal: attempt #1 SUCKED. - * making a central nodespaces hashmap that holds one instance of each possible nodespace sounds like a great and simple solution - * until you realize that every single fucking fluid under the sun needs to be its own nodespace. which means the update function - * has to iterate over every world instance, and for every world instance there's 150 or so nodespaces for fluids alone. not good. - * - */ diff --git a/src/main/java/com/hbm/uninos/INetworkProvider.java b/src/main/java/com/hbm/uninos/INetworkProvider.java index c3b7893be..ec515d92b 100644 --- a/src/main/java/com/hbm/uninos/INetworkProvider.java +++ b/src/main/java/com/hbm/uninos/INetworkProvider.java @@ -1,5 +1,10 @@ package com.hbm.uninos; +/** + * Each instance of a network provider is a valid "type" of node in UNINOS + * @author hbm + */ public interface INetworkProvider { + public INodeNet provideNetwork(); } diff --git a/src/main/java/com/hbm/uninos/INodeNet.java b/src/main/java/com/hbm/uninos/INodeNet.java index 79efab063..b7c84d3ae 100644 --- a/src/main/java/com/hbm/uninos/INodeNet.java +++ b/src/main/java/com/hbm/uninos/INodeNet.java @@ -1,6 +1,6 @@ package com.hbm.uninos; -public interface INodeNet { +public interface INodeNet { public boolean isValid(); public void destroy(); diff --git a/src/main/java/com/hbm/uninos/UniNodespace.java b/src/main/java/com/hbm/uninos/UniNodespace.java index 84a3d0ddc..7b07da5de 100644 --- a/src/main/java/com/hbm/uninos/UniNodespace.java +++ b/src/main/java/com/hbm/uninos/UniNodespace.java @@ -1,8 +1,8 @@ package com.hbm.uninos; import java.util.HashMap; -import java.util.HashSet; +import com.hbm.util.Tuple.Pair; import com.hbm.util.fauxpointtwelve.BlockPos; import net.minecraft.world.World; @@ -11,29 +11,36 @@ public class UniNodespace { public static HashMap worlds = new HashMap(); - /* - * attempt #1 went south because there would be an entirely separate nodespace for every single possible type - * which for fluids means at least 150 alone, and that's not great. - * this is attempt #2 which is not good for reasons explained below - */ + public static GenNode getNode(World world, int x, int y, int z, INetworkProvider type) { + UniNodeWorld nodeWorld = worlds.get(world); + if(nodeWorld != null) return nodeWorld.nodes.get(new Pair(new BlockPos(x, y, z), type)); + return null; + } + + public static void createNode(World world, GenNode node) { + UniNodeWorld nodeWorld = worlds.get(world); + if(nodeWorld == null) { + nodeWorld = new UniNodeWorld(); + worlds.put(world, nodeWorld); + } + nodeWorld.pushNode(node); + } + + public static void destroyNode(World world, int x, int y, int z, INetworkProvider type) { + GenNode node = getNode(world, x, y, z, type); + if(node != null) { + worlds.get(world).popNode(node); + } + } + public static class UniNodeWorld { - public static int nextId = 0; - - //shot in the dark: how well is the dual hashmap system gonna perform? - //how are we gonna handle type segregation for network forming? - public HashMap> posToId = new HashMap<>(); - public HashMap idToNode = new HashMap<>(); + public HashMap, GenNode> nodes = new HashMap(); /** Adds a node at all its positions to the nodespace */ public void pushNode(GenNode node) { for(BlockPos pos : node.positions) { - HashSet set = posToId.get(pos); - if(set == null) { - set = new HashSet(); - posToId.put(pos, set); - } - set.add(node.id); + nodes.put(new Pair(pos, node.networkProvider), node); } } @@ -41,19 +48,9 @@ public class UniNodespace { public void popNode(GenNode node) { if(node.net != null) node.net.destroy(); for(BlockPos pos : node.positions) { - HashSet set = posToId.get(pos); - if(set != null) { - set.remove(node.id); - if(set.isEmpty()) posToId.remove(pos); - } + nodes.remove(new Pair(pos, node.networkProvider)); } node.expired = true; } } - /* - * yeah this shit isn't gonna work because this allows multiple nodes of the same type in the same pos - * (we don't want that) which also makes it near impossible to do per-type position node lookups - * (sure it's possible but we are gonna have to iterate over every possible node in that spot, which is - * usually 1, but who knows how we end up using this system so i'd rather not) - */ } diff --git a/src/main/java/com/hbm/uninos/networkproviders/PowerProvider.java b/src/main/java/com/hbm/uninos/networkproviders/PowerProvider.java new file mode 100644 index 000000000..bcaccc994 --- /dev/null +++ b/src/main/java/com/hbm/uninos/networkproviders/PowerProvider.java @@ -0,0 +1,13 @@ +package com.hbm.uninos.networkproviders; + +import com.hbm.uninos.INetworkProvider; +import com.hbm.uninos.INodeNet; +import com.hbm.uninos.networks.PowerNetwork; + +public class PowerProvider implements INetworkProvider { + + @Override + public INodeNet provideNetwork() { + return new PowerNetwork(); + } +} diff --git a/src/main/java/com/hbm/uninos/networks/PowerNetwork.java b/src/main/java/com/hbm/uninos/networks/PowerNetwork.java new file mode 100644 index 000000000..45bb09976 --- /dev/null +++ b/src/main/java/com/hbm/uninos/networks/PowerNetwork.java @@ -0,0 +1,16 @@ +package com.hbm.uninos.networks; + +import com.hbm.uninos.INodeNet; + +public class PowerNetwork implements INodeNet { + + @Override + public boolean isValid() { + return false; + } + + @Override + public void destroy() { + + } +} diff --git a/src/main/java/com/hbm/util/Tuple.java b/src/main/java/com/hbm/util/Tuple.java index cd69db973..f2276386e 100644 --- a/src/main/java/com/hbm/util/Tuple.java +++ b/src/main/java/com/hbm/util/Tuple.java @@ -30,7 +30,7 @@ public class Tuple { @Override public int hashCode() { - final int prime = 31; + final int prime = 27644437; int result = 1; result = prime * result + ((key == null) ? 0 : key.hashCode()); result = prime * result + ((value == null) ? 0 : value.hashCode()); @@ -86,7 +86,7 @@ public class Tuple { @Override public int hashCode() { - final int prime = 31; + final int prime = 27644437; int result = 1; result = prime * result + ((x == null) ? 0 : x.hashCode()); result = prime * result + ((y == null) ? 0 : y.hashCode()); @@ -126,7 +126,7 @@ public class Tuple { @Override public int hashCode() { - final int prime = 31; + final int prime = 27644437; int result = 1; result = prime * result + ((w == null) ? 0 : w.hashCode()); result = prime * result + ((x == null) ? 0 : x.hashCode()); @@ -200,7 +200,7 @@ public class Tuple { @Override public int hashCode() { - final int prime = 31; + final int prime = 27644437; int result = 1; result = prime * result + ((v == null) ? 0 : v.hashCode()); result = prime * result + ((w == null) ? 0 : w.hashCode()); diff --git a/src/main/resources/assets/hbm/lang/de_DE.lang b/src/main/resources/assets/hbm/lang/de_DE.lang index 5e257b2f0..3af792e33 100644 --- a/src/main/resources/assets/hbm/lang/de_DE.lang +++ b/src/main/resources/assets/hbm/lang/de_DE.lang @@ -1534,6 +1534,7 @@ item.blades_titanium.name=Titansägeblatt item.blowtorch.name=Lötlampe item.board_copper.name=Kupfertafel item.boat_rubber.name=Schlauchboot +item.bobmazon.name=Bobmazon item.bobmazon_hidden.name=Versteckter Katalog item.bobmazon_machines.name=Bobmazon: Blöcke und Maschinen item.bobmazon_materials.name=Bobmazon: Ressourcen diff --git a/src/main/resources/assets/hbm/lang/en_US.lang b/src/main/resources/assets/hbm/lang/en_US.lang index b4caaa162..47a40c427 100644 --- a/src/main/resources/assets/hbm/lang/en_US.lang +++ b/src/main/resources/assets/hbm/lang/en_US.lang @@ -2276,6 +2276,7 @@ item.blades_titanium.name=Titanium Shredder Blades item.blowtorch.name=Blowtorch item.board_copper.name=Copper Panel item.boat_rubber.name=Rubber Boat +item.bobmazon.name=Bobmazon item.bobmazon_hidden.name=Hidden Catalog item.bobmazon_machines.name=Bobmazon: Blocks and Machines item.bobmazon_materials.name=Bobmazon: Materials diff --git a/src/main/resources/assets/hbm/textures/gui/gui_bobmazon.png b/src/main/resources/assets/hbm/textures/gui/gui_bobmazon.png index 33890326aec6b0a8b4906f3858d516f899831ca9..e9fdfa2cc70eeb3d2cb464692ece0b57e161fbf5 100644 GIT binary patch literal 4181 zcmb7HX*`r`8-EOC$x9iyx%(ahv&Yp-|u>^?f(C-`@SQL4754e_}Bmd;DG7eG64Vv zaLE9$90w;`pL}O^*@(IIV;UdxSC~bd*Xv~-!z3zmi>f-Bnh+xth8M-q zE@Zn{9VE=+ef#hk4Pe@{Vf<#}adsho`(~9qu4p^5?c&*B&h^7kQAdszx%I9qhs&vQ za1}Q8C3`_g+Cq1?OudXszk3JdYv5WW?UzO`znm4-XBcH&(VZ_x1N*Y$uf6 zYl~ zVcAYZ9E>v`;-^|-+K31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vgn zLvuQL9RNd*QhBcEDoF%}iN;?_7XVBYomN9m0N_w1P;zX)pvXQL^nX>DY$f!FTaJqh zl>eW;BtIrHfmB%7!Ms{kJTY;jQiDsPS^77#fJCQiG>~Cx@cq^h^9z7iaRFQdlF|)i zGYw=_6yhEXHz}G>gPRc%!>J^<*?}Sfgw@~b2@xvO4zV?daus9g#>;WBeIHpL!}jS2 z5Ptek!3GsB6fQj#0woxma1{MacAhGFcOC9v)t& zwjtFjw1`IiA>98afTR}(BNH+*GMboI8`XHCE`aExr;>q%j}TX)8^qMs_SJ&s#f-g2 zxF*KI8hvacc@P?%Jn-M+cp@3NbX4T>(P#Gun(!#pJ#A3{Jwguhy2vgmD7c{qgF#cd z|50(s%wCxF-IBuu>DB+Areh*6X2gS_j#7mhPo@j}E)o@CrzC%VKmrc{eE+n)zvcI5 zrnagKN>?|E@+!iEpD)VS50da%m23PlZ>J8F>-T5iKO^Sfc>2FgrCe}Usjd?^b=*Dy z9IL+#4Sj}-D|IF!fWp$!-u^vY6J}r+L?=-w%7gaXy94cp1z}hrEcl1ukCwwC2W#%M Ur`>?n_}d?S+4xfNMW?_12l{rgsQ>@~ diff --git a/src/main/resources/assets/hbm/textures/items/bobmazon.png b/src/main/resources/assets/hbm/textures/items/bobmazon.png index 21f69a46e4173e1762a2a8c72f633113dbcf2990..fb5f3e38406d08af6f3763e6b88616342f9a8a68 100644 GIT binary patch delta 320 zcmV-G0l)s(0_y^hG=CyVL_t(IjjfWgO2beThQE|zr+}MKk_%1_88cMz4elc}QeBPMX3KVFYZrOWVJT)W@K^?q&=yP&(qm>vsP^CA>@qc|EpcJi2TG9y$=>&ys zx+UBj5V5sq}5rEf*Tn35wkv3$wFV*<3%po-~ViU%t=+@Wux$@>yj-2d7y? znnlQA7jgJS8$bwwH->ODZCtVn0?1((0L!ufXwN@q#Br>Z=)fdNfS*@5-uH^ri#|dK z;y5N8P5H>@8#%%2v%6oxI*A(8f%mVWQ4y?@YywppKT%1xfm(r*s9Fd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