diff --git a/src/main/java/pl/pabilo8/immersiveintelligence/client/gui/deco/component/collection/DecoScrolledCollection.java b/src/main/java/pl/pabilo8/immersiveintelligence/client/gui/deco/component/collection/DecoScrolledCollection.java index 4dda801d2..397001c8c 100644 --- a/src/main/java/pl/pabilo8/immersiveintelligence/client/gui/deco/component/collection/DecoScrolledCollection.java +++ b/src/main/java/pl/pabilo8/immersiveintelligence/client/gui/deco/component/collection/DecoScrolledCollection.java @@ -391,20 +391,22 @@ protected Tuple getClickedEntryIndex(int xx, int yy, int mouse //Iterate over all entries for(T entry : entries) { - //Skip non-selectable (clickable) entries - if(!display.isSelectable(entry)) - continue; + //Measure element height for layout for all entries int elementHeight = display.displayElement(entry, entryMaxWidth, fontRenderer, true); //Check if the mouse is over the current entry if(IIMath.isPointInRectangle(xx+(currentColumn*entryMaxWidth), yy+drawOffset, xx+(currentColumn*entryMaxWidth)+entryMaxWidth, - yy+drawOffset+display.displayElement(entry, entryMaxWidth, fontRenderer, true), + yy+drawOffset+elementHeight, mouseX, mouseY)) - return new Tuple<>( - this.entries.indexOf(entry), - yy+drawOffset - ); + { + //Only return selectable entries + if(display.isSelectable(entry)) + return new Tuple<>( + this.entries.indexOf(entry), + yy+drawOffset + ); + } currentColumn++; //There can be multiple entries in one row diff --git a/src/main/java/pl/pabilo8/immersiveintelligence/client/gui/overlay/GuiOverlayZoom.java b/src/main/java/pl/pabilo8/immersiveintelligence/client/gui/overlay/GuiOverlayZoom.java index 5da59c536..1ecff7ff8 100644 --- a/src/main/java/pl/pabilo8/immersiveintelligence/client/gui/overlay/GuiOverlayZoom.java +++ b/src/main/java/pl/pabilo8/immersiveintelligence/client/gui/overlay/GuiOverlayZoom.java @@ -77,8 +77,9 @@ private void drawZoomStepsBar(int width, int height, int resMin, EntityPlayer pl draw.drawTexRect(0, 0, 8/256f*resMin, 7/256f*resMin, 88/256f, 98/256f, 103/256f, 110/256f); draw.finish(); - //Draw magnification amount - ClientUtils.font().drawString(1/steps[curStep]+"x", (int)(resMin*1.385f), (int)(100/256f*resMin), 0xffffff); + //Draw magnification amount (rounded to nearest whole number) + int magnRounded = Math.round(1f/steps[curStep]); + ClientUtils.font().drawString(magnRounded+"x", (int)(resMin*1.385f), (int)(100/256f*resMin), 0xffffff); } diff --git a/src/main/java/pl/pabilo8/immersiveintelligence/client/manual/IIManualPage.java b/src/main/java/pl/pabilo8/immersiveintelligence/client/manual/IIManualPage.java index f33f781e1..7a5a00cdd 100644 --- a/src/main/java/pl/pabilo8/immersiveintelligence/client/manual/IIManualPage.java +++ b/src/main/java/pl/pabilo8/immersiveintelligence/client/manual/IIManualPage.java @@ -221,6 +221,9 @@ public void renderPage(GuiManual gui, int x, int y, int mx, int my) GlStateManager.enableBlend(); + //sets tooltip to null to ensure it's cleared if not moused over + this.tooltipWrapper.tooltip = null; + GlStateManager.pushMatrix(); GlStateManager.color(1, 1, 1, 0.25f); PageTraits hoveredTrait = null; diff --git a/src/main/java/pl/pabilo8/immersiveintelligence/common/CommonProxy.java b/src/main/java/pl/pabilo8/immersiveintelligence/common/CommonProxy.java index c95583910..71983b428 100644 --- a/src/main/java/pl/pabilo8/immersiveintelligence/common/CommonProxy.java +++ b/src/main/java/pl/pabilo8/immersiveintelligence/common/CommonProxy.java @@ -350,6 +350,8 @@ public static void registerRecipes(Register event) LighterFuelHandler.addFuel(FluidRegistry.getFluid("creosote"), 100); LighterFuelHandler.addFuel(FluidRegistry.getFluid("ethanol"), 20); + LighterFuelHandler.addFuel(FluidRegistry.getFluid("diesel"), 10); + LighterFuelHandler.addFuel(FluidRegistry.getFluid("biodiesel"), 10); MachinegunCoolantHandler.addCoolant(FluidRegistry.WATER, 1); diff --git a/src/main/java/pl/pabilo8/immersiveintelligence/common/compat/jei/IIRecipeJEIWrapper.java b/src/main/java/pl/pabilo8/immersiveintelligence/common/compat/jei/IIRecipeJEIWrapper.java index f9bc46d93..415b50f67 100644 --- a/src/main/java/pl/pabilo8/immersiveintelligence/common/compat/jei/IIRecipeJEIWrapper.java +++ b/src/main/java/pl/pabilo8/immersiveintelligence/common/compat/jei/IIRecipeJEIWrapper.java @@ -341,7 +341,7 @@ private void drawTimeInfo(int x, int y) .finish(); //Draw time text - String timeStr = GuiScreen.isShiftKeyDown()?"1 t": recipe.getTotalProcessTime()+" t"; + String timeStr = GuiScreen.isShiftKeyDown()?String.format("%.2f d", recipe.getTotalProcessTime()/24000f): recipe.getTotalProcessTime()+" t"; ClientUtils.mc().fontRenderer.drawString(timeStr, x+14, y+3, DecoColors.H1.getPackedRGB()); } diff --git a/src/main/java/pl/pabilo8/immersiveintelligence/common/crafting/IIRecipes.java b/src/main/java/pl/pabilo8/immersiveintelligence/common/crafting/IIRecipes.java index 1643980c1..93bb96882 100644 --- a/src/main/java/pl/pabilo8/immersiveintelligence/common/crafting/IIRecipes.java +++ b/src/main/java/pl/pabilo8/immersiveintelligence/common/crafting/IIRecipes.java @@ -638,10 +638,10 @@ public static void addBulletPressRecipes() new IngredientStack("plateSteel", 4), PressMolds.NAVAL_MINE, 4800); addMetalPressBullet(Casing.TRIPMINE, - new IngredientStack("plateBrass", 2), + new IngredientStack("plateSteel", 2), PressMolds.TRIPMINE, 3600); addMetalPressBullet(Casing.TELLERMINE, - new IngredientStack("plateBrass", 2), + new IngredientStack("plateSteel", 2), PressMolds.TELLERMINE, 3600); MetalPressRecipe.removeRecipes(new ItemStack(IEContent.itemBullet, 2, 0)); @@ -1177,7 +1177,7 @@ public static void addUpgradeRecipes() .withCost( new IngredientStack(IIContent.itemMotorGear.getStack(MotorGear.STEEL)), new IngredientStack(new ItemStack(IEContent.itemMaterial, 1, 8)), - new IngredientStack("stickSteel", 2) + new IngredientStack("stickSteel", 1) ) .withRequiredProgress(32000); diff --git a/src/main/java/pl/pabilo8/immersiveintelligence/common/item/armor/ItemIILightEngineerBoots.java b/src/main/java/pl/pabilo8/immersiveintelligence/common/item/armor/ItemIILightEngineerBoots.java index eb6c10e7d..e40b4f221 100644 --- a/src/main/java/pl/pabilo8/immersiveintelligence/common/item/armor/ItemIILightEngineerBoots.java +++ b/src/main/java/pl/pabilo8/immersiveintelligence/common/item/armor/ItemIILightEngineerBoots.java @@ -27,6 +27,7 @@ import javax.annotation.Nullable; import java.util.List; import java.util.Map; +import java.util.UUID; /** * @author Pabilo8 (pabilo@iiteam.net) @@ -35,6 +36,9 @@ @IIItemProperties(category = IICategory.WARFARE) public class ItemIILightEngineerBoots extends ItemIILightEngineerArmorBase implements IElectricEquipment { + // Unique UUIDs for attribute modifiers to avoid access conflicts + private static final UUID RACKETS_MODIFIER_UUID = UUID.fromString("C8E5F2A1-7D9C-4F6A-8E3B-A4C7D2E8F9B1"); + public ItemIILightEngineerBoots() { super(EntityEquipmentSlot.FEET, "LIGHT_ENGINEER_BOOTS"); @@ -69,10 +73,9 @@ public Multimap getAttributeModifiers(@Nonnull Entity if(equipmentSlot==this.armorType) { - if(ItemNBTHelper.hasKey(stack, "flippers")) multimap.put(EntityLivingBase.SWIM_SPEED.getName(), new AttributeModifier(ARMOR_MODIFIERS[equipmentSlot.getIndex()], "Flippers", 4, 2)); if(ItemNBTHelper.hasKey(stack, "rackets")) - multimap.put(SharedMonsterAttributes.MOVEMENT_SPEED.getName(), new AttributeModifier(ARMOR_MODIFIERS[equipmentSlot.getIndex()], "Rackets", 0.5, 1)); + multimap.put(SharedMonsterAttributes.MOVEMENT_SPEED.getName(), new AttributeModifier(RACKETS_MODIFIER_UUID, "Rackets", 0.5, 1)); //if(getUpgrades(stack).hasKey("")) //multimap.put(SharedMonsterAttributes.MOVEMENT_SPEED.getName(), new AttributeModifier(ARMOR_MODIFIERS[equipmentSlot.getIndex()], "Power Armor Movement Speed Debuff", -.03, 1)); //multimap.put(SharedMonsterAttributes.MOVEMENT_SPEED.getName(), new AttributeModifier(ARMOR_MODIFIERS[equipmentSlot.getIndex()], "Power Armor Movement Speed Debuff", -.03, 1)); diff --git a/src/main/java/pl/pabilo8/immersiveintelligence/common/item/tools/ItemIIElectricHammer.java b/src/main/java/pl/pabilo8/immersiveintelligence/common/item/tools/ItemIIElectricHammer.java index 65dd5a210..fb416b679 100644 --- a/src/main/java/pl/pabilo8/immersiveintelligence/common/item/tools/ItemIIElectricHammer.java +++ b/src/main/java/pl/pabilo8/immersiveintelligence/common/item/tools/ItemIIElectricHammer.java @@ -185,6 +185,10 @@ public EnumActionResult onItemUseFirst(EntityPlayer player, World world, BlockPo continue; if(mb.createStructure(world, pos, side, player)) { + //Consume energy from the electric hammer when forming a multiblock + if(stack.hasCapability(CapabilityEnergy.ENERGY, null) && !IIItemUtils.canConstructFreeOfCharge(player)) + stack.getCapability(CapabilityEnergy.ENERGY, null).extractEnergy(Tools.electricHammerEnergyPerUseConstruction, false); + if(player instanceof EntityPlayerMP) IEAdvancements.TRIGGER_MULTIBLOCK.trigger((EntityPlayerMP)player, mb, stack); return doAction(player, hand); @@ -212,14 +216,17 @@ public EnumActionResult onItemUse(EntityPlayer player, World world, BlockPos pos if(!(te instanceof IConstructionRequiringDevice)) return EnumActionResult.PASS; IConstructionRequiringDevice mb = ((IConstructionRequiringDevice)te).master(); - int energy = IIItemUtils.canConstructFreeOfCharge(player)?999999: cap.extractEnergy(Tools.electricHammerEnergyPerUseConstruction, false); - if(mb!=null&&!mb.isConstructionFinished()&&energy > 0) + if(mb!=null&&!mb.isConstructionFinished()) { - if(!IIItemUtils.canConstructFreeOfCharge(player)) - cap.extractEnergy(Tools.electricHammerEnergyPerUseConstruction, false); - mb.progressConstruction(energy); - world.playSound(null, pos, IISounds.constructionHammer, SoundCategory.PLAYERS, 0.5f, 1); + int energy = IIItemUtils.canConstructFreeOfCharge(player)?999999: cap.extractEnergy(Tools.electricHammerEnergyPerUseConstruction, false); + if(energy > 0) + { + if(!IIItemUtils.canConstructFreeOfCharge(player)) + cap.extractEnergy(Tools.electricHammerEnergyPerUseConstruction, false); + mb.progressConstruction(energy); + world.playSound(null, pos, IISounds.constructionHammer, SoundCategory.PLAYERS, 0.5f, 1); + } } return EnumActionResult.PASS; diff --git a/src/main/java/pl/pabilo8/immersiveintelligence/common/item/tools/ItemIIElectricWrench.java b/src/main/java/pl/pabilo8/immersiveintelligence/common/item/tools/ItemIIElectricWrench.java index 41519c333..8ac63f4f0 100644 --- a/src/main/java/pl/pabilo8/immersiveintelligence/common/item/tools/ItemIIElectricWrench.java +++ b/src/main/java/pl/pabilo8/immersiveintelligence/common/item/tools/ItemIIElectricWrench.java @@ -107,10 +107,15 @@ public EnumActionResult onItemUseFirst(EntityPlayer player, World world, BlockPo if(te==null||te.getCurrentUpgrade()==null) return EnumActionResult.PASS; + ItemStack heldItem = player.getHeldItem(hand); + //check if the powered wrench has charge + if(!IIItemUtils.canUpgradeFreeOfCharge(player)&&!hasEnoughEnergy(heldItem)) + return EnumActionResult.PASS; + if(te.addUpgradeInstallProgress(IIItemUtils.canUpgradeFreeOfCharge(player)?999999: Tools.electricWrenchUpgradeProgress)) { world.playSound(null, pos, IISounds.constructionElectricWrench, SoundCategory.PLAYERS, 0.5f, 1); - damageWrench(player.getHeldItem(hand), player); + damageWrench(heldItem, player); } return EnumActionResult.SUCCESS; diff --git a/src/main/java/pl/pabilo8/immersiveintelligence/common/world/BiomeWasteland.java b/src/main/java/pl/pabilo8/immersiveintelligence/common/world/BiomeWasteland.java index d6989127b..12a0c4195 100644 --- a/src/main/java/pl/pabilo8/immersiveintelligence/common/world/BiomeWasteland.java +++ b/src/main/java/pl/pabilo8/immersiveintelligence/common/world/BiomeWasteland.java @@ -5,6 +5,7 @@ import net.minecraft.world.biome.Biome; import pl.pabilo8.immersiveintelligence.ImmersiveIntelligence; +import java.util.ArrayList; import java.util.Collections; import java.util.List; @@ -47,6 +48,6 @@ public float getSpawningChance() @Override public List getSpawnableList(EnumCreatureType creatureType) { - return Collections.emptyList(); + return new ArrayList<>(); } } diff --git a/src/main/resources/assets/immersiveintelligence/ie_manual/en_us/ii_data/precision_assembler.md b/src/main/resources/assets/immersiveintelligence/ie_manual/en_us/ii_data/precision_assembler.md index 2eacc192d..fae011c6d 100644 --- a/src/main/resources/assets/immersiveintelligence/ie_manual/en_us/ii_data/precision_assembler.md +++ b/src/main/resources/assets/immersiveintelligence/ie_manual/en_us/ii_data/precision_assembler.md @@ -16,5 +16,5 @@ Just like an [engineer follows a blueprint during work](blueprints), the **Preci |[crafting]{source:"assembly_scheme"}|
The [scheme] can be installed through the user interface by placing it in the middle slot. # tools -Depending on the scheme the manufacturing process requires different tools, these tools ware down over time and will need replacement. +Depending on the scheme the manufacturing process requires different tools, these tools wear down over time and will need replacement. |[crafting]{source:"precision_tools"}| diff --git a/src/main/resources/assets/immersiveintelligence/ie_manual/en_us/ii_logistics/logistics.md b/src/main/resources/assets/immersiveintelligence/ie_manual/en_us/ii_logistics/logistics.md index 26be582e0..adb4b5734 100644 --- a/src/main/resources/assets/immersiveintelligence/ie_manual/en_us/ii_logistics/logistics.md +++ b/src/main/resources/assets/immersiveintelligence/ie_manual/en_us/ii_logistics/logistics.md @@ -2,5 +2,5 @@ Logistics Logi, bmats ASAP! # intro -Logistics is a unique branch of engineering focused on [storing, delivering and managing] the [transfer of goods.] A good logistic system consists of a warehouse for storage and nearby production for quick manufacturing. +Logistics is a unique branch of engineering focused on [storing, delivering and managing] the [transfer of goods.] A good logistics system consists of a warehouse for storage and nearby production for quick manufacturing. With the newest electronic technology, and some old [rotary](rotary_power.md) [powered machines](skycrate_system.md), creating a good delivery system has never been easier. \ No newline at end of file diff --git a/src/main/resources/assets/immersiveintelligence/ie_manual/en_us/ii_logistics/packer.md b/src/main/resources/assets/immersiveintelligence/ie_manual/en_us/ii_logistics/packer.md index 5ef3ad429..cd513cd22 100644 --- a/src/main/resources/assets/immersiveintelligence/ie_manual/en_us/ii_logistics/packer.md +++ b/src/main/resources/assets/immersiveintelligence/ie_manual/en_us/ii_logistics/packer.md @@ -7,8 +7,8 @@ The Packer is a machine used to batch load items into containers, such as crates To form it, use a [hammer](introduction#introductionHammer) on the [vertical conveyor]. # details By default, the packer offers 54 input storage slots for items. They can be inserted through a single conveyor on the rear of the machine. -To operation the machine, it requires electricity and a container to be provided on the 3 block long conveyor. -For packing orders, the machine uses a [Task System](task_system.md). Tasks can be added, removed and tweaked through its interface, or the [data system](data_main.md). +To operate the machine, it requires electricity and a container to be provided on the 3 block long conveyor. +For packing the orders, the machine uses a [Task System](task_system.md). Tasks can be added, removed and tweaked through its interface using the [data system](data_main.md). # details_2 The ["Pack"] task is used to load items into the provided container. By default, the packer can take any item (the * symbol) and the maximum possible amount of it. This can be changed by selecting a different mode. You can choose between taking in a select number of inventory slots, or number of items. The amount can be specified in the interface, in the input field below.