thorn glognuts for only 5 bintar

This commit is contained in:
Boblet 2025-02-11 16:46:14 +01:00
parent 614f5db7dc
commit 4972f4023a
23 changed files with 259 additions and 350 deletions

View File

@ -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

View File

@ -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 });

View File

@ -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<Offer> materials = new ArrayList();
public static List<Offer> machines = new ArrayList();
public static List<Offer> weapons = new ArrayList();
public static List<Offer> tools = new ArrayList();
public static List<Offer> standard = new ArrayList();
public static List<Offer> 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<Offer> 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;
}

View File

@ -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<Offer> offers = new ArrayList<Offer>();
List<FolderButton> buttons = new ArrayList<FolderButton>();
private final EntityPlayer player;
public GUIScreenBobmazon(EntityPlayer player, List<Offer> 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<Offer> offers = new ArrayList<Offer>();
List<FolderButton> buttons = new ArrayList<FolderButton>();
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<Offer> 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;
}

View File

@ -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

View File

@ -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;
}
}

View File

@ -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);

View File

@ -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."));

View File

@ -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<T> {
public class GenNode<T extends INetworkProvider> {
public long id;
public BlockPos[] positions;
public DirPos[] connections;
public INodeNet<T> 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<T> {
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.
*
*/

View File

@ -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<? extends INetworkProvider> provideNetwork();
}

View File

@ -1,6 +1,6 @@
package com.hbm.uninos;
public interface INodeNet<T> {
public interface INodeNet<T extends INetworkProvider> {
public boolean isValid();
public void destroy();

View File

@ -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<World, UniNodeWorld> 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<BlockPos, HashSet<Long>> posToId = new HashMap<>();
public HashMap<Long, GenNode> idToNode = new HashMap<>();
public HashMap<Pair<BlockPos, INetworkProvider>, GenNode<INetworkProvider>> nodes = new HashMap();
/** Adds a node at all its positions to the nodespace */
public void pushNode(GenNode node) {
for(BlockPos pos : node.positions) {
HashSet<Long> 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<Long> 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)
*/
}

View File

@ -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<PowerProvider> provideNetwork() {
return new PowerNetwork();
}
}

View File

@ -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() {
}
}

View File

@ -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());

View File

@ -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

View File

@ -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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 344 B

After

Width:  |  Height:  |  Size: 363 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 344 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 356 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 362 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 335 B