From b5f4a55618b0c191c6155e3040b44d5be89d2c54 Mon Sep 17 00:00:00 2001 From: Michael Date: Sat, 15 Aug 2020 10:09:49 +0100 Subject: [PATCH 01/19] Improved the modification table gui a bit --- .../client/screens/ModificationTableScreen.java | 8 +++++++- .../mininggadgets/common/items/upgrade/Upgrade.java | 7 +++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/direwolf20/mininggadgets/client/screens/ModificationTableScreen.java b/src/main/java/com/direwolf20/mininggadgets/client/screens/ModificationTableScreen.java index ced9f6c1..bb2d6265 100644 --- a/src/main/java/com/direwolf20/mininggadgets/client/screens/ModificationTableScreen.java +++ b/src/main/java/com/direwolf20/mininggadgets/client/screens/ModificationTableScreen.java @@ -11,6 +11,7 @@ import net.minecraft.client.gui.screen.inventory.ContainerScreen; import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.resources.I18n; +import net.minecraft.client.util.ITooltipFlag; import net.minecraft.entity.player.PlayerInventory; import net.minecraft.item.ItemStack; import net.minecraft.util.ResourceLocation; @@ -43,6 +44,11 @@ public void render(MatrixStack stack, int mouseX, int mouseY, float partialTicks @Override protected void func_230451_b_(MatrixStack stack, int mouseX, int mouseY) { // @mcp: func_230451_b_ = drawGuiContainerForegroundLayer + stack.push(); + stack.translate(xSize / 2f, guiTop - 70, 0); + stack.scale(.8f, .8f, .8f); + drawCenteredString(stack, font,"Shift click in and out of the GUI", 0, 0, 0xFFFFFF); + stack.pop(); } @Override @@ -124,7 +130,7 @@ public void render(MatrixStack stack, int mouseX, int mouseY, float partialTicks super.render(stack, mouseX, mouseY, partialTicks); if( this.upgrade != null ) - this.parent.renderTooltip(stack, new TranslationTextComponent(this.upgrade.getLocal()), mouseX, mouseY); + this.parent.renderTooltip(stack, this.upgrade.getStack().getTooltip(this.parent.getMinecraft().player, ITooltipFlag.TooltipFlags.NORMAL), mouseX, mouseY); } } } diff --git a/src/main/java/com/direwolf20/mininggadgets/common/items/upgrade/Upgrade.java b/src/main/java/com/direwolf20/mininggadgets/common/items/upgrade/Upgrade.java index edfd9cf1..baac3ec6 100644 --- a/src/main/java/com/direwolf20/mininggadgets/common/items/upgrade/Upgrade.java +++ b/src/main/java/com/direwolf20/mininggadgets/common/items/upgrade/Upgrade.java @@ -3,6 +3,7 @@ import com.direwolf20.mininggadgets.common.Config; import com.direwolf20.mininggadgets.common.MiningGadgets; import com.direwolf20.mininggadgets.common.items.UpgradeCard; +import net.minecraft.item.ItemStack; /** * The upgrade enum will serve as a single point of truth for all of the upgrades that are @@ -54,12 +55,14 @@ public enum Upgrade { private boolean active = true; private boolean isToggleable; private String tooltop; + private ItemStack upgradeStack; Upgrade(String name, int tier, int costPerBlock, boolean isToggleable) { this.name = name; this.tier = tier; this.costPerBlock = costPerBlock; this.card = new UpgradeCard(this, name.equals("empty") ? 64 : 1); + this.upgradeStack = new ItemStack(this.card); this.baseName = tier == -1 ? name : name.substring(0, name.lastIndexOf('_')); this.isToggleable = isToggleable; this.tooltop = "tooltop.mininggadgets." + this.baseName; @@ -85,6 +88,10 @@ public UpgradeCard getCard() { return card; } + public ItemStack getStack() { + return upgradeStack; + } + public int getTier() { return tier; } From 1439c0ecb91b204cafa2e46d546be5cc94e98dec Mon Sep 17 00:00:00 2001 From: Michael Date: Sat, 15 Aug 2020 10:15:51 +0100 Subject: [PATCH 02/19] Added translation --- src/generated/resources/.cache/cache | 2 +- src/generated/resources/assets/mininggadgets/lang/en_us.json | 1 + .../mininggadgets/client/screens/ModificationTableScreen.java | 2 +- .../direwolf20/mininggadgets/common/data/GeneratorLanguage.java | 2 ++ 4 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/generated/resources/.cache/cache b/src/generated/resources/.cache/cache index 49abc6c9..a5e4eff1 100644 --- a/src/generated/resources/.cache/cache +++ b/src/generated/resources/.cache/cache @@ -1,7 +1,7 @@ b7013e95c0f001eefb22e978563099d6af098f17 assets/mininggadgets/blockstates/minerslight.json c2b2d34c116a3d6da9c62ce72021bd999590e3f2 assets/mininggadgets/blockstates/modificationtable.json 17f3e42d932950bb56cf0f43004c2badcef8cdc0 assets/mininggadgets/blockstates/renderblock.json -9b0d83d36145975cf2e0f2aa60cbbc4ed6e976de assets/mininggadgets/lang/en_us.json +cb7534b125d00c20f048edcb45ca6faf5bc573c6 assets/mininggadgets/lang/en_us.json ce3df1f391ab2c77491ef868783a7172ab3d99c8 assets/mininggadgets/models/block/minerslight.json 2a77a20ef18ce7564fd36090887955828fbc2d85 assets/mininggadgets/models/block/modificationtable.json 36717b860f1ae48e4ab1a72cd4cf5cdc481c5d2a assets/mininggadgets/models/block/renderblock.json diff --git a/src/generated/resources/assets/mininggadgets/lang/en_us.json b/src/generated/resources/assets/mininggadgets/lang/en_us.json index 1badf53a..5a7e9467 100644 --- a/src/generated/resources/assets/mininggadgets/lang/en_us.json +++ b/src/generated/resources/assets/mininggadgets/lang/en_us.json @@ -28,6 +28,7 @@ "itemGroup.mininggadgets": "Mining Gadgets", "mininggadgets.gadget.energy": "Energy: %d/%d", "mininggadgets.gadget.range_change": "Range Change: %1$d x %1$d", + "mininggadgets.text.shift_click": "Shift click in and out of the GUI", "mininggadgets.tooltip.item.battery_boost": "Battery Boost: %1$d", "mininggadgets.tooltip.item.break_cost": "Per Block Cost: %1$d", "mininggadgets.tooltip.item.show_upgrades": "Hold %s to show upgrades", diff --git a/src/main/java/com/direwolf20/mininggadgets/client/screens/ModificationTableScreen.java b/src/main/java/com/direwolf20/mininggadgets/client/screens/ModificationTableScreen.java index bb2d6265..bd2d6dcf 100644 --- a/src/main/java/com/direwolf20/mininggadgets/client/screens/ModificationTableScreen.java +++ b/src/main/java/com/direwolf20/mininggadgets/client/screens/ModificationTableScreen.java @@ -47,7 +47,7 @@ protected void func_230451_b_(MatrixStack stack, int mouseX, int mouseY) { // @m stack.push(); stack.translate(xSize / 2f, guiTop - 70, 0); stack.scale(.8f, .8f, .8f); - drawCenteredString(stack, font,"Shift click in and out of the GUI", 0, 0, 0xFFFFFF); + drawCenteredString(stack, font,new TranslationTextComponent(String.format("%s.%s", MiningGadgets.MOD_ID, "text.shift_click")), 0, 0, 0xFFFFFF); stack.pop(); } diff --git a/src/main/java/com/direwolf20/mininggadgets/common/data/GeneratorLanguage.java b/src/main/java/com/direwolf20/mininggadgets/common/data/GeneratorLanguage.java index 5cba7441..e88c0bec 100644 --- a/src/main/java/com/direwolf20/mininggadgets/common/data/GeneratorLanguage.java +++ b/src/main/java/com/direwolf20/mininggadgets/common/data/GeneratorLanguage.java @@ -77,6 +77,8 @@ protected void addTranslations() { addPrefixed("tooltip.item.battery_boost", "Battery Boost: %1$d"); addPrefixed("tooltip.item.break_cost", "Per Block Cost: %1$d"); + addPrefixed("text.shift_click", "Shift click in and out of the GUI"); + // Screen Buttons and text addPrefixed("tooltip.screen.size", "Size: %1$d x %1$d"); addPrefixed("tooltip.screen.range", "Range"); From 804fc6253c891142c071fc978f7bb91b6ef953c2 Mon Sep 17 00:00:00 2001 From: Michael Date: Sat, 15 Aug 2020 11:25:55 +0100 Subject: [PATCH 03/19] Added keybinding to open gui (off by default) --- src/generated/resources/.cache/cache | 2 +- .../assets/mininggadgets/lang/en_us.json | 1 + .../mininggadgets/client/ClientEvents.java | 19 +++++++++++++++++++ .../mininggadgets/client/OurKeys.java | 13 +++++++++++++ .../mininggadgets/common/MiningGadgets.java | 6 ++++++ .../common/data/GeneratorLanguage.java | 1 + .../common/items/MiningGadget.java | 9 +++++++-- 7 files changed, 48 insertions(+), 3 deletions(-) create mode 100644 src/main/java/com/direwolf20/mininggadgets/client/OurKeys.java diff --git a/src/generated/resources/.cache/cache b/src/generated/resources/.cache/cache index a5e4eff1..74fe380f 100644 --- a/src/generated/resources/.cache/cache +++ b/src/generated/resources/.cache/cache @@ -1,7 +1,7 @@ b7013e95c0f001eefb22e978563099d6af098f17 assets/mininggadgets/blockstates/minerslight.json c2b2d34c116a3d6da9c62ce72021bd999590e3f2 assets/mininggadgets/blockstates/modificationtable.json 17f3e42d932950bb56cf0f43004c2badcef8cdc0 assets/mininggadgets/blockstates/renderblock.json -cb7534b125d00c20f048edcb45ca6faf5bc573c6 assets/mininggadgets/lang/en_us.json +0297c83c6747b9b097e6421629bc5494336076e4 assets/mininggadgets/lang/en_us.json ce3df1f391ab2c77491ef868783a7172ab3d99c8 assets/mininggadgets/models/block/minerslight.json 2a77a20ef18ce7564fd36090887955828fbc2d85 assets/mininggadgets/models/block/modificationtable.json 36717b860f1ae48e4ab1a72cd4cf5cdc481c5d2a assets/mininggadgets/models/block/renderblock.json diff --git a/src/generated/resources/assets/mininggadgets/lang/en_us.json b/src/generated/resources/assets/mininggadgets/lang/en_us.json index 5a7e9467..5c886deb 100644 --- a/src/generated/resources/assets/mininggadgets/lang/en_us.json +++ b/src/generated/resources/assets/mininggadgets/lang/en_us.json @@ -28,6 +28,7 @@ "itemGroup.mininggadgets": "Mining Gadgets", "mininggadgets.gadget.energy": "Energy: %d/%d", "mininggadgets.gadget.range_change": "Range Change: %1$d x %1$d", + "mininggadgets.text.open_gui": "Open Mining Gadget Settings", "mininggadgets.text.shift_click": "Shift click in and out of the GUI", "mininggadgets.tooltip.item.battery_boost": "Battery Boost: %1$d", "mininggadgets.tooltip.item.break_cost": "Per Block Cost: %1$d", diff --git a/src/main/java/com/direwolf20/mininggadgets/client/ClientEvents.java b/src/main/java/com/direwolf20/mininggadgets/client/ClientEvents.java index 1e5211cf..0e9bd4fb 100644 --- a/src/main/java/com/direwolf20/mininggadgets/client/ClientEvents.java +++ b/src/main/java/com/direwolf20/mininggadgets/client/ClientEvents.java @@ -2,12 +2,15 @@ import com.direwolf20.mininggadgets.client.renderer.BlockOverlayRender; import com.direwolf20.mininggadgets.client.renderer.RenderMiningLaser2; +import com.direwolf20.mininggadgets.client.screens.ModScreens; +import com.direwolf20.mininggadgets.common.MiningGadgets; import com.direwolf20.mininggadgets.common.items.MiningGadget; import net.minecraft.client.Minecraft; import net.minecraft.client.entity.player.AbstractClientPlayerEntity; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.item.ItemStack; import net.minecraftforge.client.event.DrawHighlightEvent; +import net.minecraftforge.client.event.InputEvent; import net.minecraftforge.client.event.RenderWorldLastEvent; import net.minecraftforge.eventbus.api.SubscribeEvent; @@ -44,4 +47,20 @@ static void renderWorldLastEvent(RenderWorldLastEvent evt) { } } } + + @SubscribeEvent + static void keyPressed(InputEvent.KeyInputEvent event) { + if (OurKeys.shiftClickGuiBinding.isPressed() && Minecraft.getInstance().currentScreen == null) { + if (Minecraft.getInstance().player == null) { + return; + } + + ItemStack gadget = MiningGadget.getGadget(Minecraft.getInstance().player); + if (gadget.isEmpty()) { + return; + } + + ModScreens.openGadgetSettingsScreen(gadget); + } + } } diff --git a/src/main/java/com/direwolf20/mininggadgets/client/OurKeys.java b/src/main/java/com/direwolf20/mininggadgets/client/OurKeys.java new file mode 100644 index 00000000..3e305236 --- /dev/null +++ b/src/main/java/com/direwolf20/mininggadgets/client/OurKeys.java @@ -0,0 +1,13 @@ +package com.direwolf20.mininggadgets.client; + +import net.minecraft.client.settings.KeyBinding; +import net.minecraft.client.util.InputMappings; +import net.minecraftforge.fml.client.registry.ClientRegistry; + +public class OurKeys { + public static final KeyBinding shiftClickGuiBinding = new KeyBinding("mininggadgets.text.open_gui", InputMappings.INPUT_INVALID.getKeyCode(), "itemGroup.mininggadgets"); + + public static void register() { + ClientRegistry.registerKeyBinding(shiftClickGuiBinding); + } +} diff --git a/src/main/java/com/direwolf20/mininggadgets/common/MiningGadgets.java b/src/main/java/com/direwolf20/mininggadgets/common/MiningGadgets.java index af5e09d7..c036fda0 100644 --- a/src/main/java/com/direwolf20/mininggadgets/common/MiningGadgets.java +++ b/src/main/java/com/direwolf20/mininggadgets/common/MiningGadgets.java @@ -2,12 +2,15 @@ import com.direwolf20.mininggadgets.client.ClientEvents; import com.direwolf20.mininggadgets.client.ClientSetup; +import com.direwolf20.mininggadgets.client.OurKeys; import com.direwolf20.mininggadgets.common.blocks.ModBlocks; import com.direwolf20.mininggadgets.common.containers.ModContainers; import com.direwolf20.mininggadgets.common.events.ServerTickHandler; import com.direwolf20.mininggadgets.common.items.MiningGadget; import com.direwolf20.mininggadgets.common.items.ModItems; import com.direwolf20.mininggadgets.common.network.PacketHandler; +import net.minecraft.client.settings.KeyBinding; +import net.minecraft.client.util.InputMappings; import net.minecraft.item.ItemGroup; import net.minecraft.item.ItemStack; import net.minecraftforge.common.MinecraftForge; @@ -15,6 +18,7 @@ import net.minecraftforge.eventbus.api.IEventBus; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.fml.ModLoadingContext; +import net.minecraftforge.fml.client.registry.ClientRegistry; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.config.ModConfig; import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent; @@ -23,6 +27,7 @@ import net.minecraftforge.fml.loading.FMLPaths; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; +import org.lwjgl.glfw.GLFW; @Mod(MiningGadgets.MOD_ID) public class MiningGadgets @@ -82,6 +87,7 @@ private void setup(final FMLCommonSetupEvent event) private void setupClient(final FMLClientSetupEvent event) { // Register the container screens. ClientSetup.setup(); + OurKeys.register(); MinecraftForge.EVENT_BUS.register(ClientEvents.class); } diff --git a/src/main/java/com/direwolf20/mininggadgets/common/data/GeneratorLanguage.java b/src/main/java/com/direwolf20/mininggadgets/common/data/GeneratorLanguage.java index e88c0bec..17bc40c6 100644 --- a/src/main/java/com/direwolf20/mininggadgets/common/data/GeneratorLanguage.java +++ b/src/main/java/com/direwolf20/mininggadgets/common/data/GeneratorLanguage.java @@ -78,6 +78,7 @@ protected void addTranslations() { addPrefixed("tooltip.item.break_cost", "Per Block Cost: %1$d"); addPrefixed("text.shift_click", "Shift click in and out of the GUI"); + addPrefixed("text.open_gui", "Open Mining Gadget Settings"); // Screen Buttons and text addPrefixed("tooltip.screen.size", "Size: %1$d x %1$d"); diff --git a/src/main/java/com/direwolf20/mininggadgets/common/items/MiningGadget.java b/src/main/java/com/direwolf20/mininggadgets/common/items/MiningGadget.java index 0d68fca5..54904171 100644 --- a/src/main/java/com/direwolf20/mininggadgets/common/items/MiningGadget.java +++ b/src/main/java/com/direwolf20/mininggadgets/common/items/MiningGadget.java @@ -1,5 +1,6 @@ package com.direwolf20.mininggadgets.common.items; +import com.direwolf20.mininggadgets.client.OurKeys; import com.direwolf20.mininggadgets.client.particles.playerparticle.PlayerParticleData; import com.direwolf20.mininggadgets.client.screens.ModScreens; import com.direwolf20.mininggadgets.common.Config; @@ -53,6 +54,7 @@ import net.minecraftforge.energy.IEnergyStorage; import net.minecraftforge.event.world.BlockEvent; import net.minecraftforge.fml.ForgeI18n; +import org.lwjgl.glfw.GLFW; import javax.annotation.Nonnull; import javax.annotation.Nullable; @@ -225,8 +227,11 @@ private ActionResult onItemShiftRightClick(World world, PlayerEntity if (!world.isRemote) MiningProperties.setCanMine(itemstack, true); - if (world.isRemote) - ModScreens.openGadgetSettingsScreen(itemstack); + if (world.isRemote) { + if (OurKeys.shiftClickGuiBinding.getKey() == InputMappings.INPUT_INVALID) { + ModScreens.openGadgetSettingsScreen(itemstack); + } + } return new ActionResult<>(ActionResultType.SUCCESS, itemstack); } From 9cb99875ca822b8b7063387689d08159e2894356 Mon Sep 17 00:00:00 2001 From: Michael Date: Sat, 15 Aug 2020 13:39:49 +0100 Subject: [PATCH 04/19] "Fixed" laser rendering through walls #21 --- .../mininggadgets/client/renderer/RenderMiningLaser2.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/direwolf20/mininggadgets/client/renderer/RenderMiningLaser2.java b/src/main/java/com/direwolf20/mininggadgets/client/renderer/RenderMiningLaser2.java index 5e1cf653..9c23b3be 100644 --- a/src/main/java/com/direwolf20/mininggadgets/client/renderer/RenderMiningLaser2.java +++ b/src/main/java/com/direwolf20/mininggadgets/client/renderer/RenderMiningLaser2.java @@ -104,7 +104,7 @@ private static void drawLasers(RenderWorldLastEvent event, Vector3d from, RayTra builder = buffer.getBuffer(MyRenderType.LASER_MAIN_CORE); drawBeam(xOffset, yOffset, zOffset, builder, positionMatrix, matrixNormal, thickness/2, activeHand, distance, v, v + distance * 1.5, ticks, beam2r,beam2g,beam2b,1f); matrix.pop(); - RenderSystem.disableDepthTest(); +// RenderSystem.disableDepthTest(); buffer.finish(); } From 31caca030613b4172235e32277d3430de6698648 Mon Sep 17 00:00:00 2001 From: Michael Date: Sat, 15 Aug 2020 13:40:01 +0100 Subject: [PATCH 05/19] bumped forge --- gradle.properties | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gradle.properties b/gradle.properties index e8fdaac4..007419af 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,6 +3,6 @@ org.gradle.daemon=false #Mod Info mod_version=1.4.0 #Dependencies -forge_version=1.16.1-32.0.63 +forge_version=1.16.1-32.0.108 mcp_version=20200712-1.16.1 -jei_version=1.16.1:7.0.0.6 \ No newline at end of file +jei_version=1.16.1:7.0.1.10 \ No newline at end of file From 6b14fa20e820466b5308c6f5f26dccc3b2cee9b9 Mon Sep 17 00:00:00 2001 From: Michael Date: Sat, 15 Aug 2020 13:55:02 +0100 Subject: [PATCH 06/19] Fixed: #98 (needs back porting) --- .../common/items/UpgradeCard.java | 2 +- .../common/items/upgrade/Upgrade.java | 86 ++++++++++--------- .../common/tiles/RenderBlockTileEntity.java | 2 +- 3 files changed, 46 insertions(+), 44 deletions(-) diff --git a/src/main/java/com/direwolf20/mininggadgets/common/items/UpgradeCard.java b/src/main/java/com/direwolf20/mininggadgets/common/items/UpgradeCard.java index 598353cd..7d67e2fa 100644 --- a/src/main/java/com/direwolf20/mininggadgets/common/items/UpgradeCard.java +++ b/src/main/java/com/direwolf20/mininggadgets/common/items/UpgradeCard.java @@ -42,7 +42,7 @@ public void addInformation(ItemStack stack, @Nullable World world, List 0, false), + + SILK("silk", () -> Config.UPGRADECOST_SILKTOUCH.get(), true), + VOID_JUNK("void_junk", () -> Config.UPGRADECOST_VOID.get()), + MAGNET("magnet", () -> Config.UPGRADECOST_MAGNET.get()), + FREEZING("freezing", () -> 0), + THREE_BY_THREE("three_by_three", () -> 0, false), + LIGHT_PLACER("light_placer", () -> 0), // Tiered - FORTUNE_1("fortune_1", 1, Config.UPGRADECOST_FORTUNE1.get(), true), - FORTUNE_2("fortune_2", 2, Config.UPGRADECOST_FORTUNE2.get(), true), - FORTUNE_3("fortune_3", 3, Config.UPGRADECOST_FORTUNE3.get(), true), - - BATTERY_1("battery_1", 1, 0), - BATTERY_2("battery_2", 2, 0), - BATTERY_3("battery_3", 3, 0), - - RANGE_1("range_1", 1, 0), - RANGE_2("range_2", 2, 0), - RANGE_3("range_3", 3, 0), - - EFFICIENCY_1("efficiency_1", 1, Config.UPGRADECOST_EFFICIENCY1.get(), true), - EFFICIENCY_2("efficiency_2", 2, Config.UPGRADECOST_EFFICIENCY2.get(), true), - EFFICIENCY_3("efficiency_3", 3, Config.UPGRADECOST_EFFICIENCY3.get(), true), - EFFICIENCY_4("efficiency_4", 4, Config.UPGRADECOST_EFFICIENCY4.get(), true), - EFFICIENCY_5("efficiency_5", 5, Config.UPGRADECOST_EFFICIENCY5.get(), true); - - private String name; - private String baseName; - private UpgradeCard card; - private int tier; - private int costPerBlock; + FORTUNE_1("fortune_1", 1, () -> Config.UPGRADECOST_FORTUNE1.get(), true), + FORTUNE_2("fortune_2", 2, () -> Config.UPGRADECOST_FORTUNE2.get(), true), + FORTUNE_3("fortune_3", 3, () -> Config.UPGRADECOST_FORTUNE3.get(), true), + + BATTERY_1("battery_1", 1, () -> 0), + BATTERY_2("battery_2", 2, () -> 0), + BATTERY_3("battery_3", 3, () -> 0), + + RANGE_1("range_1", 1, () -> 0), + RANGE_2("range_2", 2, () -> 0), + RANGE_3("range_3", 3, () -> 0), + + EFFICIENCY_1("efficiency_1", 1, () -> Config.UPGRADECOST_EFFICIENCY1.get(), true), + EFFICIENCY_2("efficiency_2", 2, () -> Config.UPGRADECOST_EFFICIENCY2.get(), true), + EFFICIENCY_3("efficiency_3", 3, () -> Config.UPGRADECOST_EFFICIENCY3.get(), true), + EFFICIENCY_4("efficiency_4", 4, () -> Config.UPGRADECOST_EFFICIENCY4.get(), true), + EFFICIENCY_5("efficiency_5", 5, () -> Config.UPGRADECOST_EFFICIENCY5.get(), true); + + private final String name; + private final String baseName; + private final UpgradeCard card; + private final int tier; + private final Supplier costPerBlock; private boolean active = true; - private boolean isToggleable; - private String tooltop; - private ItemStack upgradeStack; + private final boolean isToggleable; + private final String toolTip; + private final ItemStack upgradeStack; - Upgrade(String name, int tier, int costPerBlock, boolean isToggleable) { + Upgrade(String name, int tier, Supplier costPerBlock, boolean isToggleable) { this.name = name; this.tier = tier; this.costPerBlock = costPerBlock; @@ -65,18 +67,18 @@ public enum Upgrade { this.upgradeStack = new ItemStack(this.card); this.baseName = tier == -1 ? name : name.substring(0, name.lastIndexOf('_')); this.isToggleable = isToggleable; - this.tooltop = "tooltop.mininggadgets." + this.baseName; + this.toolTip = "tooltop.mininggadgets." + this.baseName; } - Upgrade(String name, int tier, int costPerBlock) { + Upgrade(String name, int tier, Supplier costPerBlock) { this(name, tier, costPerBlock, false); } - Upgrade(String name, int costPerBlock) { + Upgrade(String name, Supplier costPerBlock) { this(name, -1, costPerBlock, true); } - Upgrade(String name, int costPerBlock, boolean isToggleable) { + Upgrade(String name, Supplier costPerBlock, boolean isToggleable) { this(name, -1, costPerBlock, isToggleable); } @@ -97,7 +99,7 @@ public int getTier() { } public int getCostPerBlock() { - return costPerBlock; + return costPerBlock.get(); } // Try and always use base name eval @@ -130,8 +132,8 @@ public boolean isToggleable() { return isToggleable; } - public String getTooltop() { - return tooltop; + public String getToolTip() { + return toolTip; } /** diff --git a/src/main/java/com/direwolf20/mininggadgets/common/tiles/RenderBlockTileEntity.java b/src/main/java/com/direwolf20/mininggadgets/common/tiles/RenderBlockTileEntity.java index 0f95d0bb..a0f5bd8e 100644 --- a/src/main/java/com/direwolf20/mininggadgets/common/tiles/RenderBlockTileEntity.java +++ b/src/main/java/com/direwolf20/mininggadgets/common/tiles/RenderBlockTileEntity.java @@ -280,7 +280,7 @@ public CompoundNBT write(CompoundNBT tag) { } private void removeBlock() { - if (world == null || world.isRemote || playerUUID == null || playerUUID.equals(null)) + if (world == null || world.isRemote || playerUUID == null) return; PlayerEntity player = world.getPlayerByUuid(playerUUID); From 53bf1dfae41f0530b08e13b38869373d3c8bca26 Mon Sep 17 00:00:00 2001 From: Michael Date: Sat, 15 Aug 2020 16:16:15 +0100 Subject: [PATCH 07/19] Improved visuals and runData for this version --- build.gradle | 3 ++ src/generated/resources/.cache/cache | 50 +++++++++---------- .../assets/mininggadgets/lang/en_us.json | 13 ++--- .../models/block/minerslight.json | 2 +- .../models/block/modificationtable.json | 2 +- .../models/block/renderblock.json | 2 +- .../models/item/upgrade_battery_1.json | 2 +- .../models/item/upgrade_battery_2.json | 2 +- .../models/item/upgrade_battery_3.json | 2 +- .../models/item/upgrade_efficiency_1.json | 2 +- .../models/item/upgrade_efficiency_2.json | 2 +- .../models/item/upgrade_efficiency_3.json | 2 +- .../models/item/upgrade_efficiency_4.json | 2 +- .../models/item/upgrade_efficiency_5.json | 2 +- .../models/item/upgrade_empty.json | 2 +- .../models/item/upgrade_fortune_1.json | 2 +- .../models/item/upgrade_fortune_2.json | 2 +- .../models/item/upgrade_fortune_3.json | 2 +- .../models/item/upgrade_freezing.json | 2 +- .../models/item/upgrade_light_placer.json | 2 +- .../models/item/upgrade_magnet.json | 2 +- .../models/item/upgrade_range_1.json | 2 +- .../models/item/upgrade_range_2.json | 2 +- .../models/item/upgrade_range_3.json | 2 +- .../models/item/upgrade_silk.json | 2 +- .../models/item/upgrade_three_by_three.json | 2 +- .../models/item/upgrade_void_junk.json | 2 +- .../client/screens/MiningVisualsScreen.java | 47 +++++++++++++---- .../common/data/GeneratorLanguage.java | 13 ++--- 29 files changed, 103 insertions(+), 71 deletions(-) diff --git a/build.gradle b/build.gradle index 12c9666b..21ba1ca4 100644 --- a/build.gradle +++ b/build.gradle @@ -104,6 +104,7 @@ repositories { url 'https://www.dogforce-games.com/maven/' } } + dependencies { // Specify the version of Minecraft to use, If this is any group other then 'net.minecraft' it is assumed // that the dep is a ForgeGradle 'patcher' dependency. And it's patches will be applied. @@ -114,6 +115,8 @@ dependencies { compileOnly fg.deobf("mezz.jei:jei-${jei_version}:api") runtimeOnly fg.deobf("mezz.jei:jei-${jei_version}") + runtimeOnly fg.deobf("cpw.mods:cpw_inventorysorter_master:18.0.0") + // You may put jars on which you depend on in ./libs or you may define them like so.. // compile "some.group:artifact:version:classifier" // compile "some.group:artifact:version" diff --git a/src/generated/resources/.cache/cache b/src/generated/resources/.cache/cache index 74fe380f..06d2cd61 100644 --- a/src/generated/resources/.cache/cache +++ b/src/generated/resources/.cache/cache @@ -1,33 +1,33 @@ b7013e95c0f001eefb22e978563099d6af098f17 assets/mininggadgets/blockstates/minerslight.json c2b2d34c116a3d6da9c62ce72021bd999590e3f2 assets/mininggadgets/blockstates/modificationtable.json 17f3e42d932950bb56cf0f43004c2badcef8cdc0 assets/mininggadgets/blockstates/renderblock.json -0297c83c6747b9b097e6421629bc5494336076e4 assets/mininggadgets/lang/en_us.json -ce3df1f391ab2c77491ef868783a7172ab3d99c8 assets/mininggadgets/models/block/minerslight.json -2a77a20ef18ce7564fd36090887955828fbc2d85 assets/mininggadgets/models/block/modificationtable.json -36717b860f1ae48e4ab1a72cd4cf5cdc481c5d2a assets/mininggadgets/models/block/renderblock.json +abe792cd548a1eeaa284fb7b9e4148a7f7d9621b assets/mininggadgets/lang/en_us.json +973359b4f13b4c70416dd8b3e68a3a4d8886f14f assets/mininggadgets/models/block/minerslight.json +a28c42b7d4a511d87ae88461f1845ed1b6bbc401 assets/mininggadgets/models/block/modificationtable.json +30eb13c57d2684c6de2f1d2edfb7e535599b3a61 assets/mininggadgets/models/block/renderblock.json c7cb89cde2f2fa96162238c434620e5c5093e1e0 assets/mininggadgets/models/item/minerslight.json 18734ba6f77297dd2b3ca6f3b8ef706a4456e52b assets/mininggadgets/models/item/modificationtable.json -101767260cae85358ea8066f2b29497bbd39c241 assets/mininggadgets/models/item/upgrade_battery_1.json -441b07000c7e33c678aea7f84e348c816540d4db assets/mininggadgets/models/item/upgrade_battery_2.json -f90ee7125d690af479c91ba321e392258a3292f6 assets/mininggadgets/models/item/upgrade_battery_3.json -b2a4e32e2dd984c2c02ac943954d5c49cc987d6d assets/mininggadgets/models/item/upgrade_efficiency_1.json -f81d050842a1a25de54f285e7854260b70497aef assets/mininggadgets/models/item/upgrade_efficiency_2.json -9aa706e419c45edde9a55b62a71abf1c95bbadf1 assets/mininggadgets/models/item/upgrade_efficiency_3.json -99b3a6f834cb2a9cbffcc62984a0174b0960891d assets/mininggadgets/models/item/upgrade_efficiency_4.json -608ba244eba169219fe8b7da1c653dc556b42c24 assets/mininggadgets/models/item/upgrade_efficiency_5.json -05c7b227dea9c2191dae904668e25b4191caea26 assets/mininggadgets/models/item/upgrade_empty.json -c390605ae8278743d37fdd983fc5a14beb83626a assets/mininggadgets/models/item/upgrade_fortune_1.json -b7f9668b5187a8f327caa4d2b6f04be792ca8b6a assets/mininggadgets/models/item/upgrade_fortune_2.json -573fbcd143a7e6235fae38e18917df94f1a0cefa assets/mininggadgets/models/item/upgrade_fortune_3.json -d3c6a1e5bf2e5bb4e86390c564275618c1a90cd7 assets/mininggadgets/models/item/upgrade_freezing.json -b17d79c81dc26f54521cfd43d38f89716f9a613f assets/mininggadgets/models/item/upgrade_light_placer.json -7858a8472687d37e6bb382ba488a8fd25afb0e44 assets/mininggadgets/models/item/upgrade_magnet.json -b9bf7d0ef3f307e386537f388a3ef1e21fda91f8 assets/mininggadgets/models/item/upgrade_range_1.json -158c7fe8365e6ad0821db0fe327f78002793c964 assets/mininggadgets/models/item/upgrade_range_2.json -79fc52072c1ef8afd510215ac84b324ef4bac4d7 assets/mininggadgets/models/item/upgrade_range_3.json -830d8d2a7922eb33942d6f73aaa7b1708fd1777c assets/mininggadgets/models/item/upgrade_silk.json -27a1c29dec507aa043fcd44962ebe1d03d81e950 assets/mininggadgets/models/item/upgrade_three_by_three.json -50e40e2cd1b5afd7f06b32987b424e6d94d74539 assets/mininggadgets/models/item/upgrade_void_junk.json +03124e1ba86f9be7fb64caa66fe5bbb752cae3f2 assets/mininggadgets/models/item/upgrade_battery_1.json +0bf32736a1afe3582737acd30e13b91f1928c45d assets/mininggadgets/models/item/upgrade_battery_2.json +fdee7ff3eea155e8947b3a67398bacd160e75e48 assets/mininggadgets/models/item/upgrade_battery_3.json +7b95ba53768f6d2c1f810c983d58c3d827b23fbc assets/mininggadgets/models/item/upgrade_efficiency_1.json +49f634bcad8f9f0f9a30fa3fb78233fe546adb1d assets/mininggadgets/models/item/upgrade_efficiency_2.json +7c51e8a30851c918d414a827f3c6c757f08717bd assets/mininggadgets/models/item/upgrade_efficiency_3.json +31c29ea8c58ce269610dbcd92bcdc5658c2792c1 assets/mininggadgets/models/item/upgrade_efficiency_4.json +191def03fffa72f3aa414c0c85c59d56d76f5779 assets/mininggadgets/models/item/upgrade_efficiency_5.json +194518d5d2faf78756434fa1a18f8f2ad9583296 assets/mininggadgets/models/item/upgrade_empty.json +e6161f1c39ffd96a5005da98f5f8ca4282bda0ce assets/mininggadgets/models/item/upgrade_fortune_1.json +e2815e3ce5b9f75cbd4af7d54aa9366d06f52f77 assets/mininggadgets/models/item/upgrade_fortune_2.json +8e9049ad71e2f33f613b6669a5ca80ac5bc57786 assets/mininggadgets/models/item/upgrade_fortune_3.json +ba8917e3c2d877da76ab22c8b74527d88035fb46 assets/mininggadgets/models/item/upgrade_freezing.json +27927c9fb7122ba8e3a22f79b03af9b3390da023 assets/mininggadgets/models/item/upgrade_light_placer.json +a886745775c5c632a20d5232a3bbec5650815a47 assets/mininggadgets/models/item/upgrade_magnet.json +9490052868ec9732110ac60f56f0d3225537ecd2 assets/mininggadgets/models/item/upgrade_range_1.json +cb0c341c014dd44118b38cd3e92ee791868411b1 assets/mininggadgets/models/item/upgrade_range_2.json +7f4c09db6454ab72dc8728d88f6c781b1072f3cc assets/mininggadgets/models/item/upgrade_range_3.json +72a06fd3b75df16c683ce816a52802f603580c47 assets/mininggadgets/models/item/upgrade_silk.json +874d2494436b644dd14a7fd929681b977f611e4f assets/mininggadgets/models/item/upgrade_three_by_three.json +78c4ab195fe9b83b63edfaef11c9c2819947bc90 assets/mininggadgets/models/item/upgrade_void_junk.json a4843d0fda4ad7b586ea116b9bce8718d7f84c4d data/mininggadgets/advancements/recipes/mininggadgets/mininggadget.json 3e054d08ee649172d7f210b913d870fe1db1371e data/mininggadgets/advancements/recipes/mininggadgets/modificationtable.json 0fcaaf2f4b432fd60d54449fefdd5706db990acd data/mininggadgets/advancements/recipes/mininggadgets/upgrade_battery_1.json diff --git a/src/generated/resources/assets/mininggadgets/lang/en_us.json b/src/generated/resources/assets/mininggadgets/lang/en_us.json index 5c886deb..643ec5fa 100644 --- a/src/generated/resources/assets/mininggadgets/lang/en_us.json +++ b/src/generated/resources/assets/mininggadgets/lang/en_us.json @@ -36,21 +36,22 @@ "mininggadgets.tooltip.item.upgrade_cost": "Upgrade Cost: %1$d", "mininggadgets.tooltip.item.upgrades": "Current Upgrades:", "mininggadgets.tooltip.item.use_cost": "+%1$d FE per use", + "mininggadgets.tooltip.screen.beam_preview": "Beam preview", "mininggadgets.tooltip.screen.blacklist": "Blacklist active", - "mininggadgets.tooltip.screen.blue_inner": "Blue Inner", - "mininggadgets.tooltip.screen.blue_outer": "Blue Outer", + "mininggadgets.tooltip.screen.block_break_style": "Breaking Style", + "mininggadgets.tooltip.screen.blue": "Blue", "mininggadgets.tooltip.screen.delay_explain": "Controls how often a freeze particle is spawned\nby default it is one particle every tick, to reduce\nthe amount of particles add more delay", "mininggadgets.tooltip.screen.edit_filters": "Edit Filters", "mininggadgets.tooltip.screen.fade": "Fade Blocks", "mininggadgets.tooltip.screen.freeze_delay": "Freeze Delay", - "mininggadgets.tooltip.screen.green_inner": "Green Inner", - "mininggadgets.tooltip.screen.green_outer": "Green Outer", + "mininggadgets.tooltip.screen.green": "Green", + "mininggadgets.tooltip.screen.inner_color": "Inner beam color", "mininggadgets.tooltip.screen.mining_gadget": "Gadget Settings", "mininggadgets.tooltip.screen.no_upgrades": "No Upgrades available", + "mininggadgets.tooltip.screen.outer_color": "Outer glow color", "mininggadgets.tooltip.screen.precision_mode": "Precision Mode: %1$d", "mininggadgets.tooltip.screen.range": "Range", - "mininggadgets.tooltip.screen.red_inner": "Red Inner", - "mininggadgets.tooltip.screen.red_outer": "Red Outer", + "mininggadgets.tooltip.screen.red": "Red", "mininggadgets.tooltip.screen.shrink": "Shrink Blocks", "mininggadgets.tooltip.screen.size": "Size: %1$d x %1$d", "mininggadgets.tooltip.screen.ticks": "ticks", diff --git a/src/generated/resources/assets/mininggadgets/models/block/minerslight.json b/src/generated/resources/assets/mininggadgets/models/block/minerslight.json index df3316a2..6c6253b1 100644 --- a/src/generated/resources/assets/mininggadgets/models/block/minerslight.json +++ b/src/generated/resources/assets/mininggadgets/models/block/minerslight.json @@ -1,5 +1,5 @@ { - "parent": "block/cube_all", + "parent": "minecraft:block/cube_all", "textures": { "all": "mininggadgets:block/minerslight" } diff --git a/src/generated/resources/assets/mininggadgets/models/block/modificationtable.json b/src/generated/resources/assets/mininggadgets/models/block/modificationtable.json index d3cebec4..ae3dabc7 100644 --- a/src/generated/resources/assets/mininggadgets/models/block/modificationtable.json +++ b/src/generated/resources/assets/mininggadgets/models/block/modificationtable.json @@ -1,5 +1,5 @@ { - "parent": "block/cube", + "parent": "minecraft:block/cube", "textures": { "down": "mininggadgets:block/modificationtable_bottom", "up": "mininggadgets:block/modificationtable_top", diff --git a/src/generated/resources/assets/mininggadgets/models/block/renderblock.json b/src/generated/resources/assets/mininggadgets/models/block/renderblock.json index 6bab74a6..37d1d10c 100644 --- a/src/generated/resources/assets/mininggadgets/models/block/renderblock.json +++ b/src/generated/resources/assets/mininggadgets/models/block/renderblock.json @@ -1,5 +1,5 @@ { - "parent": "block/cube_all", + "parent": "minecraft:block/cube_all", "textures": { "all": "mininggadgets:block/renderblock" } diff --git a/src/generated/resources/assets/mininggadgets/models/item/upgrade_battery_1.json b/src/generated/resources/assets/mininggadgets/models/item/upgrade_battery_1.json index 58a66e7f..e41ee7b8 100644 --- a/src/generated/resources/assets/mininggadgets/models/item/upgrade_battery_1.json +++ b/src/generated/resources/assets/mininggadgets/models/item/upgrade_battery_1.json @@ -1,5 +1,5 @@ { - "parent": "item/handheld", + "parent": "minecraft:item/handheld", "textures": { "layer0": "mininggadgets:item/upgrade_battery_1" } diff --git a/src/generated/resources/assets/mininggadgets/models/item/upgrade_battery_2.json b/src/generated/resources/assets/mininggadgets/models/item/upgrade_battery_2.json index ff1592ff..2f1315ad 100644 --- a/src/generated/resources/assets/mininggadgets/models/item/upgrade_battery_2.json +++ b/src/generated/resources/assets/mininggadgets/models/item/upgrade_battery_2.json @@ -1,5 +1,5 @@ { - "parent": "item/handheld", + "parent": "minecraft:item/handheld", "textures": { "layer0": "mininggadgets:item/upgrade_battery_2" } diff --git a/src/generated/resources/assets/mininggadgets/models/item/upgrade_battery_3.json b/src/generated/resources/assets/mininggadgets/models/item/upgrade_battery_3.json index b082cda1..2e4fe14b 100644 --- a/src/generated/resources/assets/mininggadgets/models/item/upgrade_battery_3.json +++ b/src/generated/resources/assets/mininggadgets/models/item/upgrade_battery_3.json @@ -1,5 +1,5 @@ { - "parent": "item/handheld", + "parent": "minecraft:item/handheld", "textures": { "layer0": "mininggadgets:item/upgrade_battery_3" } diff --git a/src/generated/resources/assets/mininggadgets/models/item/upgrade_efficiency_1.json b/src/generated/resources/assets/mininggadgets/models/item/upgrade_efficiency_1.json index deab10b0..2df644ee 100644 --- a/src/generated/resources/assets/mininggadgets/models/item/upgrade_efficiency_1.json +++ b/src/generated/resources/assets/mininggadgets/models/item/upgrade_efficiency_1.json @@ -1,5 +1,5 @@ { - "parent": "item/handheld", + "parent": "minecraft:item/handheld", "textures": { "layer0": "mininggadgets:item/upgrade_efficiency_1" } diff --git a/src/generated/resources/assets/mininggadgets/models/item/upgrade_efficiency_2.json b/src/generated/resources/assets/mininggadgets/models/item/upgrade_efficiency_2.json index 408b33b6..10fb4ea2 100644 --- a/src/generated/resources/assets/mininggadgets/models/item/upgrade_efficiency_2.json +++ b/src/generated/resources/assets/mininggadgets/models/item/upgrade_efficiency_2.json @@ -1,5 +1,5 @@ { - "parent": "item/handheld", + "parent": "minecraft:item/handheld", "textures": { "layer0": "mininggadgets:item/upgrade_efficiency_2" } diff --git a/src/generated/resources/assets/mininggadgets/models/item/upgrade_efficiency_3.json b/src/generated/resources/assets/mininggadgets/models/item/upgrade_efficiency_3.json index d3b38474..58ec9161 100644 --- a/src/generated/resources/assets/mininggadgets/models/item/upgrade_efficiency_3.json +++ b/src/generated/resources/assets/mininggadgets/models/item/upgrade_efficiency_3.json @@ -1,5 +1,5 @@ { - "parent": "item/handheld", + "parent": "minecraft:item/handheld", "textures": { "layer0": "mininggadgets:item/upgrade_efficiency_3" } diff --git a/src/generated/resources/assets/mininggadgets/models/item/upgrade_efficiency_4.json b/src/generated/resources/assets/mininggadgets/models/item/upgrade_efficiency_4.json index d0d201ef..028036bb 100644 --- a/src/generated/resources/assets/mininggadgets/models/item/upgrade_efficiency_4.json +++ b/src/generated/resources/assets/mininggadgets/models/item/upgrade_efficiency_4.json @@ -1,5 +1,5 @@ { - "parent": "item/handheld", + "parent": "minecraft:item/handheld", "textures": { "layer0": "mininggadgets:item/upgrade_efficiency_4" } diff --git a/src/generated/resources/assets/mininggadgets/models/item/upgrade_efficiency_5.json b/src/generated/resources/assets/mininggadgets/models/item/upgrade_efficiency_5.json index bef078ac..1ccdaeae 100644 --- a/src/generated/resources/assets/mininggadgets/models/item/upgrade_efficiency_5.json +++ b/src/generated/resources/assets/mininggadgets/models/item/upgrade_efficiency_5.json @@ -1,5 +1,5 @@ { - "parent": "item/handheld", + "parent": "minecraft:item/handheld", "textures": { "layer0": "mininggadgets:item/upgrade_efficiency_5" } diff --git a/src/generated/resources/assets/mininggadgets/models/item/upgrade_empty.json b/src/generated/resources/assets/mininggadgets/models/item/upgrade_empty.json index 8098bf25..9fc5ef4f 100644 --- a/src/generated/resources/assets/mininggadgets/models/item/upgrade_empty.json +++ b/src/generated/resources/assets/mininggadgets/models/item/upgrade_empty.json @@ -1,5 +1,5 @@ { - "parent": "item/handheld", + "parent": "minecraft:item/handheld", "textures": { "layer0": "mininggadgets:item/upgrade_empty" } diff --git a/src/generated/resources/assets/mininggadgets/models/item/upgrade_fortune_1.json b/src/generated/resources/assets/mininggadgets/models/item/upgrade_fortune_1.json index bb3eaec6..d3832e6b 100644 --- a/src/generated/resources/assets/mininggadgets/models/item/upgrade_fortune_1.json +++ b/src/generated/resources/assets/mininggadgets/models/item/upgrade_fortune_1.json @@ -1,5 +1,5 @@ { - "parent": "item/handheld", + "parent": "minecraft:item/handheld", "textures": { "layer0": "mininggadgets:item/upgrade_fortune_1" } diff --git a/src/generated/resources/assets/mininggadgets/models/item/upgrade_fortune_2.json b/src/generated/resources/assets/mininggadgets/models/item/upgrade_fortune_2.json index 67d9540d..cfb83349 100644 --- a/src/generated/resources/assets/mininggadgets/models/item/upgrade_fortune_2.json +++ b/src/generated/resources/assets/mininggadgets/models/item/upgrade_fortune_2.json @@ -1,5 +1,5 @@ { - "parent": "item/handheld", + "parent": "minecraft:item/handheld", "textures": { "layer0": "mininggadgets:item/upgrade_fortune_2" } diff --git a/src/generated/resources/assets/mininggadgets/models/item/upgrade_fortune_3.json b/src/generated/resources/assets/mininggadgets/models/item/upgrade_fortune_3.json index 7c5c00a8..c0effa52 100644 --- a/src/generated/resources/assets/mininggadgets/models/item/upgrade_fortune_3.json +++ b/src/generated/resources/assets/mininggadgets/models/item/upgrade_fortune_3.json @@ -1,5 +1,5 @@ { - "parent": "item/handheld", + "parent": "minecraft:item/handheld", "textures": { "layer0": "mininggadgets:item/upgrade_fortune_3" } diff --git a/src/generated/resources/assets/mininggadgets/models/item/upgrade_freezing.json b/src/generated/resources/assets/mininggadgets/models/item/upgrade_freezing.json index ce0b2b90..6760e302 100644 --- a/src/generated/resources/assets/mininggadgets/models/item/upgrade_freezing.json +++ b/src/generated/resources/assets/mininggadgets/models/item/upgrade_freezing.json @@ -1,5 +1,5 @@ { - "parent": "item/handheld", + "parent": "minecraft:item/handheld", "textures": { "layer0": "mininggadgets:item/upgrade_freezing" } diff --git a/src/generated/resources/assets/mininggadgets/models/item/upgrade_light_placer.json b/src/generated/resources/assets/mininggadgets/models/item/upgrade_light_placer.json index 30f5e73b..6280c878 100644 --- a/src/generated/resources/assets/mininggadgets/models/item/upgrade_light_placer.json +++ b/src/generated/resources/assets/mininggadgets/models/item/upgrade_light_placer.json @@ -1,5 +1,5 @@ { - "parent": "item/handheld", + "parent": "minecraft:item/handheld", "textures": { "layer0": "mininggadgets:item/upgrade_light_placer" } diff --git a/src/generated/resources/assets/mininggadgets/models/item/upgrade_magnet.json b/src/generated/resources/assets/mininggadgets/models/item/upgrade_magnet.json index 84c707aa..5eb797b0 100644 --- a/src/generated/resources/assets/mininggadgets/models/item/upgrade_magnet.json +++ b/src/generated/resources/assets/mininggadgets/models/item/upgrade_magnet.json @@ -1,5 +1,5 @@ { - "parent": "item/handheld", + "parent": "minecraft:item/handheld", "textures": { "layer0": "mininggadgets:item/upgrade_magnet" } diff --git a/src/generated/resources/assets/mininggadgets/models/item/upgrade_range_1.json b/src/generated/resources/assets/mininggadgets/models/item/upgrade_range_1.json index bd4212a7..1a1a25a5 100644 --- a/src/generated/resources/assets/mininggadgets/models/item/upgrade_range_1.json +++ b/src/generated/resources/assets/mininggadgets/models/item/upgrade_range_1.json @@ -1,5 +1,5 @@ { - "parent": "item/handheld", + "parent": "minecraft:item/handheld", "textures": { "layer0": "mininggadgets:item/upgrade_range_1" } diff --git a/src/generated/resources/assets/mininggadgets/models/item/upgrade_range_2.json b/src/generated/resources/assets/mininggadgets/models/item/upgrade_range_2.json index 6b6ff382..2bb16cf7 100644 --- a/src/generated/resources/assets/mininggadgets/models/item/upgrade_range_2.json +++ b/src/generated/resources/assets/mininggadgets/models/item/upgrade_range_2.json @@ -1,5 +1,5 @@ { - "parent": "item/handheld", + "parent": "minecraft:item/handheld", "textures": { "layer0": "mininggadgets:item/upgrade_range_2" } diff --git a/src/generated/resources/assets/mininggadgets/models/item/upgrade_range_3.json b/src/generated/resources/assets/mininggadgets/models/item/upgrade_range_3.json index dfaac2ce..f78bafa5 100644 --- a/src/generated/resources/assets/mininggadgets/models/item/upgrade_range_3.json +++ b/src/generated/resources/assets/mininggadgets/models/item/upgrade_range_3.json @@ -1,5 +1,5 @@ { - "parent": "item/handheld", + "parent": "minecraft:item/handheld", "textures": { "layer0": "mininggadgets:item/upgrade_range_3" } diff --git a/src/generated/resources/assets/mininggadgets/models/item/upgrade_silk.json b/src/generated/resources/assets/mininggadgets/models/item/upgrade_silk.json index 364b2ca9..daad4d61 100644 --- a/src/generated/resources/assets/mininggadgets/models/item/upgrade_silk.json +++ b/src/generated/resources/assets/mininggadgets/models/item/upgrade_silk.json @@ -1,5 +1,5 @@ { - "parent": "item/handheld", + "parent": "minecraft:item/handheld", "textures": { "layer0": "mininggadgets:item/upgrade_silk" } diff --git a/src/generated/resources/assets/mininggadgets/models/item/upgrade_three_by_three.json b/src/generated/resources/assets/mininggadgets/models/item/upgrade_three_by_three.json index fd292537..0842ee89 100644 --- a/src/generated/resources/assets/mininggadgets/models/item/upgrade_three_by_three.json +++ b/src/generated/resources/assets/mininggadgets/models/item/upgrade_three_by_three.json @@ -1,5 +1,5 @@ { - "parent": "item/handheld", + "parent": "minecraft:item/handheld", "textures": { "layer0": "mininggadgets:item/upgrade_three_by_three" } diff --git a/src/generated/resources/assets/mininggadgets/models/item/upgrade_void_junk.json b/src/generated/resources/assets/mininggadgets/models/item/upgrade_void_junk.json index d89a98d5..262c6876 100644 --- a/src/generated/resources/assets/mininggadgets/models/item/upgrade_void_junk.json +++ b/src/generated/resources/assets/mininggadgets/models/item/upgrade_void_junk.json @@ -1,5 +1,5 @@ { - "parent": "item/handheld", + "parent": "minecraft:item/handheld", "textures": { "layer0": "mininggadgets:item/upgrade_void_junk" } diff --git a/src/main/java/com/direwolf20/mininggadgets/client/screens/MiningVisualsScreen.java b/src/main/java/com/direwolf20/mininggadgets/client/screens/MiningVisualsScreen.java index be5f70e1..8d6a891a 100644 --- a/src/main/java/com/direwolf20/mininggadgets/client/screens/MiningVisualsScreen.java +++ b/src/main/java/com/direwolf20/mininggadgets/client/screens/MiningVisualsScreen.java @@ -5,6 +5,7 @@ import com.direwolf20.mininggadgets.common.network.packets.PacketChangeBreakType; import com.direwolf20.mininggadgets.common.network.packets.PacketChangeColor; import com.mojang.blaze3d.matrix.MatrixStack; +import com.mojang.blaze3d.systems.RenderSystem; import net.minecraft.client.gui.screen.Screen; import net.minecraft.client.gui.widget.button.Button; import net.minecraft.client.util.InputMappings; @@ -52,7 +53,7 @@ protected void init() { else buttonText = new TranslationTextComponent("mininggadgets.tooltip.screen.fade"); - blockBreakButton = new Button(baseX - (150 / 2), baseY - 50, 150, 20, buttonText, (button) -> { + blockBreakButton = new Button(baseX - (150), baseY - 55, 150, 20, buttonText, (button) -> { if (blockBreakButton.getMessage().getString().contains("Shrink")) button.setMessage(new TranslationTextComponent("mininggadgets.tooltip.screen.fade")); else @@ -63,18 +64,18 @@ protected void init() { addButton(blockBreakButton); - sliderRedInner = new Slider(baseX - (150), baseY - 25, 150, 20, new TranslationTextComponent("mininggadgets.tooltip.screen.red_outer").appendString(": "), StringTextComponent.EMPTY, 0, 255, this.red, false, true, s -> { + sliderRedInner = new Slider(baseX - (150), baseY - 10, 150, 20, new TranslationTextComponent("mininggadgets.tooltip.screen.red").appendString(": "), StringTextComponent.EMPTY, 0, 255, this.red, false, true, s -> { }, this); - sliderGreenInner = new Slider(baseX - (150), baseY + 5, 150, 20, new TranslationTextComponent("mininggadgets.tooltip.screen.green_outer").appendString(": "), StringTextComponent.EMPTY, 0, 255, this.green, false, true, s -> { + sliderGreenInner = new Slider(baseX - (150), baseY + 15, 150, 20, new TranslationTextComponent("mininggadgets.tooltip.screen.green").appendString(": "), StringTextComponent.EMPTY, 0, 255, this.green, false, true, s -> { }, this); - sliderBlueInner = new Slider(baseX - (150), baseY + 35, 150, 20, new TranslationTextComponent("mininggadgets.tooltip.screen.blue_outer").appendString(": "), StringTextComponent.EMPTY, 0, 255, this.blue, false, true, s -> { + sliderBlueInner = new Slider(baseX - (150), baseY + 40, 150, 20, new TranslationTextComponent("mininggadgets.tooltip.screen.blue").appendString(": "), StringTextComponent.EMPTY, 0, 255, this.blue, false, true, s -> { }, this); - sliderRedOuter = new Slider(baseX + (25), baseY - 25, 150, 20, new TranslationTextComponent("mininggadgets.tooltip.screen.red_inner").appendString(": "), StringTextComponent.EMPTY, 0, 255, this.red_inner, false, true, s -> { + sliderRedOuter = new Slider(baseX + (25), baseY - 10, 150, 20, new TranslationTextComponent("mininggadgets.tooltip.screen.red").appendString(": "), StringTextComponent.EMPTY, 0, 255, this.red_inner, false, true, s -> { }, this); - sliderGreenOuter = new Slider(baseX + (25), baseY + 5, 150, 20, new TranslationTextComponent("mininggadgets.tooltip.screen.green_inner").appendString(": "), StringTextComponent.EMPTY, 0, 255, this.green_inner, false, true, s -> { + sliderGreenOuter = new Slider(baseX + (25), baseY + 15, 150, 20, new TranslationTextComponent("mininggadgets.tooltip.screen.green").appendString(": "), StringTextComponent.EMPTY, 0, 255, this.green_inner, false, true, s -> { }, this); - sliderBlueOuter = new Slider(baseX + (25), baseY + 35, 150, 20, new TranslationTextComponent("mininggadgets.tooltip.screen.blue_inner").appendString(": "), StringTextComponent.EMPTY, 0, 255, this.blue_inner, false, true, s -> { + sliderBlueOuter = new Slider(baseX + (25), baseY + 40, 150, 20, new TranslationTextComponent("mininggadgets.tooltip.screen.blue").appendString(": "), StringTextComponent.EMPTY, 0, 255, this.blue_inner, false, true, s -> { }, this); addButton(sliderRedInner); @@ -90,9 +91,24 @@ public void render(MatrixStack stack, int mouseX, int mouseY, float partialTicks this.renderBackground(stack); super.render(stack, mouseX, mouseY, partialTicks); - drawCenteredString(stack, getMinecraft().fontRenderer, new TranslationTextComponent("mininggadgets.tooltip.screen.visual_settings").getUnformattedComponentText(), (width / 2), (height / 2) - 70, Color.WHITE.getRGB()); - //drawCenteredString(getMinecraft().fontRenderer, "Toggle Upgrades", (width / 2), (height / 2) + 20, Color.WHITE.getRGB()); + drawCenteredString(stack, font, new TranslationTextComponent("mininggadgets.tooltip.screen.visual_settings"), (width / 2), (height / 2) - 95, 0xFFFFFF); + drawString(stack, font, new TranslationTextComponent("mininggadgets.tooltip.screen.block_break_style"), (width / 2) - 150, (height / 2) - 70, 0xFFFFFF); + drawString(stack, font, new TranslationTextComponent("mininggadgets.tooltip.screen.beam_preview"), (width / 2) + 25, (height / 2) - 70, 0xFFFFFF); + drawString(stack, font, new TranslationTextComponent("mininggadgets.tooltip.screen.outer_color"), (width / 2) - 150, (height / 2) - 25, 0xFFFFFF); + drawString(stack, font, new TranslationTextComponent("mininggadgets.tooltip.screen.inner_color"), (width / 2) + 25, (height / 2) - 25, 0xFFFFFF); + stack.push(); + fill(stack, (width / 2) + 25, (height / 2) - 55, ((width / 2) + 25) + 150, ((height / 2) - 55) + 20, this.rgbToInt(this.red, this.green, this.blue)); + fill(stack, (width / 2) + 25, (height / 2) - 50, ((width / 2) + 25) + 150, ((height / 2) - 50) + 10, this.rgbToInt(this.red_inner, this.green_inner, this.blue_inner)); + stack.pop(); + } + + private int rgbToInt(int r, int g, int b) { + int red = (r << 16) & 0x00FF0000; + int green = (g << 8) & 0x0000FF00; + int blue = b & 0x000000FF; + + return 0xFF000000 | red | green | blue; } @Override @@ -103,17 +119,28 @@ public boolean isPauseScreen() { @Override public void onClose() { super.onClose(); + } + + private void syncColors() { PacketHandler.sendToServer(new PacketChangeColor(this.red, this.green, this.blue, this.red_inner, this.green_inner, this.blue_inner)); } @Override public boolean keyPressed(int p_keyPressed_1_, int p_keyPressed_2_, int p_keyPressed_3_) { InputMappings.Input mouseKey = InputMappings.getInputByCode(p_keyPressed_1_, p_keyPressed_2_); - if (p_keyPressed_1_ == 256 || minecraft.gameSettings.keyBindInventory.isActiveAndMatches(mouseKey)) { + if (p_keyPressed_1_ == 256) { + syncColors(); + ModScreens.openGadgetSettingsScreen(this.gadget); + return true; + } + + if (getMinecraft().gameSettings.keyBindInventory.isActiveAndMatches(mouseKey)) { + syncColors(); onClose(); return true; } + return super.keyPressed(p_keyPressed_1_, p_keyPressed_2_, p_keyPressed_3_); } diff --git a/src/main/java/com/direwolf20/mininggadgets/common/data/GeneratorLanguage.java b/src/main/java/com/direwolf20/mininggadgets/common/data/GeneratorLanguage.java index 17bc40c6..f95cc6a6 100644 --- a/src/main/java/com/direwolf20/mininggadgets/common/data/GeneratorLanguage.java +++ b/src/main/java/com/direwolf20/mininggadgets/common/data/GeneratorLanguage.java @@ -87,12 +87,13 @@ protected void addTranslations() { addPrefixed("tooltip.screen.mining_gadget", "Gadget Settings"); addPrefixed("tooltip.screen.shrink", "Shrink Blocks"); addPrefixed("tooltip.screen.fade", "Fade Blocks"); - addPrefixed("tooltip.screen.red_inner", "Red Inner"); - addPrefixed("tooltip.screen.green_inner", "Green Inner"); - addPrefixed("tooltip.screen.blue_inner", "Blue Inner"); - addPrefixed("tooltip.screen.red_outer", "Red Outer"); - addPrefixed("tooltip.screen.green_outer", "Green Outer"); - addPrefixed("tooltip.screen.blue_outer", "Blue Outer"); + addPrefixed("tooltip.screen.red", "Red"); + addPrefixed("tooltip.screen.green", "Green"); + addPrefixed("tooltip.screen.blue", "Blue"); + addPrefixed("tooltip.screen.block_break_style", "Breaking Style"); + addPrefixed("tooltip.screen.outer_color", "Outer glow color"); + addPrefixed("tooltip.screen.inner_color", "Inner beam color"); + addPrefixed("tooltip.screen.beam_preview", "Beam preview"); addPrefixed("tooltip.screen.visual_settings", "Visual Settings"); addPrefixed("tooltip.screen.toggle_upgrades", "Toggle Upgrades"); addPrefixed("tooltip.screen.edit_filters", "Edit Filters"); From 089a764e0d104030698e2de0622cfb790c1935fb Mon Sep 17 00:00:00 2001 From: Michael Date: Sat, 15 Aug 2020 16:53:22 +0100 Subject: [PATCH 08/19] Added paver upgrade --- src/generated/resources/.cache/cache | 5 ++- .../assets/mininggadgets/lang/en_us.json | 2 ++ .../models/item/upgrade_paver.json | 6 ++++ .../recipes/mininggadgets/upgrade_paver.json | 32 ++++++++++++++++++ .../mininggadgets/recipes/upgrade_paver.json | 31 +++++++++++++++++ .../common/data/GeneratorLanguage.java | 2 ++ .../common/data/GeneratorRecipes.java | 13 +++++++ .../mininggadgets/common/items/ModItems.java | 1 + .../common/items/upgrade/Upgrade.java | 2 ++ .../common/tiles/RenderBlockTileEntity.java | 8 +++++ .../textures/item/upgrade_paver.png | Bin 0 -> 165 bytes 11 files changed, 101 insertions(+), 1 deletion(-) create mode 100644 src/generated/resources/assets/mininggadgets/models/item/upgrade_paver.json create mode 100644 src/generated/resources/data/mininggadgets/advancements/recipes/mininggadgets/upgrade_paver.json create mode 100644 src/generated/resources/data/mininggadgets/recipes/upgrade_paver.json create mode 100644 src/main/resources/assets/mininggadgets/textures/item/upgrade_paver.png diff --git a/src/generated/resources/.cache/cache b/src/generated/resources/.cache/cache index 06d2cd61..01226663 100644 --- a/src/generated/resources/.cache/cache +++ b/src/generated/resources/.cache/cache @@ -1,7 +1,7 @@ b7013e95c0f001eefb22e978563099d6af098f17 assets/mininggadgets/blockstates/minerslight.json c2b2d34c116a3d6da9c62ce72021bd999590e3f2 assets/mininggadgets/blockstates/modificationtable.json 17f3e42d932950bb56cf0f43004c2badcef8cdc0 assets/mininggadgets/blockstates/renderblock.json -abe792cd548a1eeaa284fb7b9e4148a7f7d9621b assets/mininggadgets/lang/en_us.json +8802d27ec1a3360ce6c129527f14731dea8a0c68 assets/mininggadgets/lang/en_us.json 973359b4f13b4c70416dd8b3e68a3a4d8886f14f assets/mininggadgets/models/block/minerslight.json a28c42b7d4a511d87ae88461f1845ed1b6bbc401 assets/mininggadgets/models/block/modificationtable.json 30eb13c57d2684c6de2f1d2edfb7e535599b3a61 assets/mininggadgets/models/block/renderblock.json @@ -22,6 +22,7 @@ e2815e3ce5b9f75cbd4af7d54aa9366d06f52f77 assets/mininggadgets/models/item/upgrad ba8917e3c2d877da76ab22c8b74527d88035fb46 assets/mininggadgets/models/item/upgrade_freezing.json 27927c9fb7122ba8e3a22f79b03af9b3390da023 assets/mininggadgets/models/item/upgrade_light_placer.json a886745775c5c632a20d5232a3bbec5650815a47 assets/mininggadgets/models/item/upgrade_magnet.json +f73ebc92f07527746d919afe2797686a4c8ec76d assets/mininggadgets/models/item/upgrade_paver.json 9490052868ec9732110ac60f56f0d3225537ecd2 assets/mininggadgets/models/item/upgrade_range_1.json cb0c341c014dd44118b38cd3e92ee791868411b1 assets/mininggadgets/models/item/upgrade_range_2.json 7f4c09db6454ab72dc8728d88f6c781b1072f3cc assets/mininggadgets/models/item/upgrade_range_3.json @@ -45,6 +46,7 @@ bd2411710dbace4b2fd6bd497f1b72f5c38bb1cb data/mininggadgets/advancements/recipes 0dadf0a570e4dd3f6a58dfc3e353358189c7d7cc data/mininggadgets/advancements/recipes/mininggadgets/upgrade_freezing.json 1d5c700c2094424a0d8715bcb06f824c6b7f586f data/mininggadgets/advancements/recipes/mininggadgets/upgrade_light_placer.json 1d39e37715fc3cbb835061e6b3a0368233afd12e data/mininggadgets/advancements/recipes/mininggadgets/upgrade_magnet.json +eb2745d644ec190f2ce7f89cf10f9d6b99463562 data/mininggadgets/advancements/recipes/mininggadgets/upgrade_paver.json 309536ff89d635953a5e4667cd9acc23803d9bf7 data/mininggadgets/advancements/recipes/mininggadgets/upgrade_range_1.json e8da478c9942f6af968c57b1a8cbabe4618d2a90 data/mininggadgets/advancements/recipes/mininggadgets/upgrade_range_2.json f807888493861b3ee63ed74a2bddf997b216a7cd data/mininggadgets/advancements/recipes/mininggadgets/upgrade_range_3.json @@ -69,6 +71,7 @@ aa2f3c7f4bac48370c1fe3caed05cce522a042d7 data/mininggadgets/recipes/upgrade_fort b467cc07cf27fba3063df81a633a47bc25be5435 data/mininggadgets/recipes/upgrade_freezing.json 7af68c6d0182139282d7dd736de48e77077bec44 data/mininggadgets/recipes/upgrade_light_placer.json e10f01adc6b02ca619c083abc87890fd713fbd8b data/mininggadgets/recipes/upgrade_magnet.json +0374e3decd437571453c6496a9b46b4591730dba data/mininggadgets/recipes/upgrade_paver.json 4b4bf63d46c738ff042d3216373ff29e0df6625f data/mininggadgets/recipes/upgrade_range_1.json ef0547b32ed33ab3a42b7a39ab0cf3c689466472 data/mininggadgets/recipes/upgrade_range_2.json 1e4dbf81b1aed88f76c29c26c00a65ddc6ee93b1 data/mininggadgets/recipes/upgrade_range_3.json diff --git a/src/generated/resources/assets/mininggadgets/lang/en_us.json b/src/generated/resources/assets/mininggadgets/lang/en_us.json index 643ec5fa..891cab39 100644 --- a/src/generated/resources/assets/mininggadgets/lang/en_us.json +++ b/src/generated/resources/assets/mininggadgets/lang/en_us.json @@ -19,6 +19,7 @@ "item.mininggadgets.upgrade_freezing": "Upgrade: Freezing", "item.mininggadgets.upgrade_light_placer": "Upgrade: Light Placer", "item.mininggadgets.upgrade_magnet": "Upgrade: Magnet", + "item.mininggadgets.upgrade_paver": "Upgrade: Paver", "item.mininggadgets.upgrade_range_1": "Upgrade: Range, Tier 1", "item.mininggadgets.upgrade_range_2": "Upgrade: Range, Tier 2", "item.mininggadgets.upgrade_range_3": "Upgrade: Range, Tier 3", @@ -70,6 +71,7 @@ "tooltop.mininggadgets.freezing": "Freezes water and stops lava in it's place!", "tooltop.mininggadgets.light_placer": "Places touches whenever the surroundings light level is lower than 8", "tooltop.mininggadgets.magnet": "Deconstructs blocks right into your inventory", + "tooltop.mininggadgets.paver": "Creates a path for you as you mine", "tooltop.mininggadgets.range": "Extends your range by 5 times with each tier", "tooltop.mininggadgets.silk": "Applies the silk touch enchant to the Mining Gadget", "tooltop.mininggadgets.three_by_three": "Allows for a 3x3 mining radius", diff --git a/src/generated/resources/assets/mininggadgets/models/item/upgrade_paver.json b/src/generated/resources/assets/mininggadgets/models/item/upgrade_paver.json new file mode 100644 index 00000000..969f8614 --- /dev/null +++ b/src/generated/resources/assets/mininggadgets/models/item/upgrade_paver.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/handheld", + "textures": { + "layer0": "mininggadgets:item/upgrade_paver" + } +} \ No newline at end of file diff --git a/src/generated/resources/data/mininggadgets/advancements/recipes/mininggadgets/upgrade_paver.json b/src/generated/resources/data/mininggadgets/advancements/recipes/mininggadgets/upgrade_paver.json new file mode 100644 index 00000000..b60faf9e --- /dev/null +++ b/src/generated/resources/data/mininggadgets/advancements/recipes/mininggadgets/upgrade_paver.json @@ -0,0 +1,32 @@ +{ + "parent": "minecraft:recipes/root", + "rewards": { + "recipes": [ + "mininggadgets:upgrade_paver" + ] + }, + "criteria": { + "has_upgrade": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "item": "mininggadgets:upgrade_empty" + } + ] + } + }, + "has_the_recipe": { + "trigger": "minecraft:recipe_unlocked", + "conditions": { + "recipe": "mininggadgets:upgrade_paver" + } + } + }, + "requirements": [ + [ + "has_upgrade", + "has_the_recipe" + ] + ] +} \ No newline at end of file diff --git a/src/generated/resources/data/mininggadgets/recipes/upgrade_paver.json b/src/generated/resources/data/mininggadgets/recipes/upgrade_paver.json new file mode 100644 index 00000000..01d193f2 --- /dev/null +++ b/src/generated/resources/data/mininggadgets/recipes/upgrade_paver.json @@ -0,0 +1,31 @@ +{ + "type": "minecraft:crafting_shaped", + "pattern": [ + "rgr", + "gug", + "lpw" + ], + "key": { + "r": { + "tag": "forge:dusts/redstone" + }, + "u": { + "item": "mininggadgets:upgrade_empty" + }, + "g": { + "tag": "forge:nuggets/gold" + }, + "l": { + "item": "minecraft:lava_bucket" + }, + "p": { + "item": "minecraft:piston" + }, + "w": { + "item": "minecraft:water_bucket" + } + }, + "result": { + "item": "mininggadgets:upgrade_paver" + } +} \ No newline at end of file diff --git a/src/main/java/com/direwolf20/mininggadgets/common/data/GeneratorLanguage.java b/src/main/java/com/direwolf20/mininggadgets/common/data/GeneratorLanguage.java index f95cc6a6..043c0c17 100644 --- a/src/main/java/com/direwolf20/mininggadgets/common/data/GeneratorLanguage.java +++ b/src/main/java/com/direwolf20/mininggadgets/common/data/GeneratorLanguage.java @@ -27,6 +27,7 @@ protected void addTranslations() { addItem(ModItems.LIGHT_PLACER, "Upgrade: Light Placer"); addItem(ModItems.MAGNET, "Upgrade: Magnet"); addItem(ModItems.THREE_BY_THREE, "Upgrade: 3x3"); + addItem(ModItems.PAVER, "Upgrade: Paver"); addItem(ModItems.VOID_JUNK, "Upgrade: Void Junk"); addItem(ModItems.FORTUNE_1, "Upgrade: Fortune, Tier 1"); addItem(ModItems.FORTUNE_2, "Upgrade: Fortune, Tier 2"); @@ -55,6 +56,7 @@ protected void addTranslations() { add("tooltop.mininggadgets.battery", "Upgrades the internal capacitors"); add("tooltop.mininggadgets.range", "Extends your range by 5 times with each tier"); add("tooltop.mininggadgets.efficiency", "Applies efficiency to the Mining Gadget"); + add("tooltop.mininggadgets.paver", "Creates a path for you as you mine"); // Blocks addBlock(ModBlocks.MINERS_LIGHT, "Miner's Light"); diff --git a/src/main/java/com/direwolf20/mininggadgets/common/data/GeneratorRecipes.java b/src/main/java/com/direwolf20/mininggadgets/common/data/GeneratorRecipes.java index 08dd0a3f..b814bafb 100644 --- a/src/main/java/com/direwolf20/mininggadgets/common/data/GeneratorRecipes.java +++ b/src/main/java/com/direwolf20/mininggadgets/common/data/GeneratorRecipes.java @@ -276,5 +276,18 @@ protected void registerRecipes(Consumer consumer) { .patternLine("ror") .addCriterion("has_upgrade", hasItem(UPGRADE_EMPTY.get())) .build(consumer); + + ShapedRecipeBuilder.shapedRecipe(PAVER.get()) + .key('r', Tags.Items.DUSTS_REDSTONE) + .key('u', UPGRADE_EMPTY.get()) + .key('g', Tags.Items.NUGGETS_GOLD) + .key('l', Items.LAVA_BUCKET) + .key('p', Blocks.PISTON) + .key('w', Items.WATER_BUCKET) + .patternLine("rgr") + .patternLine("gug") + .patternLine("lpw") + .addCriterion("has_upgrade", hasItem(UPGRADE_EMPTY.get())) + .build(consumer); } } diff --git a/src/main/java/com/direwolf20/mininggadgets/common/items/ModItems.java b/src/main/java/com/direwolf20/mininggadgets/common/items/ModItems.java index 801519ce..b4ca8c62 100644 --- a/src/main/java/com/direwolf20/mininggadgets/common/items/ModItems.java +++ b/src/main/java/com/direwolf20/mininggadgets/common/items/ModItems.java @@ -49,4 +49,5 @@ public class ModItems { public static final RegistryObject EFFICIENCY_3 = UPGRADE_ITEMS.register("upgrade_efficiency_3", Upgrade.EFFICIENCY_3::getCard); public static final RegistryObject EFFICIENCY_4 = UPGRADE_ITEMS.register("upgrade_efficiency_4", Upgrade.EFFICIENCY_4::getCard); public static final RegistryObject EFFICIENCY_5 = UPGRADE_ITEMS.register("upgrade_efficiency_5", Upgrade.EFFICIENCY_5::getCard); + public static final RegistryObject PAVER = UPGRADE_ITEMS.register("upgrade_paver", Upgrade.PAVER::getCard); } diff --git a/src/main/java/com/direwolf20/mininggadgets/common/items/upgrade/Upgrade.java b/src/main/java/com/direwolf20/mininggadgets/common/items/upgrade/Upgrade.java index f6b89363..075b7e00 100644 --- a/src/main/java/com/direwolf20/mininggadgets/common/items/upgrade/Upgrade.java +++ b/src/main/java/com/direwolf20/mininggadgets/common/items/upgrade/Upgrade.java @@ -30,6 +30,8 @@ public enum Upgrade { FREEZING("freezing", () -> 0), THREE_BY_THREE("three_by_three", () -> 0, false), LIGHT_PLACER("light_placer", () -> 0), + PAVER("paver", () -> 10), + // Tiered FORTUNE_1("fortune_1", 1, () -> Config.UPGRADECOST_FORTUNE1.get(), true), FORTUNE_2("fortune_2", 2, () -> Config.UPGRADECOST_FORTUNE2.get(), true), diff --git a/src/main/java/com/direwolf20/mininggadgets/common/tiles/RenderBlockTileEntity.java b/src/main/java/com/direwolf20/mininggadgets/common/tiles/RenderBlockTileEntity.java index a0f5bd8e..2fb2d72e 100644 --- a/src/main/java/com/direwolf20/mininggadgets/common/tiles/RenderBlockTileEntity.java +++ b/src/main/java/com/direwolf20/mininggadgets/common/tiles/RenderBlockTileEntity.java @@ -339,9 +339,17 @@ private void removeBlock() { renderBlock.spawnAdditionalDrops(world, pos, tempTool); // Fixes silver fish basically... } + BlockState underState = world.getBlockState(this.pos.down()); + world.removeTileEntity(this.pos); world.setBlockState(this.pos, Blocks.AIR.getDefaultState()); + if (UpgradeTools.containsActiveUpgradeFromList(gadgetUpgrades, Upgrade.PAVER)) { + if (this.pos.getY() <= player.getPosY() && underState == Blocks.AIR.getDefaultState()) { + world.setBlockState(this.pos.down(), Blocks.COBBLESTONE.getDefaultState()); + } + } + // Add to the break stats player.addStat(Stats.BLOCK_MINED.get(renderBlock.getBlock())); diff --git a/src/main/resources/assets/mininggadgets/textures/item/upgrade_paver.png b/src/main/resources/assets/mininggadgets/textures/item/upgrade_paver.png new file mode 100644 index 0000000000000000000000000000000000000000..19e99e5ad82ef23e061d7ac4910bec413fcf2542 GIT binary patch literal 165 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Ii4<#Ar*|tKmPx>m$|>M_P4#^ zj{}X&Jq~ABFEwB2nV=%3-S}nV>Yx8-nXYy;5kA8p&@RJlp<&uEIf%IeNR=Phd%)@e zo53PUhyN`{n2Z}j&T421_B76!za-P`iJJwR=YyjhXWbSsu)Jhs_*A25bal1qJD|M` Mp00i_>zopr0OiCyG5`Po literal 0 HcmV?d00001 From 5c7c8a1747d2158815044428d17c4ec9d07a64e3 Mon Sep 17 00:00:00 2001 From: Michael Date: Sat, 15 Aug 2020 17:42:30 +0100 Subject: [PATCH 09/19] Improved recipe --- build.gradle | 1 + src/generated/resources/.cache/cache | 2 +- .../resources/data/mininggadgets/recipes/upgrade_paver.json | 5 ++++- .../mininggadgets/common/data/GeneratorRecipes.java | 3 ++- 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/build.gradle b/build.gradle index 21ba1ca4..87804274 100644 --- a/build.gradle +++ b/build.gradle @@ -89,6 +89,7 @@ minecraft { } sourceSets.main.resources { srcDir 'src/generated/resources' } + repositories { maven { // JEI diff --git a/src/generated/resources/.cache/cache b/src/generated/resources/.cache/cache index 01226663..bf725b9e 100644 --- a/src/generated/resources/.cache/cache +++ b/src/generated/resources/.cache/cache @@ -71,7 +71,7 @@ aa2f3c7f4bac48370c1fe3caed05cce522a042d7 data/mininggadgets/recipes/upgrade_fort b467cc07cf27fba3063df81a633a47bc25be5435 data/mininggadgets/recipes/upgrade_freezing.json 7af68c6d0182139282d7dd736de48e77077bec44 data/mininggadgets/recipes/upgrade_light_placer.json e10f01adc6b02ca619c083abc87890fd713fbd8b data/mininggadgets/recipes/upgrade_magnet.json -0374e3decd437571453c6496a9b46b4591730dba data/mininggadgets/recipes/upgrade_paver.json +36ede190249a62220d76ea7e599caa3bf1a793fa data/mininggadgets/recipes/upgrade_paver.json 4b4bf63d46c738ff042d3216373ff29e0df6625f data/mininggadgets/recipes/upgrade_range_1.json ef0547b32ed33ab3a42b7a39ab0cf3c689466472 data/mininggadgets/recipes/upgrade_range_2.json 1e4dbf81b1aed88f76c29c26c00a65ddc6ee93b1 data/mininggadgets/recipes/upgrade_range_3.json diff --git a/src/generated/resources/data/mininggadgets/recipes/upgrade_paver.json b/src/generated/resources/data/mininggadgets/recipes/upgrade_paver.json index 01d193f2..362965a7 100644 --- a/src/generated/resources/data/mininggadgets/recipes/upgrade_paver.json +++ b/src/generated/resources/data/mininggadgets/recipes/upgrade_paver.json @@ -2,13 +2,16 @@ "type": "minecraft:crafting_shaped", "pattern": [ "rgr", - "gug", + "cuc", "lpw" ], "key": { "r": { "tag": "forge:dusts/redstone" }, + "c": { + "tag": "forge:cobblestone" + }, "u": { "item": "mininggadgets:upgrade_empty" }, diff --git a/src/main/java/com/direwolf20/mininggadgets/common/data/GeneratorRecipes.java b/src/main/java/com/direwolf20/mininggadgets/common/data/GeneratorRecipes.java index b814bafb..46402a7c 100644 --- a/src/main/java/com/direwolf20/mininggadgets/common/data/GeneratorRecipes.java +++ b/src/main/java/com/direwolf20/mininggadgets/common/data/GeneratorRecipes.java @@ -279,13 +279,14 @@ protected void registerRecipes(Consumer consumer) { ShapedRecipeBuilder.shapedRecipe(PAVER.get()) .key('r', Tags.Items.DUSTS_REDSTONE) + .key('c', Tags.Items.COBBLESTONE) .key('u', UPGRADE_EMPTY.get()) .key('g', Tags.Items.NUGGETS_GOLD) .key('l', Items.LAVA_BUCKET) .key('p', Blocks.PISTON) .key('w', Items.WATER_BUCKET) .patternLine("rgr") - .patternLine("gug") + .patternLine("cuc") .patternLine("lpw") .addCriterion("has_upgrade", hasItem(UPGRADE_EMPTY.get())) .build(consumer); From 74a5f8e8d49a0d3ff5c5920094c116594394ba85 Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 16 Aug 2020 08:59:32 +0100 Subject: [PATCH 10/19] Code cleaning :D --- .../common/tiles/RenderBlockTileEntity.java | 83 +++++++++---------- 1 file changed, 41 insertions(+), 42 deletions(-) diff --git a/src/main/java/com/direwolf20/mininggadgets/common/tiles/RenderBlockTileEntity.java b/src/main/java/com/direwolf20/mininggadgets/common/tiles/RenderBlockTileEntity.java index 2fb2d72e..3f173f91 100644 --- a/src/main/java/com/direwolf20/mininggadgets/common/tiles/RenderBlockTileEntity.java +++ b/src/main/java/com/direwolf20/mininggadgets/common/tiles/RenderBlockTileEntity.java @@ -47,7 +47,7 @@ public class RenderBlockTileEntity extends TileEntity implements ITickableTileEn private int durability; private UUID playerUUID; private int originalDurability; - private Random rand = new Random(); + private final Random rand = new Random(); private int ticksSinceMine = 0; private List gadgetUpgrades; private List gadgetFilters; @@ -61,14 +61,37 @@ public RenderBlockTileEntity() { super(RENDERBLOCK_TILE.get()); } - public void setRenderBlock(BlockState state) { - renderBlock = state; + public static boolean blockAllowed(List drops, List filters, boolean isWhiteList) { + boolean blockAllowed = false; + for (ItemStack dropStack : drops) { + if (filters.size() == 0) + return true; + + boolean contains = false; + for (ItemStack filter : filters) { + if (dropStack.isItemEqual(filter)) { + contains = true; + break; + } + } + + blockAllowed = (isWhiteList && contains) || (!isWhiteList && !contains); + + if (blockAllowed) + break; + } + + return blockAllowed; } public BlockState getRenderBlock() { return renderBlock; } + public void setRenderBlock(BlockState state) { + renderBlock = state; + } + public MiningProperties.BreakTypes getBreakType() { return breakType; } @@ -149,20 +172,20 @@ public void setOriginalDurability(int originalDurability) { } public PlayerEntity getPlayer() { - if( getWorld() == null ) + if (getWorld() == null) return null; return this.getWorld().getPlayerByUuid(playerUUID); } - public UUID getPlayerUUID() { - return this.playerUUID; - } - public void setPlayer(PlayerEntity player) { this.playerUUID = player.getUniqueID(); } + public UUID getPlayerUUID() { + return this.playerUUID; + } + public int getTicksSinceMine() { return ticksSinceMine; } @@ -222,16 +245,16 @@ public SUpdateTileEntityPacket getUpdatePacket() { return new SUpdateTileEntityPacket(pos, 0, getUpdateTag()); } - @Override - public CompoundNBT getUpdateTag() { - return write(new CompoundNBT()); - } - /*@Override public void handleUpdateTag(CompoundNBT tag) { read(tag); }*/ //TODO Figure out if this is still necessary + @Override + public CompoundNBT getUpdateTag() { + return write(new CompoundNBT()); + } + @Override public void onDataPacket(NetworkManager net, SUpdateTileEntityPacket pkt) { read(this.getBlockState(), pkt.getNbtCompound()); @@ -263,7 +286,7 @@ public void read(BlockState state, CompoundNBT tag) { @Override public CompoundNBT write(CompoundNBT tag) { - if (renderBlock!= null) + if (renderBlock != null) tag.put("renderBlock", NBTUtil.writeBlockState(renderBlock)); tag.putInt("originalDurability", originalDurability); tag.putInt("priorDurability", priorDurability); @@ -309,7 +332,7 @@ private void removeBlock() { List drops = Block.getDrops(renderBlock, (ServerWorld) world, this.pos, null, player, tempTool); - if ( blockAllowed ) { + if (blockAllowed) { int exp = renderBlock.getExpDrop(world, pos, fortune, silk); boolean magnetMode = (UpgradeTools.containsActiveUpgradeFromList(gadgetUpgrades, Upgrade.MAGNET)); for (ItemStack drop : drops) { @@ -319,7 +342,7 @@ private void removeBlock() { // 1 = someone allowed the event meaning it's handled, // -1 = someone blocked the event and thus we shouldn't drop it nor insert it // 0 = no body captured the event and we should handle it by hand. - if( wasPickedUp == 0 ) { + if (wasPickedUp == 0) { if (!player.addItemStackToInventory(drop)) Block.spawnAsEntity(world, pos, drop); } @@ -354,12 +377,12 @@ private void removeBlock() { player.addStat(Stats.BLOCK_MINED.get(renderBlock.getBlock())); // Handle special cases - if(SpecialBlockActions.getRegister().containsKey(renderBlock.getBlock())) + if (SpecialBlockActions.getRegister().containsKey(renderBlock.getBlock())) SpecialBlockActions.getRegister().get(renderBlock.getBlock()).accept(world, pos, renderBlock); } private void resetBlock() { - if(world == null) + if (world == null) return; if (!world.isRemote) { @@ -398,7 +421,6 @@ public void tick() { } - } //Server Only if (!world.isRemote) { @@ -421,29 +443,6 @@ public void tick() { } } - public static boolean blockAllowed(List drops, List filters, boolean isWhiteList) { - boolean blockAllowed = false; - for (ItemStack dropStack : drops) { - if( filters.size() == 0 ) - return true; - - boolean contains = false; - for (ItemStack filter: filters) { - if( dropStack.isItemEqual(filter) ) { - contains = true; - break; - } - } - - blockAllowed = (isWhiteList && contains) || (!isWhiteList && !contains); - - if( blockAllowed ) - break; - } - - return blockAllowed; - } - public void setBlockAllowed() { if (!UpgradeTools.containsActiveUpgradeFromList(gadgetUpgrades, Upgrade.VOID_JUNK)) { this.blockAllowed = true; From fe91d873ceddabcdd24898808f0aae955ee51f64 Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 16 Aug 2020 09:00:14 +0100 Subject: [PATCH 11/19] Fixed shift clicking issues with index overflow --- .../common/containers/ModificationTableContainer.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/direwolf20/mininggadgets/common/containers/ModificationTableContainer.java b/src/main/java/com/direwolf20/mininggadgets/common/containers/ModificationTableContainer.java index 7bfc36e9..1a8d8ddb 100644 --- a/src/main/java/com/direwolf20/mininggadgets/common/containers/ModificationTableContainer.java +++ b/src/main/java/com/direwolf20/mininggadgets/common/containers/ModificationTableContainer.java @@ -134,7 +134,7 @@ public ItemStack transferStackInSlot(PlayerEntity playerIn, int index) { else return ItemStack.EMPTY; } else if (index < 29) { - if (!this.mergeItemStack(stack, 29, 38, false)) { + if (!this.mergeItemStack(stack, 29, 37, false)) { return ItemStack.EMPTY; } } else if (index < 38 && !this.mergeItemStack(stack, 1, 29, false)) { From fb5b113c7a78ac8bcc623fe02091d23edd040b45 Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 16 Aug 2020 09:27:54 +0100 Subject: [PATCH 12/19] Added the ability to drop items into the modification table. --- .../screens/ModificationTableScreen.java | 17 ++++++ .../common/network/PacketHandler.java | 36 +++++------- .../network/packets/PacketInsertUpgrade.java | 58 +++++++++++++++++++ 3 files changed, 91 insertions(+), 20 deletions(-) create mode 100644 src/main/java/com/direwolf20/mininggadgets/common/network/packets/PacketInsertUpgrade.java diff --git a/src/main/java/com/direwolf20/mininggadgets/client/screens/ModificationTableScreen.java b/src/main/java/com/direwolf20/mininggadgets/client/screens/ModificationTableScreen.java index bd2d6dcf..bf4e0372 100644 --- a/src/main/java/com/direwolf20/mininggadgets/client/screens/ModificationTableScreen.java +++ b/src/main/java/com/direwolf20/mininggadgets/client/screens/ModificationTableScreen.java @@ -2,9 +2,11 @@ import com.direwolf20.mininggadgets.common.MiningGadgets; import com.direwolf20.mininggadgets.common.containers.ModificationTableContainer; +import com.direwolf20.mininggadgets.common.items.UpgradeCard; import com.direwolf20.mininggadgets.common.items.upgrade.Upgrade; import com.direwolf20.mininggadgets.common.network.PacketHandler; import com.direwolf20.mininggadgets.common.network.packets.PacketExtractUpgrade; +import com.direwolf20.mininggadgets.common.network.packets.PacketInsertUpgrade; import com.mojang.blaze3d.matrix.MatrixStack; import com.mojang.blaze3d.systems.RenderSystem; import net.minecraft.client.Minecraft; @@ -24,6 +26,7 @@ public class ModificationTableScreen extends ContainerScreen void registerMessage(Class messageType, BiConsumer encoder, Function decoder, BiConsumer> messageConsumer) { - HANDLER.registerMessage(index, messageType, encoder, decoder, messageConsumer); - index++; - if (index > 0xFF) - throw new RuntimeException("Too many messages!"); - } } diff --git a/src/main/java/com/direwolf20/mininggadgets/common/network/packets/PacketInsertUpgrade.java b/src/main/java/com/direwolf20/mininggadgets/common/network/packets/PacketInsertUpgrade.java new file mode 100644 index 00000000..de72d99d --- /dev/null +++ b/src/main/java/com/direwolf20/mininggadgets/common/network/packets/PacketInsertUpgrade.java @@ -0,0 +1,58 @@ +package com.direwolf20.mininggadgets.common.network.packets; + +import com.direwolf20.mininggadgets.common.containers.ModificationTableCommands; +import com.direwolf20.mininggadgets.common.containers.ModificationTableContainer; +import com.direwolf20.mininggadgets.common.tiles.ModificationTableTileEntity; +import net.minecraft.entity.player.ServerPlayerEntity; +import net.minecraft.item.ItemStack; +import net.minecraft.network.PacketBuffer; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; +import net.minecraftforge.fml.network.NetworkEvent; + +import javax.swing.*; +import java.util.function.Supplier; + +public final class PacketInsertUpgrade { + public static PacketInsertUpgrade decode(PacketBuffer buffer) { + return new PacketInsertUpgrade(buffer.readBlockPos(), buffer.readItemStack()); + } + + private final BlockPos pos; + private final ItemStack upgrade; + + public PacketInsertUpgrade(BlockPos blockPos, ItemStack stack) { + this.pos = blockPos; + this.upgrade = stack; + } + + public void encode(PacketBuffer buffer) { + buffer.writeBlockPos(pos); + buffer.writeItemStack(upgrade); + } + + public void handler(Supplier ctx) { + ctx.get().enqueueWork(() -> { + ServerPlayerEntity player = ctx.get().getSender(); + if (player == null) return; + + World world = player.world; + BlockPos pos = this.pos; + + TileEntity te = world.getTileEntity(pos); + if (!(te instanceof ModificationTableTileEntity)) return; + ModificationTableContainer container = ((ModificationTableTileEntity) te).getContainer(player); + + ItemStack stack = player.inventory.getItemStack(); + if (!stack.isItemEqual(upgrade)) { + return; + } + + ModificationTableCommands.insertButton(container, this.upgrade); + player.inventory.setItemStack(ItemStack.EMPTY); + }); + + ctx.get().setPacketHandled(true); + } +} From 8e685e3435fba0e4cebe49e45d962005c983be03 Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 16 Aug 2020 09:52:28 +0100 Subject: [PATCH 13/19] Greatly improved the modification table as a whole --- src/generated/resources/.cache/cache | 2 +- .../assets/mininggadgets/lang/en_us.json | 3 ++- .../screens/ModificationTableScreen.java | 24 +++++++++++++++---- .../common/data/GeneratorLanguage.java | 3 ++- 4 files changed, 24 insertions(+), 8 deletions(-) diff --git a/src/generated/resources/.cache/cache b/src/generated/resources/.cache/cache index bf725b9e..869b7fab 100644 --- a/src/generated/resources/.cache/cache +++ b/src/generated/resources/.cache/cache @@ -1,7 +1,7 @@ b7013e95c0f001eefb22e978563099d6af098f17 assets/mininggadgets/blockstates/minerslight.json c2b2d34c116a3d6da9c62ce72021bd999590e3f2 assets/mininggadgets/blockstates/modificationtable.json 17f3e42d932950bb56cf0f43004c2badcef8cdc0 assets/mininggadgets/blockstates/renderblock.json -8802d27ec1a3360ce6c129527f14731dea8a0c68 assets/mininggadgets/lang/en_us.json +7b6864bd530b82aea92048d3b5208b716a30ae07 assets/mininggadgets/lang/en_us.json 973359b4f13b4c70416dd8b3e68a3a4d8886f14f assets/mininggadgets/models/block/minerslight.json a28c42b7d4a511d87ae88461f1845ed1b6bbc401 assets/mininggadgets/models/block/modificationtable.json 30eb13c57d2684c6de2f1d2edfb7e535599b3a61 assets/mininggadgets/models/block/renderblock.json diff --git a/src/generated/resources/assets/mininggadgets/lang/en_us.json b/src/generated/resources/assets/mininggadgets/lang/en_us.json index 891cab39..8c8a0574 100644 --- a/src/generated/resources/assets/mininggadgets/lang/en_us.json +++ b/src/generated/resources/assets/mininggadgets/lang/en_us.json @@ -29,8 +29,9 @@ "itemGroup.mininggadgets": "Mining Gadgets", "mininggadgets.gadget.energy": "Energy: %d/%d", "mininggadgets.gadget.range_change": "Range Change: %1$d x %1$d", + "mininggadgets.text.empty_table_helper": "Shift click to insert from your slots\nor drop upgrade onto this screen.\n\nClick upgrade to remove.", + "mininggadgets.text.modification_table": "Modification Table", "mininggadgets.text.open_gui": "Open Mining Gadget Settings", - "mininggadgets.text.shift_click": "Shift click in and out of the GUI", "mininggadgets.tooltip.item.battery_boost": "Battery Boost: %1$d", "mininggadgets.tooltip.item.break_cost": "Per Block Cost: %1$d", "mininggadgets.tooltip.item.show_upgrades": "Hold %s to show upgrades", diff --git a/src/main/java/com/direwolf20/mininggadgets/client/screens/ModificationTableScreen.java b/src/main/java/com/direwolf20/mininggadgets/client/screens/ModificationTableScreen.java index bf4e0372..cae2304a 100644 --- a/src/main/java/com/direwolf20/mininggadgets/client/screens/ModificationTableScreen.java +++ b/src/main/java/com/direwolf20/mininggadgets/client/screens/ModificationTableScreen.java @@ -19,8 +19,10 @@ import net.minecraft.util.ResourceLocation; import net.minecraft.util.math.BlockPos; import net.minecraft.util.text.ITextComponent; +import net.minecraft.util.text.StringTextComponent; import net.minecraft.util.text.TranslationTextComponent; import net.minecraftforge.client.gui.ScrollPanel; +import net.minecraftforge.fml.ForgeI18n; public class ModificationTableScreen extends ContainerScreen { private ResourceLocation GUI = new ResourceLocation(MiningGadgets.MOD_ID, "textures/gui/modificationtable.png"); @@ -48,11 +50,23 @@ public void render(MatrixStack stack, int mouseX, int mouseY, float partialTicks @Override protected void func_230451_b_(MatrixStack stack, int mouseX, int mouseY) { // @mcp: func_230451_b_ = drawGuiContainerForegroundLayer - stack.push(); - stack.translate(xSize / 2f, guiTop - 70, 0); - stack.scale(.8f, .8f, .8f); - drawCenteredString(stack, font,new TranslationTextComponent(String.format("%s.%s", MiningGadgets.MOD_ID, "text.shift_click")), 0, 0, 0xFFFFFF); - stack.pop(); + drawCenteredString(stack, font, ForgeI18n.getPattern(String.format("%s.%s", MiningGadgets.MOD_ID, "text.modification_table")), xSize / 2, guiTop - 70, 0xFFFFFF); + + if (this.container.getUpgradesCache().size() == 0) { + String string = ForgeI18n.getPattern(String.format("%s.%s", MiningGadgets.MOD_ID, "text.empty_table_helper")); + String[] parts = string.split("\n"); + for (int i = 0; i < parts.length; i++) { + drawScaledCenteredString(stack, guiLeft - this.xSize + 40, guiTop - 35 + (i * font.FONT_HEIGHT), .8f, parts[i], 0xFFFFFF); + } + } + } + + private void drawScaledCenteredString(MatrixStack matrices, int x, int y, float scale, String textComponent, int color) { + matrices.push(); + matrices.translate(x, y, 0); + matrices.scale(scale, scale, scale); + drawString(matrices, font, textComponent, 0, 0, color); + matrices.pop(); } @Override diff --git a/src/main/java/com/direwolf20/mininggadgets/common/data/GeneratorLanguage.java b/src/main/java/com/direwolf20/mininggadgets/common/data/GeneratorLanguage.java index 043c0c17..372755e8 100644 --- a/src/main/java/com/direwolf20/mininggadgets/common/data/GeneratorLanguage.java +++ b/src/main/java/com/direwolf20/mininggadgets/common/data/GeneratorLanguage.java @@ -79,7 +79,8 @@ protected void addTranslations() { addPrefixed("tooltip.item.battery_boost", "Battery Boost: %1$d"); addPrefixed("tooltip.item.break_cost", "Per Block Cost: %1$d"); - addPrefixed("text.shift_click", "Shift click in and out of the GUI"); + addPrefixed("text.modification_table", "Modification Table"); + addPrefixed("text.empty_table_helper", "Shift click to insert from your slots\nor drop upgrade onto this screen.\n\nClick upgrade to remove."); addPrefixed("text.open_gui", "Open Mining Gadget Settings"); // Screen Buttons and text From 77dee0fada0f9059374752e1b8baf5bae4741759 Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 16 Aug 2020 10:18:16 +0100 Subject: [PATCH 14/19] Cleaned up textures and added paver texture --- .../textures/item/upgrade_battery_1.png | Bin 405 -> 466 bytes .../textures/item/upgrade_battery_2.png | Bin 369 -> 403 bytes .../textures/item/upgrade_battery_3.png | Bin 358 -> 375 bytes .../textures/item/upgrade_efficiency_1.png | Bin 567 -> 573 bytes .../textures/item/upgrade_efficiency_2.png | Bin 577 -> 581 bytes .../textures/item/upgrade_efficiency_3.png | Bin 573 -> 569 bytes .../textures/item/upgrade_efficiency_4.png | Bin 550 -> 559 bytes .../textures/item/upgrade_efficiency_5.png | Bin 573 -> 590 bytes .../textures/item/upgrade_empty.png | Bin 165 -> 162 bytes .../textures/item/upgrade_fortune_1.png | Bin 238 -> 220 bytes .../textures/item/upgrade_fortune_2.png | Bin 269 -> 212 bytes .../textures/item/upgrade_fortune_3.png | Bin 270 -> 212 bytes .../textures/item/upgrade_freezing.png | Bin 253 -> 235 bytes .../textures/item/upgrade_heatsink.png | Bin 168 -> 196 bytes .../textures/item/upgrade_light_placer.png | Bin 238 -> 231 bytes .../textures/item/upgrade_magnet.png | Bin 324 -> 344 bytes .../textures/item/upgrade_paver.png | Bin 165 -> 415 bytes .../textures/item/upgrade_range_1.png | Bin 368 -> 315 bytes .../textures/item/upgrade_range_2.png | Bin 383 -> 330 bytes .../textures/item/upgrade_range_3.png | Bin 388 -> 340 bytes .../textures/item/upgrade_silk.png | Bin 225 -> 222 bytes .../textures/item/upgrade_three_by_three.png | Bin 234 -> 224 bytes .../textures/item/upgrade_void_junk.png | Bin 237 -> 234 bytes 23 files changed, 0 insertions(+), 0 deletions(-) diff --git a/src/main/resources/assets/mininggadgets/textures/item/upgrade_battery_1.png b/src/main/resources/assets/mininggadgets/textures/item/upgrade_battery_1.png index f76be08d1c901c62a28a52623234c9c9c4cb9f8c..4c1539a6994620f4d814f3e4e27e0fe7a3a57498 100644 GIT binary patch delta 451 zcmV;!0X+Vd1JVPK8Gi!+001a04^sdD00d`2O+f$vv5yPgS!#RggHiNJVa<>Xn%-bX^MP|r%`NoTx*P7 zYKmQJh+k-jVsMLGX^CQQjXOnZJVa)ao4CQv;*OoVjF_}xXNT$W{J+cR!OP)RYlgzj z;9zTqS!sw|Y=qR`?SYJ{Tx^EL&gNTahFNKZe2l4FX@_2EhklExJ4I+aMP^)Uh+Alg ztgNfs+uOjvz<(~i7Ipvt00MMUPE+{+v+bA60001yNklQB zGgFc_rtbg$P~%kENS(KPG=x(6!MQ)b_kUlZ{l_qD^knh@lSt^H zBpf|{mUCw>aq-Lr_8mIN&Lbz;clZPsFJ58)!J{OIl46R90*acFh1hR3!v|6_N5cRA z9#9~*YVlIyY~vq@8W5FHMz)RExbPx}9JXb$+C zAdVK7(X+)s`vdUt;|GXzo-g|Kzji;LI)AB6o4df4tk`19)^4}eYqr_e{m0s4pj=`! jCd9=CB_5tpECNsf59%bxi}ql600000NkvXXu0mjfglNEY diff --git a/src/main/resources/assets/mininggadgets/textures/item/upgrade_battery_2.png b/src/main/resources/assets/mininggadgets/textures/item/upgrade_battery_2.png index fa553da78ecc90631b31dc6d533abf3c86f484a5..9cd93f2a18cceb333ebaa24889ba8cb7e2af477b 100644 GIT binary patch delta 387 zcmV-}0et@P0+R!f8Gi!+001a04^sdD00d`2O+f$vv5yPR7JqRzyJUM zTW5hVH%BiyQA=HJU}k$=YlvNHid<`qTxp3rMQUPije47+VsMLJX^LB7iehMpS7v^} z&Eh;nW|Et@jF_~Jow_+jXzB6%zsu)YX@tSc;e3p#VP}U?ZhwSZXNp^BhEZ&HUucKI z&EQsRhG1)lS!sw|Y=qR`?Obez#m?q|jH+B|hhAxiJ4I&c*S3C(sa$J_J4I+)Xo%T& zLH@8b+uPf$tgFDlzzJtZTL1t60(4SNQ~3b1?U&2|004qXL_t&-(_PBf4udcdL{V>g z@4b=U69P7l_k90UetqI-_uTx<1c< zme#w=J$eBe&Cr-QdIPFDgZxp`e~-GJZB4w+p_?Su+Rp~i_izC8JnR7j4*@#?Qp}}d hxln0K3y{Oo_yLJiC*jTClX(CD002ovPDHLkV1j#vt%Cpn delta 353 zcmV-n0iOPo1Mvco8Gi-<001BJ|6u?C0XRuSK~#9!jguu*20;+V|2McMIt~f<9Tu&(+j4iCO=yue6hd3FI&YY2pc<3SlN3)TwEMBxA#Fl0e|rGkARDB7<9N2bo397 zV`6*;(_>TU=;=mt-!M9QhcG=ohtBSP=uilHn80$HKumBFTK}CHZvuLpoT208TLYLi3O|>idqdNKEDvGxN*LM4kE*!obO->`N-z%?9`|N)vuqw{X8lqi=&fLIWxDI zvx_RYps<|FItRXEKo%K|dgP+RA`i!^MQY>&F*6VACH{WR00000NkvXXu0mjfcO9h- diff --git a/src/main/resources/assets/mininggadgets/textures/item/upgrade_battery_3.png b/src/main/resources/assets/mininggadgets/textures/item/upgrade_battery_3.png index 51f99bea67a557815332732ca72aafe500115c9a..187a333fa92e78f19c590fc029fc5cd395bcbcf5 100644 GIT binary patch delta 359 zcmV-t0hs>g0`~%t8Gi!+001a04^sdD00d`2O+f$vv5yPIJ4I+*X@_2EhvL_(K#E9a$4%SY+pMgsz`(#{wWUx1 z0007XQchF(0JH6v%m4rYcu7P-R2b7;%GnNrKoCUHX~7j0cia^fP!SlX|Nq~h?W9bo zw|i2Ch`v}8MqrvT0qyDV2Tp*wHyTX3-XaEc`eQ$wZy$hVo(Hq&`~j@0%350%fVIN^ zv1vapZMZ2s0ja_ZkSM$XcZH0d02$`P{HK~#9!mD4j^c2OJ$@ZbHv%-nNZw#Ga) zXK(GF+}@OJYibSqkfvgD_YHCvUC4$n)$q8fx2XCxxy<=(T6JcRtSl>JWIe5a|BYyyY9R0!hOW^bmj$>kc z2Ge6x=;-N2bKfvJdWSGQJ%`TjesBZ=j}e$Wnm~;3OH};-FotgtykEb;`TYFGpTvF0 z*d?4mrO4S2l?^c81A!Qf5uxYX;1G-+35h{f3HkUw^3fc~DFS3yw-=>Dgs0v$T%ol~l0u&H>dK oP@Mx?@MH-lA5Gy<=_3Gu1S^dQb`CzGr~m)}07*qoM6N<$f)^2?hyVZp diff --git a/src/main/resources/assets/mininggadgets/textures/item/upgrade_efficiency_1.png b/src/main/resources/assets/mininggadgets/textures/item/upgrade_efficiency_1.png index b61d8a67984bc30fc9ee146f7929f0ce0b1a974b..e4b2a00cc6d64c8d244385fb4fdab254f5883ca6 100644 GIT binary patch delta 559 zcmV+~0?_@p1ib{18Gi!+001a04^sdD00d`2O+f$vv5yPgwFLL%ge*@Xtobsz9~0vsFbs^w&qV zcoV0kq(3z=#G7Bx*4_7V$EP^yjWIcGy6Tsg0OL| zm!cY9Ae~o8d7$3iW-(+>!J1rxuh5rXt9*fQn2-q@lW~8!A|V{b@mXfRSnu9X@v#lX x{$_vR8z=!Fwzu1re&R*|9{2m>c;YzJ;0v3wJ!{a`0B8UJ002ovPDHLkV1h6#DRlq< delta 553 zcmV+^0@nS#1h)i`8Gi-<001BJ|6u?C0scuuK~#7FoRR~K9bptkYuk-$+qSJZHKQV^ zZQJJBwr$(C6`j62o3(fN>pPbnfa*6YDvH*;_V)H2Rc|lR)ECQUYv0kLYp)n>Z7unC zss<<TZ8lG18Ba# z$Gg|B8UyrH0O8@`SXx?QVq$`kkr5`wMp%5iiO1WO}vK7M$Q zg@uKbw;H1H@;2Yj?5NvFk^@PgWPQ)N#U#YX5fc-GmX;O*wY9Zvu93PZfY8uT#Ebfu zm6a7XHa3llt23qOYc>J}AV@C&=~(I;b`pj!00000NkvXXu0mjf8paA# diff --git a/src/main/resources/assets/mininggadgets/textures/item/upgrade_efficiency_2.png b/src/main/resources/assets/mininggadgets/textures/item/upgrade_efficiency_2.png index e53e3a3ecc0ad7ff6591867382b3693664dcc214..9efc55fd7639e64e40518a217504cc2e32fba179 100644 GIT binary patch delta 567 zcmV-70?7Tr1jPi98Gi!+001a04^sdD00d`2O+f$vv5yPlql($dq@)6~?|@bK`iW()N6^r)z)u&}V7pP$gs&{0A;;^N{) zB^60480zZlprD|^l0)k1>iYWnrlqB|nt${2^RBC??Ca~ZvwyRR_HNJcfx_S}K&CQ^n zo~Wm$tf!{XjS;++WaQ-Jp=mRoa8JO$zo@08O(+tUf_kc#hN5XTqH;^Cl82X;m5+*t z&d$z|jEk0&l7Fd@gT1=BkByC`rKGjBwWg+}s;a50tE$h>&)3)2vazuC_4W1j^|!aT zxVX5nv9YJ8rn|eludlDYy}iD^zW@LK+uPf$tgFDlz{o1MQvd(}0(4SNQ~3b1?U&2| z006m3L_t&-(_>&{WK4hqAcq0OPl5xG05U%*5hRdgYkz5|sEH8JkBe3iS5wz>^n?lo zN61HpNUN%7*?T|)*rO%lC6i>8lrixCr8fRisoF5bX2Hp$zX8!R9Y9vW}w8XlLF)&(AH@Iw002ovPDHLk FV1h}c9x4C; delta 563 zcmV-30?hrz1i=K58Gi-<001BJ|6u?C0tiV&K~#7FV)+06KOEn_efvK#_`rb!j6lo< z(u2^9kR%o>f%K898BjPmz}y+eV05+}W43KuF=s|YFx$3q@!Pg-8^LUwXKy>Z7ayNf zU>Q9yZlInmM4M1Mp?5OR4NamU9}88XcL z#*%npF79V`bNa;bKLP4iF;=ytq=eAWPyzx1@bmM--_Mtz^IJ$hK9Wb-6G(L*#q>_i zIC}8FuYd*usGgsnuio$8y^Gk}w{P_&Zx2`Y&1=W=l8FSZZO-ZK>wg6_6hMufoE&c4 zxWV)1&#_vqTz|cKm1obMF?-BlCbVzK%Hhq(J=7HY>ZyNBK>?2+KjzxCYgjB6B&C-x zUNE_98^-nTj;D(=_T~KvU*8lT%h?|RH8q8Tf&%>g{c&}5#o5V;7e;*d?mdR}>4B>e zi@@Xf9-=ok!n$hwZ-8org@yR~`fBm+-@Av{`LpM+T7NDR6&0m|sPHgs%lqQJr2db9 zsv1FVZZ07qAsV)rtCJ&VPM?x{(%x@*yB*uX<&`sk9wcKmv$C?de*HRPNA~aG$e}~{ z`1ojR74Y{#s-b}F>}<{Z7t`?N_XqK}Nz@d~udW%QH{w-(GE6~1K{^{6!JoytjXH^6 zAhldf#Vnmn{?5)$$ho__8y+6+-$Xx%`$z!=@Ciui)v}002ovPDHLkV1n9~ BBzgb< diff --git a/src/main/resources/assets/mininggadgets/textures/item/upgrade_efficiency_3.png b/src/main/resources/assets/mininggadgets/textures/item/upgrade_efficiency_3.png index 9467905baa3e8b2227527c953312ea5bec3a32c3..415a189357ab32dd51092f5ba7eef5f577a88986 100644 GIT binary patch delta 555 zcmV+`0@VGz1i1u|8Gi!+001a04^sdD00d`2O+f$vv5yP+_yu*oMQCXN8{q*u4W6Yr>2~nn$V3Asi>#OszAh> zU%acCwRjV}m1I6ICcwYH(9qDnd=B~f`MP=$o^Vg0X*1;Hgjf_hCT5~`Pm zu&}VJl82Cti+`4rlBtn{y}G%lr>3f^sjI81zrVli?CkIF@4>;rv9YnfzP_lar`Oll z($doO^z{G#|F^fdva+(fySv-l+pMgsz`($E4MtS}0007XQchF(0JH6v%m4rYvq?lj zR2b7u&cznOFcd}626uONcXxMpX&cD@e+5m$D%{!GgMXJ$0DzY;E-2hc7>55wZw#o_ zNMve1h+UyuA52$gt1sLc_M+5;C`jEzWG)wrx8a zg4wq1+P2*Wwau`08$G-4lGT2b^S#eU4WRBwO--dEho7IHrgC%>PgApe?C3E}d|fqT zWo0Q>Efr8__VvZE!n-@nmOZ@%`IZb$>Eq@b+-$&)MnNoa){Xpjp=g z$>QV7C#)Jf0A~k#YHMq;v$LxM$YK8G9zV}-ZoEi}bfTi7C@Co+Hz%7#lSh%4mnV~u zu?nEAMbfFuKg^>nf091V(5!0tFyQF97cN;Ut^GElB_X002ovPDHLkV1n~54blJr diff --git a/src/main/resources/assets/mininggadgets/textures/item/upgrade_efficiency_4.png b/src/main/resources/assets/mininggadgets/textures/item/upgrade_efficiency_4.png index 2ecfd03a230eb690034e47065fd0f25a0faafc1f..ffa96de2a0503bcce732527de32d7b6e55584e35 100644 GIT binary patch delta 545 zcmV++0^a?m1g`{;8Gi!+001a04^sdD00d`2O+f$vv5yP4JeGobMK&$9cz+YnjS;M;ru5fG#G7Bm z#KT7>6-+G|$f`h!VIG&^^1_^A#FRw6y}WjBYtW%JxSxW+zrVbdWSpCtjEai7y1G+EI>Eug zb8Kg{w6w;?#($})sQLN%(9qD>*x0qTwad%Pva+(gyu7%$xT~wGs;a5Y&CS2RzqYov zzP`S@ySxAY|J&Q!tgNfRz`&ldK#u?b00MMUPE+{+v+bA600028NklNbXR<13-JDm6RWVrBW___uQsd!WdgWg)MXCm29!XblBOLN0UE|zqf)C4$= zZo@&00000NkvXXu0mjfV}u#k delta 536 zcmV+z0_Xj&1f~R#8Gi-<001BJ|6u?C0qsddK~#7Fos$EM9zhs}Yuk-$+qR83sck!` zZQEG=HWp{wjGda%+x_P3yZ=p=GtV=w2cY=M&dx?{E>%_Q>sJe6%EMGx+p8yWfx-|) zfu0SRpcqyZ`0j5)!s{^zdbR;R;c-oZX2k+omf`pN;CgumA%FK~Bi}s*xvp6VdAb(- z!wYzD_fBPk=1h>4l?AWY3#ZcwyWI|_-3HH#Gl;xD9be<;B7&ceCH*_#*0rnU1+ADM zBO?P2hXV--37{y7!bDc1ge&WN<7fIj*pGF@gEJ?}3tBTlYHBLXW;1egbMf=%Po$@( zBQzu!t7lKfynnu(v2RKTBwTNgHwP9~9D<$(Nl8hNBnkii{X=YQEWUsLj{7&SVeyde zm@{?=#E&2FX8Ra;PPB*d<)hMq#w2J&5M3lN8I7P^x^xATM-BzgePV!c=OW}&ZSZRU zoC<;_(b3WP^5qL6BO`ER?@myzUAcm1PoJ>KCBW}-vi>7HL zV3SG^cl#_}>|0iLBk5_FoSY1c#e!9HCgR|(t)PU3g|UA=pRc-&)QAN2X&F5p4{SCY z+fWo57A-A(R|c2aiFE1R{70?1TrL9XS={}~;c};uE;1 diff --git a/src/main/resources/assets/mininggadgets/textures/item/upgrade_efficiency_5.png b/src/main/resources/assets/mininggadgets/textures/item/upgrade_efficiency_5.png index db6357431f5f4482814e5d90c8b6c91d97e79887..fec0963408160fe0031d39afde7bc5da510ecb04 100644 GIT binary patch delta 576 zcmV-G0>Aye1kMDI8Gi!+001a04^sdD00d`2O+f$vv5yPu zkc^AGyu84_zkl%X@XgK5!NI}3y1A*5gVNH{^z`(nr>4HXzN)IJzrVk$tE%qq?(6I8 z*4Eb9+1atNvChuU@9*!ZsHeBLx6I7Uva+(fySxAY|J&Q!tgNfRz`(;aH(&q&00MMU zPE+{+v+bA60002FNklBmby9s O0000WOw-9SOaMK;^N}y$>;3stSNm11k)B4jXnJ)3a+m(YPCwF zT6KaZ*vSd|cgG0+wFK9%N3d6Y>Q2zFP7o6lgT1{ywzf7{e1E-(^Q%q7S*|9|Y9nr+ z52E~VpZ9NGcO>YqA%#|CWF(fBmYABFVq#)~nTau$UvA*_W<5oLTk%$|XV3HzynOnk ztzeK4Xa@%eBP1;&J3AW_10|0SO{P3*8x|Kw^8WVawt~SzpzH7Nk61=wVIhD1{6VEs zp^(eizhyPsrhks+?3xh-KO4^P^Se4+g07#RAJNg#2*J;vKl%3M3%l1YW6zxNY*{uJ zwd_B?PcOmt@^FlPd~7MuZJI%PdO9^VHHfIJsNmtlC#+dC52Zqm093CZ;COWiKhJIH zSP&Q(NPxc|TbC~&IVqXEyga^r{eqpH9RhHWPUzR^MSmEc7}!#vStkex2p~K>oOjP2 zv3dF^EKE(Psj0@u$f!vmKEwyCYfXp>(R^PsT z8_1ThynPbLXDSKu3;xNl`R(*GK%Rl8i(?4K^<)7NGd3n?M>fY~aRGr80W(Hp5y_U= sjMD`{DFP{shEp20aceR*E>d8aeOjvjsN1TK4BSB7p00i_>zopr0HVn+NdN!< delta 149 zcmV;G0BZlD0i^+u7=H)`0000V^Z#K0003-BL_t(|0b}_8|34hxzJ2>YG5ElN1B^h- z1=54ijF2Q2D}nTptNH($HLF216U+b*ha3YqC^dkSQUiD>HGp@(y}&x)1~8%-K>viq z0yBVA%_u1mjDeh=q-jRvMmPpZ;Kc~dMxX!$=>Y)pd?_;3s}42p00000NkvXXu0mjf DsFpjk diff --git a/src/main/resources/assets/mininggadgets/textures/item/upgrade_fortune_1.png b/src/main/resources/assets/mininggadgets/textures/item/upgrade_fortune_1.png index de21fb021377f22b9aaba8c1726d5483a1cf14df..c12f971e369bd4cde1fca97dcce2e35d2766aba1 100644 GIT binary patch delta 204 zcmaFIc!zOwyCYfXrPdZWZ_T zF50kf@2T6LK7G1*|GA}&LqvSW?c2B4tXU0IbLC6$JD@tIk|4j}pA4JdPCoYG5ElN1B^h- z1=54ijF2Q2D}nTptNH($HLF216U+b*ha3YqC^di+rvVZ186Zr^03MhD7@BvTxb^?$ z{pTPy3}Z8Z7hwQGGg#xNPoF>-%wDu%9~fKOINk|JdhZYnvQU5o1Y^UoeBivm0qZPN1iYV+hCfRtIR*HHxB}__fA$;zga40xfb{vDP7p4T+>{~+B!6A= z`v3Oq8+GjVYK=lTDi_dgJ@ zvKU=@@;wWvBE{3C%rT_mR&1Xu(;)^P7V~XK=l-`B%CqoYReZbiQTvw_so&0gFo-b#Pt5-$#bv%lRtIR*HHxB}_P-(DR6gGuL40O_cGn;={uDOgkmBy}F# z@Opa_$oT*NzrxY2B5}bo6KBEI+!PQv4m3rqB*-tA;XfnSf2IFS9Gw4o{{QC%s{hZ* zVsz=r_bi}_R8N<3$B>F!vFBWw4mt2RT$EQlI`_A{P?^P+#rfj=4Jld4Z*H#Xwq=ue z?0IJDG@nimH!C$K-D7h!9cKJBl76r*`SI)2l*{jWbkzLb6Mw<&;$TShdvHH!eN^rMJ`*eZ*NF;{bfC*^kq3DM2fPF2?eBC>>N zrIay`oZXIyelLh{DNxlg-#!v^^#TBZt#VI4-Z6JhSzn7{vJrfFEdT%j07*qoM6N<$ Gf&c(?06k9t diff --git a/src/main/resources/assets/mininggadgets/textures/item/upgrade_light_placer.png b/src/main/resources/assets/mininggadgets/textures/item/upgrade_light_placer.png index 0a5de319001081b50bb754d91c5a43c6ee37a7bc..e67533a9a24f860054c3e6067e85d7eef1f8fff1 100644 GIT binary patch delta 214 zcmaFI_?&TqWIZzj1A~Sxe=v|@Nq6*hWMJ6X&;2Kn709;?@Ck7}aNq!t*OID^1MA=977~7$DZ@#JD|YB;%Mz}9m)B>K1V_%a>a9(=`{!L{O!GJ zP}<4)OE2<5++&uAumgpR=h_c+&lT_7aJONmfxy4{+;@J7RrFo`!O*GAC*?XVd;-v1 N22WQ%mvv4FO#s^FT6F*b delta 221 zcmV<303!eA0qy~i8Gi-<001BJ|6u?C0JTX(K~#7FWBC97KOEn_efvK#_`rb!j6lo< z(u2^9kR%o>f%K89`Tv?Vt3fmq*Z^Fb|3CNq|8KiBJ_9)L8t~`aj{jf3e#K`1Ctd>< zRC)iejkL#S01sXR*7t<`&+#(EX8W<5 z{`d@F#B0Fbg+(9($WKW9rBQ?oU;!IIMlwc8iC_%m{3J~?A~(V@NCGcLXf^@`AV?1Y X!5JFVq0^8b00000NkvXXu0mjf_0nIn diff --git a/src/main/resources/assets/mininggadgets/textures/item/upgrade_magnet.png b/src/main/resources/assets/mininggadgets/textures/item/upgrade_magnet.png index 5c67c465d0e10ca954257d755e70514f2dbd1cca..63066d36806c13194beae979968fce526bc9da62 100644 GIT binary patch delta 317 zcmV-D0mA;o0@wnOB!2{FK}|sb0I`n?{9y$E004eaOjJbx008oCfID%_L3G7rjLm3~ z)Mky&>n%n-a>>CSH0vip%^x?A(cAUWb9JJ=vO)F3#*9W&q}IzVy4&>%PJL|N`7Khq#M%YPm=;37NfGfU|vK;I%e z>OfZb!^&v9Lva8A00MMUPE!D~Q~V#80001YNkl5Cs!ZiejOvC{oh@ z{|6x(Rs`wAvOj=Fvd^_Du)rMg~Q;B2E?iBPyj#fTF-kxq(WFe`m?z3!gAjn zJSVQannXV|EjEt4rPNvt@o&ecE}t*e{+-EgjOD98XmX~TR~O!wTh|`}-P8>dt_&B$ P00000NkvXXu0mjft}uiO delta 297 zcmV+^0oMN50>lE4B!7NTOjJbx008oCfV~|v!5%ci9W%xrG|L_}%N{n(A2!e*H_#wA z(;zt1AUM?^IMyIJ*dRIIAv@n9JK!Qa;37KWB0J$DJmw=j=q5kuCP3>aLFy?%?j=9$ zBtGjcM(Q(5>Nig6KvwERS@^@sXpz)rjm~6@%|Ud(`FaPLVpR^bRc6P1;&p8iODVMbo|a9@g4AsDdQw`#)O)i1**Q zA2}od096;Tseh{MuupPba~!|3Px`f7H>Q}swx`{>f%K89`Tv?Vt3fmq%m5IF90NEgHGq>+19&JkfOo*Xz&hXtFrpbi|AfQ> zGk{dhC@B$)ft;VDX-4EmI0i}J#R$ztpa2Bv0RZxRDKgcoH4W|n0000-`HjJ)OnQi|+xQdU-0Pft%wxAA3j96JGvXq#67PEam%Op!!@y m-TatB6x*(~Oc^1Yi-9jnEEx2fV^|*m0000FMt7?(FRB@9!TF5D*j;6dW8J78Vv685tE76&)QN8yj0FA5tV2R-q7)E$f#l zk4Y|v^8i^{S-v)m zu2GqBA5>!+M{6BUcpzA5987W^Rz~XpPft%o?3d$|>|G#L*LM=?P$-b98 zl!$z6G$=A`C@fF9W(vZkkFWTPVjv9nRovE<(TE-h4!(B^fpJ+$%t-DWjgH;fIf{-@ zx^IzYa3?T5o+w*^y4s2N>&FzL*fy0ujo|De=_eZW+7dX@HHG}I52It2N z9-kRJzSJ{_AJrB)tSP=o-U3d6}N2pA4@SauGlsEO3v+y|Khi{@829EyNR)524~|Vj#tGT znw%|lVHVFBX2t7Y*ILuKg4L_C^ph*+5t9Ips8w^kV?7p}*>mU3w$+x!rqj1fW0hXh zEY|oj$0TrW_l^YtmK`hJpZ%s)alw45GL!xv-kt@EZhz21JnYLB!2{FK}|sb0I`n?{9y$E004VXOjJd{z`y_i02jY2Nb~?j=l~?J zHY%t)6wWFa#VaATGZ?`wKZ-~h&@LIgD?{S|6vHXMS*RDrD=n%!9=|any)?-~pB}t1 zCbl*pv@uBY04b6+zBY^+yezI!nQkf%*S0 zq+_KPC)s4*%N|NZdKUwV3>ON=ovDF>uvu*n_=#do$m>az)5^t)6R=34Wf}vw?@DGz zD(`3*=$&^Inlfus4r1{VV(zLXvA=Umy^00000 LNkvXXu0mjfzV?4j delta 361 zcmcb@)WSSLrG8F;Pl)S*0|yuw7=R>xaQpUcpo0DT_pe#A+U+%i>k9_w#|$2y89cr) zNM6trIj1FlOk4b@w#Z>k@%`Eo2X&?P=t%C-mfK?}x8G1{uZiMTV}&h-DjUqywwdX! zvesH*tvRXQ)V|9jS;{?A#wT0WuTVauNG_~GA!46d&q?R``y*GZ3!K?^>bpG9b-X1( ze!)K(7@1gDIXJm^c$JJU^SeI=N_2U;IEGZ*vgK!PVqsh%b!V;Ay4=tI<)ar$r7#O@ z3}pJNyyCp-6_tQrjRh|lX5G)~w_4?VpK0=1tJOwI-VIiMi!`}fP{#_J#4z8c~&rQN26ce)8K5K+lyIk@ z?!O8yLc*6kIguR^39X$%g$l$@oFgI)0Ge^WU`ps4+jEpUsymr$l-s=PkjvfN$|`m7 w-8J!MAZ!c@n60EYXYd39gC_Kfzw~?K0bgVjSNpSdr~m)}07*qoM6N<$f~E~o4*&oF delta 197 zcmV;$06PEP0pS6VB!3c6OjJbx0095xozl#2^5L@S*QA$(P+Kzs@c;k-19VbOQvmN> diff --git a/src/main/resources/assets/mininggadgets/textures/item/upgrade_three_by_three.png b/src/main/resources/assets/mininggadgets/textures/item/upgrade_three_by_three.png index 1ee2e678472f2e6d56d9df294c6f8b6c62a0a202..bd54a16c4529757ae10e2b7990f42f4b122edc28 100644 GIT binary patch delta 208 zcmaFG_<(VOL_G^L0|Ud`yN`l^6id3JuOkD)#(wTUiL5}rT!2rA>wyCYfXp?zy8qqW zju;wFoH%jKn$@>&-&R&u21CHoyG>h#SGZuI; ziZ++}vSzWro+ZV_GBIFsx}SH7z!Mh3OAXt)mohpoQegOc)gbM{CCN0PT@0SCelF{r G5}E*2hEBWy delta 218 zcmV<0044w60qOye7=H)`0000V^Z#K0006N`L_t(|0i~100Rk})MRBJIa>a|-{!$0& z0qr7{a2oQ_VOC;?AD#DB(;}j8thE%9)9KW9nShZnHbb)jmkN_H2lSn%AQaYGBU~^l z38*OOw%d_X>e*wCv01G!mx6IgfFcxgh|7dvRuZ7NDMBzW2~*frOOJ!Sphp16Aubbw ze(odm!(L+jS7>tqHfug(?N{iO1R-I99v6fL@c*BPxXC>RE}cdM8vy~lcWHxp0I>eV U(@LF~%K!iX07*qoM6N<$g8hJ7y#N3J diff --git a/src/main/resources/assets/mininggadgets/textures/item/upgrade_void_junk.png b/src/main/resources/assets/mininggadgets/textures/item/upgrade_void_junk.png index 30b9de6c276f00aec9290a1be02c01ae1d487d22..d7e560384fe4174a79a3ee9d9f3167e3b5273dbf 100644 GIT binary patch delta 206 zcmV;<05SjV0qOyeB!2{FK}|sb0I`n?{9y$E000$GOjJbx008-u`S^eMQVmkRA-?~! z|Mh$I>LLQj00001bW%=J06^y0W&i*Hb4f%&R0!7{jzJ2;?e8_s7ExBy`s!7a}%J19^0J@ zE^^559psHyjogdhww?(}q3wmLdizOvD=b{e@LGEQkjn0Y2hi3V!(XbPfdBvi07*qo IM6N<$f+jv$+yDRo delta 209 zcmV;?051RP0qp^hB!3l9OjJbx008xS^}Zp#|Fi#64O01&`S^eMMphLr00001bW%=J z06^y0W&i*HhDk(0RCwBBU=UysVgLgJCM5x8V+ICB10_LWLtz6TLs8I0kO3%UsOVzo zC=krRV65b*q@=*iz$9$s;^L^pz`!JEtm13}G(kv7Nkz#}NJ@c$QOME7$yg9*o}h@c zlQNKD%qVE=2x2fB8=D9zGXm`r6c7|LW)xrmAteK#8-M_)myH1c;zSKU@*F%#00000 LNkvXXu0mjf+?h|0 From 93c07c1dd433c260dfdee4bae28ccf9a1a9a5f77 Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 16 Aug 2020 10:43:41 +0100 Subject: [PATCH 15/19] Updated and backported the changelog :D --- CHANGELOG.md | 82 ++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 76 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 389ae4c2..719616b8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,40 @@ # Mining Gadgets Changelog The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), -## [1.15.2, 1.3.5] - 2020-03-29 -### Added +## 1.16.2 +### [1.5.0] - 2020-08-14 + +#### Changed +- Updated to 1.16 :+1: + +## 1.16.1 +### [1.4.1] - unreleased +#### Added +- Added a (disabled by default) key binding to open the Gadgets settings screen. (When enabled, it will disable the shift right click action) +- Added a Laser Beam preview to the Mining Gadget Visual Screen +- Added `Paver` upgrade which will place cobble (cost of 10FE per block) to create a path as you mine to cover up any holes. It will not place above your player's height, and we plan on changing it from cobble :D +- Modification table can now have upgrades dropped into it's upgrade area (pick up and drop down) +- Modification table now has an `empty state` to show helper text on how to use the table. +- Modification table now has a title :eyes: + +#### Changed +- Improved the look of the Mining Gadget Visual Screen +- The modification table will now show the full tooltip for you upgrades +- Bumped forge version + +#### Fixed + +- [#98] Config changes did not affect upgrade costs. +- Fixed client crash on shift clicking items to the Modification Table +- Fixed laser rendering through walls when another player is using the gadget + +### [1.4.0] - 2020-08-03 +#### Changed +- Updated the mod to 1.16.1 :+1: + +## 1.15.2 +### [1.3.5] - 2020-03-29 +#### Added - Support for all (if they respect events) items that pick up items (dank storage, pocket storage, etc) - Added the `E` key as a way to get out the Mining Gadget shift-click screen - Added support for both the Silk touch and Fortune upgrades to be applied to the same gadget but only one can be active at a time @@ -12,14 +44,14 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), - Added a charged variant of the gadget to the creative and JEI (1.3.3) - Added RU translations (Thanks to @Smollet777) -### Changed +#### Changed - Disabled the default overlay when using the gadget to stop showing two highlights at the same time - There is no longer a middle man slot for upgrades in the upgrade table. You can now shift click upgrades right into the gadget and click the upgrade to remove it - Slightly improved the light particle - The Mining Gadget can now ray trace through non-collidable blocks meaning it can now shoot though the Miners Light! - The Mining Gadget now adds to your break block stats :D -### Fixed +#### Fixed - Fixed Mining gadget being voided when left in a Modification table and breaking the table - Fixed an issue with OneProbe on RenderBlock look at - Fixed typo in tooltips @@ -28,8 +60,46 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), - Fixed voiding upgrades when normal clicking them in the modification table. - Allowing the Gadget to be used for infinite energy (1.3.3) -## [1.14.4, 1.0.0] - ? -### Added +### [1.3.1] - 2020-03-08 +#### Fixed +- Beta release now. Fixed a few bugs reporting in 1.3.0 + +### [1.3.0] - 2020-03-03 +#### Added +- The first release for 1.15.2 - I think its pretty stable? :) + +## 1.14.4 +### [1.2.4] +#### Added +- Added `ru` translations thanks to @Smollet777 +- You can now use the scroll wheel to change the sliders :D +- You can now shift click into the filter + +#### Fixed +- Fixed the filters not working #42 +- Fixed blacklist filtering system +- Added checking to make sure the dimention also allows for block breaking +- Partialy fixed an odd energy bug +- Fixed edgecase crashing on the render block + +#### Changed +- Optimised images and json files for a smaller mod build size +- Took the time to bump Forge up to `28.2.4` + +### [1.2.3] +#### Added +- Added Precision Mode (A Soaryn request!) + +### [1.2.2] +#### Fixed +- Fixed a dupe bug - Thanks Soaryn. + +### [1.2.1] +#### Added +- Added a tooltip to the upgrades and gadget to show RF costs. + +### [1.2.0] - ? +#### Added - The whole mod! # Example From 1f4d98c6d153a111cf85bc2a3f9883e93217f35c Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 16 Aug 2020 10:44:13 +0100 Subject: [PATCH 16/19] Updated mod version --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 007419af..e947618c 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,7 +1,7 @@ org.gradle.jvmargs=-Xmx3G org.gradle.daemon=false #Mod Info -mod_version=1.4.0 +mod_version=1.4.1 #Dependencies forge_version=1.16.1-32.0.108 mcp_version=20200712-1.16.1 From fd6998bc5019231de6e5572710745e5530453c86 Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 16 Aug 2020 11:01:55 +0100 Subject: [PATCH 17/19] Fix text pos --- .../client/screens/ModificationTableScreen.java | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/direwolf20/mininggadgets/client/screens/ModificationTableScreen.java b/src/main/java/com/direwolf20/mininggadgets/client/screens/ModificationTableScreen.java index cae2304a..ddb41e96 100644 --- a/src/main/java/com/direwolf20/mininggadgets/client/screens/ModificationTableScreen.java +++ b/src/main/java/com/direwolf20/mininggadgets/client/screens/ModificationTableScreen.java @@ -46,21 +46,25 @@ public void render(MatrixStack stack, int mouseX, int mouseY, float partialTicks this.scrollingUpgrades.render(stack, mouseX, mouseY, partialTicks); this.func_230459_a_(stack, mouseX, mouseY); // @mcp: func_230459_a_ = renderHoveredToolTip - } - @Override - protected void func_230451_b_(MatrixStack stack, int mouseX, int mouseY) { // @mcp: func_230451_b_ = drawGuiContainerForegroundLayer - drawCenteredString(stack, font, ForgeI18n.getPattern(String.format("%s.%s", MiningGadgets.MOD_ID, "text.modification_table")), xSize / 2, guiTop - 70, 0xFFFFFF); + int relX = (this.width) / 2; + int relY = (this.height) / 2; + + drawCenteredString(stack, font, ForgeI18n.getPattern(String.format("%s.%s", MiningGadgets.MOD_ID, "text.modification_table")), relX, relY - 105, 0xFFFFFF); if (this.container.getUpgradesCache().size() == 0) { String string = ForgeI18n.getPattern(String.format("%s.%s", MiningGadgets.MOD_ID, "text.empty_table_helper")); String[] parts = string.split("\n"); for (int i = 0; i < parts.length; i++) { - drawScaledCenteredString(stack, guiLeft - this.xSize + 40, guiTop - 35 + (i * font.FONT_HEIGHT), .8f, parts[i], 0xFFFFFF); + drawScaledCenteredString(stack, (relX + 17) - (font.getStringWidth(parts[0]) / 2), (relY - 68) + (i * font.FONT_HEIGHT), .8f, parts[i], 0xFFFFFF); } } } + @Override + protected void func_230451_b_(MatrixStack stack, int mouseX, int mouseY) { // @mcp: func_230451_b_ = drawGuiContainerForegroundLayer + } + private void drawScaledCenteredString(MatrixStack matrices, int x, int y, float scale, String textComponent, int color) { matrices.push(); matrices.translate(x, y, 0); From fdc85d410591b454577c19fd0e4eb0f0489a7663 Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 16 Aug 2020 15:21:27 +0100 Subject: [PATCH 18/19] Stopped us voiding upgrades.... --- .../mininggadgets/client/screens/ModificationTableScreen.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/direwolf20/mininggadgets/client/screens/ModificationTableScreen.java b/src/main/java/com/direwolf20/mininggadgets/client/screens/ModificationTableScreen.java index ddb41e96..5b5618ea 100644 --- a/src/main/java/com/direwolf20/mininggadgets/client/screens/ModificationTableScreen.java +++ b/src/main/java/com/direwolf20/mininggadgets/client/screens/ModificationTableScreen.java @@ -2,6 +2,7 @@ import com.direwolf20.mininggadgets.common.MiningGadgets; import com.direwolf20.mininggadgets.common.containers.ModificationTableContainer; +import com.direwolf20.mininggadgets.common.items.MiningGadget; import com.direwolf20.mininggadgets.common.items.UpgradeCard; import com.direwolf20.mininggadgets.common.items.upgrade.Upgrade; import com.direwolf20.mininggadgets.common.network.PacketHandler; @@ -93,7 +94,8 @@ public void init() { @Override public boolean mouseClicked(double mouseXIn, double mouseYIn, int p_231044_5_) { ItemStack heldStack = this.playerInventory.getItemStack(); - if (!heldStack.isEmpty() && heldStack.getItem() instanceof UpgradeCard) { + ItemStack gadget = this.container.inventorySlots.get(0).getStack(); + if (!gadget.isEmpty() && gadget.getItem() instanceof MiningGadget && !heldStack.isEmpty() && heldStack.getItem() instanceof UpgradeCard) { if (scrollingUpgrades.isMouseOver(mouseXIn, mouseYIn)) { // Send packet to remove the item from the inventory and add it to the table PacketHandler.sendToServer(new PacketInsertUpgrade(this.tePos, heldStack)); From 61c430137e477ae8f5bc630c1580664713bc8e51 Mon Sep 17 00:00:00 2001 From: Michael Date: Fri, 21 Aug 2020 17:46:41 +0100 Subject: [PATCH 19/19] Improved mining laser render a bit --- build.gradle | 2 -- .../mininggadgets/client/renderer/RenderMiningLaser2.java | 7 +++---- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/build.gradle b/build.gradle index 87804274..1a6c2333 100644 --- a/build.gradle +++ b/build.gradle @@ -116,8 +116,6 @@ dependencies { compileOnly fg.deobf("mezz.jei:jei-${jei_version}:api") runtimeOnly fg.deobf("mezz.jei:jei-${jei_version}") - runtimeOnly fg.deobf("cpw.mods:cpw_inventorysorter_master:18.0.0") - // You may put jars on which you depend on in ./libs or you may define them like so.. // compile "some.group:artifact:version:classifier" // compile "some.group:artifact:version" diff --git a/src/main/java/com/direwolf20/mininggadgets/client/renderer/RenderMiningLaser2.java b/src/main/java/com/direwolf20/mininggadgets/client/renderer/RenderMiningLaser2.java index 9c23b3be..3d433fe8 100644 --- a/src/main/java/com/direwolf20/mininggadgets/client/renderer/RenderMiningLaser2.java +++ b/src/main/java/com/direwolf20/mininggadgets/client/renderer/RenderMiningLaser2.java @@ -6,7 +6,6 @@ import com.direwolf20.mininggadgets.common.items.upgrade.Upgrade; import com.direwolf20.mininggadgets.common.items.upgrade.UpgradeTools; import com.mojang.blaze3d.matrix.MatrixStack; -import com.mojang.blaze3d.systems.RenderSystem; import com.mojang.blaze3d.vertex.IVertexBuilder; import net.minecraft.client.Minecraft; import net.minecraft.client.entity.player.ClientPlayerEntity; @@ -67,7 +66,7 @@ private static void drawLasers(RenderWorldLastEvent event, Vector3d from, RayTra IVertexBuilder builder; ItemStack stack = player.getHeldItem(activeHand); - double distance = from.subtract(trace.getHitVec()).length(); + double distance = Math.max(1, from.subtract(trace.getHitVec()).length()); long gameTime = player.world.getGameTime(); double v = gameTime * speedModifier; float additiveThickness = (thickness * 3.5f) * calculateLaserFlickerModifier(gameTime); @@ -128,8 +127,8 @@ private static void drawBeam(double xOffset, double yOffset, double zOffset, IVe } float f = (MathHelper.lerp(ticks, player.prevRotationPitch, player.rotationPitch) - MathHelper.lerp(ticks, player.prevRenderArmPitch, player.renderArmPitch)); float f1 = (MathHelper.lerp(ticks, player.prevRotationYaw, player.rotationYaw) - MathHelper.lerp(ticks, player.prevRenderArmYaw, player.renderArmYaw)); - startXOffset = startXOffset + (f1 / 100000000); - startYOffset = startYOffset + (f / 100000000); + startXOffset = startXOffset + (f1 / 750); + startYOffset = startYOffset + (f / 750); Vector4f vec1 = new Vector4f(startXOffset, -thickness + startYOffset, startZOffset, 1.0F); vec1.transform(positionMatrix);