From fb4b498014ff40e84912c261609eba47d1849d77 Mon Sep 17 00:00:00 2001 From: GoryMoon Date: Mon, 2 Jul 2018 17:28:27 +0200 Subject: [PATCH] Fixed open tank not occupying any sides. Fixed solar panel not using sky light. Added tooltip to open tank. #releaseBuild --- .../vswe/stevescarts/helpers/Localization.java | 1 + .../stevescarts/modules/data/ModuleData.java | 16 +++++++--------- .../modules/engines/ModuleSolarBase.java | 3 ++- .../stevescarts/modules/workers/ModuleTorch.java | 5 ++--- .../resources/assets/stevescarts/lang/en_us.lang | 1 + 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/main/java/vswe/stevescarts/helpers/Localization.java b/src/main/java/vswe/stevescarts/helpers/Localization.java index 5415e3a9..8f667a6f 100644 --- a/src/main/java/vswe/stevescarts/helpers/Localization.java +++ b/src/main/java/vswe/stevescarts/helpers/Localization.java @@ -346,6 +346,7 @@ public enum MODULE_INFO { ATTACHMENT_CATEGORY("moduleCategoryAttachment"), PIG_MESSAGE("pigExtraMessage"), OCEAN_MESSAGE("oceanExtraMessage"), + OPEN_TANK("openExtraMessage"), ALPHA_MESSAGE("alphaExtraMessage"), STORAGE_EMPTY("storageEmpty"), STORAGE_FULL("storageFull"), diff --git a/src/main/java/vswe/stevescarts/modules/data/ModuleData.java b/src/main/java/vswe/stevescarts/modules/data/ModuleData.java index e593450b..2032f0cc 100644 --- a/src/main/java/vswe/stevescarts/modules/data/ModuleData.java +++ b/src/main/java/vswe/stevescarts/modules/data/ModuleData.java @@ -1,13 +1,11 @@ package vswe.stevescarts.modules.data; import net.minecraft.client.gui.GuiScreen; -import net.minecraft.client.settings.GameSettings; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.NonNullList; import net.minecraft.util.text.TextFormatting; import net.minecraft.util.text.translation.I18n; -import net.minecraftforge.fml.client.FMLClientHandler; import net.minecraftforge.fml.common.Loader; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; @@ -100,8 +98,8 @@ public static void init() { final ModuleData coalStandard = new ModuleData(0, "Coal Engine", ModuleCoalStandard.class, 15); final ModuleData coalTiny = new ModuleData(44, "Tiny Coal Engine", ModuleCoalTiny.class, 2); addNemesis(coalTiny, coalStandard); - final ModuleData solar1 = new ModuleData(1, "Solar Engine", ModuleSolarStandard.class, 20).addSides(new SIDE[] { SIDE.CENTER, SIDE.TOP }).removeModel("Top"); - final ModuleData solar2 = new ModuleData(45, "Basic Solar Engine", ModuleSolarBasic.class, 12).addSides(new SIDE[] { SIDE.CENTER, SIDE.TOP }).removeModel("Top"); + final ModuleData solar1 = new ModuleData(1, "Solar Engine", ModuleSolarStandard.class, 20).addSides(new SIDE[] { SIDE.CENTER, SIDE.TOP }); + final ModuleData solar2 = new ModuleData(45, "Basic Solar Engine", ModuleSolarBasic.class, 12).addSides(new SIDE[] { SIDE.CENTER, SIDE.TOP }); final ModuleData compactsolar = new ModuleData(56, "Compact Solar Engine", ModuleSolarCompact.class, 32).addSides(new SIDE[] { SIDE.RIGHT, SIDE.LEFT }); new ModuleData(2, "Side Chests", ModuleSideChests.class, 3).addSides(new SIDE[] { SIDE.RIGHT, SIDE.LEFT }); @@ -184,7 +182,7 @@ public static void init() { new ModuleDataHull(38, "Standard Hull", ModuleStandard.class).setCapacity(200).setEngineMax(3).setAddonMax(6).setComplexityMax(50); new ModuleDataHull(39, "Reinforced Hull", ModuleReinforced.class).setCapacity(500).setEngineMax(5).setAddonMax(12).setComplexityMax(150); final ModuleData pumpkinhull = new ModuleDataHull(47, "Pumpkin chariot", ModulePumpkin.class).setCapacity(40).setEngineMax(1).setAddonMax(0).setComplexityMax(15); - new ModuleDataHull(62, "Mechanical Pig", ModulePig.class).setCapacity(150).setEngineMax(2).setAddonMax(4).setComplexityMax(50).addSide(SIDE.FRONT); + new ModuleDataHull(62, "Mechanical Pig", ModulePig.class).setCapacity(150).setEngineMax(2).setAddonMax(4).setComplexityMax(50).addSide(SIDE.FRONT).addMessage(Localization.MODULE_INFO.PIG_MESSAGE); new ModuleDataHull(76, "Creative Hull", ModuleCheatHull.class).setCapacity(10000).setEngineMax(5).setAddonMax(12).setComplexityMax(150); new ModuleDataHull(81, "Galgadorian Hull", ModuleGalgadorian.class).setCapacity(1000).setEngineMax(5).setAddonMax(12).setComplexityMax(150); @@ -231,10 +229,10 @@ public String getCartInfoText(final String name, final byte b) { final ModuleData internalTank = new ModuleData(63, "Internal SCTank", ModuleInternalTank.class, 37).setAllowDuplicate(); final ModuleData sideTank = new ModuleData(64, "Side Tanks", ModuleSideTanks.class, 10).addSides(new SIDE[] { SIDE.RIGHT, SIDE.LEFT }); final ModuleData topTank = new ModuleData(65, "Top SCTank", ModuleTopTank.class, 22).addSide(SIDE.TOP); - final ModuleData advancedTank = new ModuleData(66, "Advanced SCTank", ModuleAdvancedTank.class, 54); + final ModuleData advancedTank = new ModuleData(66, "Advanced SCTank", ModuleAdvancedTank.class, 54).addSides(new SIDE[]{ SIDE.CENTER, SIDE.TOP}); final ModuleData frontTank = new ModuleData(67, "Front SCTank", ModuleFrontTank.class, 15).addSide(SIDE.FRONT); final ModuleData creativeTank = new ModuleData(72, "Creative SCTank", ModuleCheatTank.class, 1).setAllowDuplicate().addMessage(Localization.MODULE_INFO.OCEAN_MESSAGE); - final ModuleData topTankOpen = new ModuleData(73, "Open SCTank", ModuleOpenTank.class, 31); + final ModuleData topTankOpen = new ModuleData(73, "Open SCTank", ModuleOpenTank.class, 31).addSide(SIDE.TOP).addMessage(Localization.MODULE_INFO.OPEN_TANK); addNemesis(frontTank, cleaner); tankGroup.add(internalTank).add(sideTank).add(topTank).add(advancedTank).add(frontTank).add(creativeTank).add(topTankOpen); @@ -321,8 +319,8 @@ public String getCartInfoText(final String name, final byte b) { public static void initModels() { ModuleData.moduleList.get((byte) 0).addModel("Engine", new ModelEngineFrame()).addModel("Fire", new ModelEngineInside()); ModuleData.moduleList.get((byte) 44).addModel("Engine", new ModelEngineFrame()).addModel("Fire", new ModelEngineInside()); - ModuleData.moduleList.get((byte) 1).addModel("SolarPanelBase", new ModelSolarPanelBase()).addModel("SolarPanels", new ModelSolarPanelHeads(4)); - ModuleData.moduleList.get((byte) 45).addModel("SolarPanelBase", new ModelSolarPanelBase()).addModel("SolarPanels", new ModelSolarPanelHeads(2)); + ModuleData.moduleList.get((byte) 1).addModel("SolarPanelBase", new ModelSolarPanelBase()).addModel("SolarPanels", new ModelSolarPanelHeads(4)).removeModel("Top"); + ModuleData.moduleList.get((byte) 45).addModel("SolarPanelBase", new ModelSolarPanelBase()).addModel("SolarPanels", new ModelSolarPanelHeads(2)).removeModel("Top"); ModuleData.moduleList.get((byte) 56).addModel("SolarPanelSide", new ModelCompactSolarPanel()); ModuleData.moduleList.get((byte) 2).addModel("SideChest", new ModelSideChests()); ModuleData.moduleList.get((byte) 3).removeModel("Top").addModel("TopChest", new ModelTopChest()); diff --git a/src/main/java/vswe/stevescarts/modules/engines/ModuleSolarBase.java b/src/main/java/vswe/stevescarts/modules/engines/ModuleSolarBase.java index f0375e88..dd8cf2fe 100644 --- a/src/main/java/vswe/stevescarts/modules/engines/ModuleSolarBase.java +++ b/src/main/java/vswe/stevescarts/modules/engines/ModuleSolarBase.java @@ -3,6 +3,7 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.network.datasync.DataParameter; import net.minecraft.network.datasync.DataSerializers; +import net.minecraft.world.EnumSkyBlock; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; import vswe.stevescarts.entitys.EntityMinecartModular; @@ -63,7 +64,7 @@ private void updateLight() { if (!getCart().world.isDaytime() || getCart().world.isRaining()) { light = 0; } else { - light = getCart().world.getLight(getCart().getPosition()); + light = getCart().world.getLightFor(EnumSkyBlock.SKY, getCart().getPosition()); if (light == 15 && !getCart().world.canBlockSeeSky(getCart().getPosition())) { light = 14; } diff --git a/src/main/java/vswe/stevescarts/modules/workers/ModuleTorch.java b/src/main/java/vswe/stevescarts/modules/workers/ModuleTorch.java index df36e08c..9f759a66 100644 --- a/src/main/java/vswe/stevescarts/modules/workers/ModuleTorch.java +++ b/src/main/java/vswe/stevescarts/modules/workers/ModuleTorch.java @@ -75,7 +75,7 @@ public boolean work() { for (int side = -1; side <= 1; side += 2) { final int xTorch = x + ((cartZ != z) ? side : 0); final int zTorch = z + ((cartX != x) ? side : 0); - for (int level = 2; level >= -2; --level) { + for (int level = 2; level >= -2; level--) { BlockPos pos = new BlockPos(xTorch, y + level, zTorch); if (world.isAirBlock(pos) && Blocks.TORCH.canPlaceBlockAt(world, pos)) { int i = 0; @@ -103,8 +103,7 @@ public boolean work() { } } break; - } - if (world.getBlockState(pos).getBlock() == Blocks.TORCH) { + } else if (world.getBlockState(pos).getBlock() == Blocks.TORCH) { break; } } diff --git a/src/main/resources/assets/stevescarts/lang/en_us.lang b/src/main/resources/assets/stevescarts/lang/en_us.lang index d6b9f1fe..c6e6ff9e 100644 --- a/src/main/resources/assets/stevescarts/lang/en_us.lang +++ b/src/main/resources/assets/stevescarts/lang/en_us.lang @@ -476,6 +476,7 @@ info.SC2:moduleGroupToolShooter=[%1:Tool|Tools] or [%1:Shooter|Shooters] # Messages info.SC2:pigExtraMessage=In memory of Vswe's Thunderpig arena victory. Thanks everyone who donated during the 2013 Minecraft Marathon info.SC2:oceanExtraMessage=Room for an average sized ocean +info.SC2:openExtraMessage=This module will accumulate small amount of water when it rains info.SC2:alphaExtraMessage=1 year in alpha info.SC2:storageEmpty=Empty info.SC2:storageFull=Full