From d734a736209cdc48710fb706e719a21e584da913 Mon Sep 17 00:00:00 2001 From: MartinSVK12 <37455793+MartinSVK12@users.noreply.github.com> Date: Sat, 23 Dec 2023 23:10:45 +0100 Subject: [PATCH] Update to 7.1-pre1a, fix bug where item inventories wouldn't save. --- build.gradle | 11 +++-- gradle.properties | 6 +-- settings.gradle | 12 ++++- .../SignalIndustriesFluidPlugin.java | 2 +- .../gui/GuiAbilityModule.java | 3 +- .../signalindustries/gui/GuiHarness.java | 3 +- .../signalindustries/gui/GuiPulsar.java | 3 +- .../gui/GuiPulsarAttachment.java | 3 +- .../mixin/AchievementMixin.java | 1 - .../mixin/RenderPlayerMixin.java | 4 +- .../recipes/container/SIRecipes.java | 2 +- .../recipes/entry/RecipeEntryMachine.java | 2 +- .../entry/RecipeEntryMachineFluid.java | 2 +- .../signalindustries/util/NBTHelper.java | 46 ------------------- 14 files changed, 34 insertions(+), 66 deletions(-) rename src/main/java/sunsetsatellite/signalindustries/api/impl/{fluidapi => catalyst}/SignalIndustriesFluidPlugin.java (97%) diff --git a/build.gradle b/build.gradle index 3f84d14b..586dae30 100644 --- a/build.gradle +++ b/build.gradle @@ -118,12 +118,13 @@ dependencies { modImplementation "bta-halplibe:halplibe:${project.halplibe_version}" modImplementation "ModMenu:ModMenu:2.0.3" - modImplementation "catalyst:catalyst-core:1.0.0" - modImplementation "catalyst:catalyst-fluids:1.0.0" - modImplementation "catalyst:catalyst-energy:1.0.0" - modImplementation "catalyst:catalyst-multiblocks:1.0.0" - modImplementation "DragonFly:dragonfly:1.0.0-7.1" + implementation project(path: ":catalyst",configuration: "namedElements") + implementation project(path: ":catalyst:energy",configuration: "namedElements") + implementation project(path: ":catalyst:fluids",configuration: "namedElements") + implementation project(path: ":catalyst:multiblocks",configuration: "namedElements") + + modImplementation "DragonFly:dragonfly:1.0.4-7.1" implementation "org.slf4j:slf4j-api:1.8.0-beta4" implementation "org.apache.logging.log4j:log4j-slf4j18-impl:2.16.0" diff --git a/gradle.properties b/gradle.properties index 4dd0a295..90096e7e 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,13 +1,13 @@ org.gradle.jvmargs=-Xmx2G # BTA -bta_version=7.1-pre1 +bta_version=7.1-pre1a # Loader -loader_version=0.14.19-babric.2-bta +loader_version=0.14.19-babric.3-bta # HalpLibe -halplibe_version=3.0.1 +halplibe_version=3.0.4 # Mod mod_version=0.2.0 diff --git a/settings.gradle b/settings.gradle index 882a4c13..d64d93da 100644 --- a/settings.gradle +++ b/settings.gradle @@ -18,4 +18,14 @@ pluginManagement { url = 'https://maven.quiltmc.org/repository/release' } } -} \ No newline at end of file +} + +include(":catalyst") +include(":catalyst:energy") +include(":catalyst:fluids") +include(":catalyst:multiblocks") + +project(":catalyst").projectDir = file("${rootProject.projectDir}/../catalyst") +project(":catalyst:energy").projectDir = file("${project(":catalyst").projectDir}/energy") +project(":catalyst:fluids").projectDir = file("${project(":catalyst").projectDir}//fluids") +project(":catalyst:multiblocks").projectDir = file("${project(":catalyst").projectDir}/multiblocks") \ No newline at end of file diff --git a/src/main/java/sunsetsatellite/signalindustries/api/impl/fluidapi/SignalIndustriesFluidPlugin.java b/src/main/java/sunsetsatellite/signalindustries/api/impl/catalyst/SignalIndustriesFluidPlugin.java similarity index 97% rename from src/main/java/sunsetsatellite/signalindustries/api/impl/fluidapi/SignalIndustriesFluidPlugin.java rename to src/main/java/sunsetsatellite/signalindustries/api/impl/catalyst/SignalIndustriesFluidPlugin.java index eef906ff..4b6e8e8c 100644 --- a/src/main/java/sunsetsatellite/signalindustries/api/impl/fluidapi/SignalIndustriesFluidPlugin.java +++ b/src/main/java/sunsetsatellite/signalindustries/api/impl/catalyst/SignalIndustriesFluidPlugin.java @@ -1,4 +1,4 @@ -package sunsetsatellite.signalindustries.api.impl.fluidapi; +package sunsetsatellite.signalindustries.api.impl.catalyst; import net.minecraft.core.block.BlockFluid; diff --git a/src/main/java/sunsetsatellite/signalindustries/gui/GuiAbilityModule.java b/src/main/java/sunsetsatellite/signalindustries/gui/GuiAbilityModule.java index ee529449..c0394d37 100644 --- a/src/main/java/sunsetsatellite/signalindustries/gui/GuiAbilityModule.java +++ b/src/main/java/sunsetsatellite/signalindustries/gui/GuiAbilityModule.java @@ -55,7 +55,8 @@ protected void drawGuiContainerForegroundLayer() { GL11.glDisable(2896); } - public void onGuiClosed(){ + @Override + public void onClosed(){ NBTHelper.saveInvToNBT(container.inv.item,((ContainerAbilityModule)inventorySlots).inv); } diff --git a/src/main/java/sunsetsatellite/signalindustries/gui/GuiHarness.java b/src/main/java/sunsetsatellite/signalindustries/gui/GuiHarness.java index 2c64e6bc..d29b03a9 100644 --- a/src/main/java/sunsetsatellite/signalindustries/gui/GuiHarness.java +++ b/src/main/java/sunsetsatellite/signalindustries/gui/GuiHarness.java @@ -38,7 +38,8 @@ protected void drawGuiContainerForegroundLayer() fontRenderer.drawCenteredString("Signalum Prototype Harness", 90, 6, 0xFFFF8080); } - public void onGuiClosed(){ + @Override + public void onClosed(){ if(armor.getItem() instanceof ItemSignalumPrototypeHarness){ NBTHelper.saveInvToNBT(armor,((ContainerHarness)inventorySlots).inv); } diff --git a/src/main/java/sunsetsatellite/signalindustries/gui/GuiPulsar.java b/src/main/java/sunsetsatellite/signalindustries/gui/GuiPulsar.java index e3fdc215..27cadb1f 100644 --- a/src/main/java/sunsetsatellite/signalindustries/gui/GuiPulsar.java +++ b/src/main/java/sunsetsatellite/signalindustries/gui/GuiPulsar.java @@ -38,7 +38,8 @@ protected void drawGuiContainerForegroundLayer() fontRenderer.drawCenteredString("The Pulsar", 90, 6, 0xFFCC0000); } - public void onGuiClosed(){ + @Override + public void onClosed() { if(pulsar.getItem() instanceof ItemPulsar){ NBTHelper.saveInvToNBT(pulsar,((ContainerPulsar)inventorySlots).inv); } diff --git a/src/main/java/sunsetsatellite/signalindustries/gui/GuiPulsarAttachment.java b/src/main/java/sunsetsatellite/signalindustries/gui/GuiPulsarAttachment.java index e42b45eb..0d5bd595 100644 --- a/src/main/java/sunsetsatellite/signalindustries/gui/GuiPulsarAttachment.java +++ b/src/main/java/sunsetsatellite/signalindustries/gui/GuiPulsarAttachment.java @@ -38,7 +38,8 @@ protected void drawGuiContainerForegroundLayer() fontRenderer.drawCenteredString("The Pulsar", 90, 6, 0xFFCC0000); } - public void onGuiClosed(){ + @Override + public void onClosed(){ if(pulsar.getItem() instanceof ItemPulsarAttachment){ NBTHelper.saveInvToNBT(pulsar,((ContainerPulsarAttachment)inventorySlots).inv); } diff --git a/src/main/java/sunsetsatellite/signalindustries/mixin/AchievementMixin.java b/src/main/java/sunsetsatellite/signalindustries/mixin/AchievementMixin.java index ed9f2db3..e940467d 100644 --- a/src/main/java/sunsetsatellite/signalindustries/mixin/AchievementMixin.java +++ b/src/main/java/sunsetsatellite/signalindustries/mixin/AchievementMixin.java @@ -7,7 +7,6 @@ import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; -@SuppressWarnings("MixinSuperClass") @Mixin( value = Achievement.class, remap = false diff --git a/src/main/java/sunsetsatellite/signalindustries/mixin/RenderPlayerMixin.java b/src/main/java/sunsetsatellite/signalindustries/mixin/RenderPlayerMixin.java index df0a5553..979121bd 100644 --- a/src/main/java/sunsetsatellite/signalindustries/mixin/RenderPlayerMixin.java +++ b/src/main/java/sunsetsatellite/signalindustries/mixin/RenderPlayerMixin.java @@ -76,9 +76,9 @@ protected void renderSpecials(EntityPlayer entityplayer, float f, CallbackInfo c if(stack.getItem() instanceof ItemPulsar){ GL11.glRotatef(160f, 0.0F, -1.2F, 1.55F); GL11.glTranslatef(-0.15F, 0.15f, 0.25F); - if(stack.getData().getByte("charge") >= 100){ + /*if(stack.getData().getByte("charge") >= 100){ - } + }*/ } } } diff --git a/src/main/java/sunsetsatellite/signalindustries/recipes/container/SIRecipes.java b/src/main/java/sunsetsatellite/signalindustries/recipes/container/SIRecipes.java index 6e2e0619..847a7c2d 100644 --- a/src/main/java/sunsetsatellite/signalindustries/recipes/container/SIRecipes.java +++ b/src/main/java/sunsetsatellite/signalindustries/recipes/container/SIRecipes.java @@ -7,7 +7,7 @@ import net.minecraft.core.data.registry.recipe.entry.RecipeEntryCrafting; import net.minecraft.core.item.ItemStack; import sunsetsatellite.signalindustries.SignalIndustries; -import sunsetsatellite.signalindustries.api.impl.fluidapi.SignalIndustriesFluidPlugin; +import sunsetsatellite.signalindustries.api.impl.catalyst.SignalIndustriesFluidPlugin; import sunsetsatellite.signalindustries.recipes.CraftingRecipesSI; import sunsetsatellite.signalindustries.recipes.RecipeGroupSI; import sunsetsatellite.signalindustries.recipes.RecipeNamespaceSI; diff --git a/src/main/java/sunsetsatellite/signalindustries/recipes/entry/RecipeEntryMachine.java b/src/main/java/sunsetsatellite/signalindustries/recipes/entry/RecipeEntryMachine.java index a60cc568..1411d369 100644 --- a/src/main/java/sunsetsatellite/signalindustries/recipes/entry/RecipeEntryMachine.java +++ b/src/main/java/sunsetsatellite/signalindustries/recipes/entry/RecipeEntryMachine.java @@ -51,7 +51,7 @@ public boolean matchesScope(SearchQuery query) { return true; } } else if (query.scope.getLeft() == SearchQuery.SearchScope.NAMESPACE_GROUP) { - RecipeGroup group; + RecipeGroup group; try { group = Registries.RECIPES.getGroupFromKey(query.scope.getRight()); } catch (IllegalArgumentException e) { diff --git a/src/main/java/sunsetsatellite/signalindustries/recipes/entry/RecipeEntryMachineFluid.java b/src/main/java/sunsetsatellite/signalindustries/recipes/entry/RecipeEntryMachineFluid.java index 68cf4ba5..d83dd877 100644 --- a/src/main/java/sunsetsatellite/signalindustries/recipes/entry/RecipeEntryMachineFluid.java +++ b/src/main/java/sunsetsatellite/signalindustries/recipes/entry/RecipeEntryMachineFluid.java @@ -52,7 +52,7 @@ public boolean matchesScope(SearchQuery query) { return true; } } else if (query.scope.getLeft() == SearchQuery.SearchScope.NAMESPACE_GROUP) { - RecipeGroup group; + RecipeGroup group; try { group = Registries.RECIPES.getGroupFromKey(query.scope.getRight()); } catch (IllegalArgumentException e) { diff --git a/src/main/java/sunsetsatellite/signalindustries/util/NBTHelper.java b/src/main/java/sunsetsatellite/signalindustries/util/NBTHelper.java index a1769814..de7afd74 100644 --- a/src/main/java/sunsetsatellite/signalindustries/util/NBTHelper.java +++ b/src/main/java/sunsetsatellite/signalindustries/util/NBTHelper.java @@ -40,23 +40,6 @@ public static void saveInvToNBT(ItemStack source_item, IInventory inv){ } } - /*public static CompoundTag savePureNBT(CompoundTag nbt, IInventory inv){ - for(int i = 0; i < inv.getSizeInventory();i++){ - ItemStack item = inv.getStackInSlot(i); - CompoundTag itemNBT = new CompoundTag(); - if(item != null){ - itemNBT.putByte("Count", (byte)item.stackSize); - itemNBT.putShort("id", (short)item.itemID); - itemNBT.putShort("Damage", (short)item.getMetadata()); - itemNBT.putCompound("Data", (CompoundTag)item.tag); - nbt.putCompound(String.valueOf(i),itemNBT); - } else { - ((INBTCompound)nbt).removeTag(String.valueOf(i)); - } - } - return nbt; - }*/ - public static void loadInvFromNBT(ItemStack source_item, IInventory inv, int amount, int fluidAmount){ CompoundTag itemNBT = source_item.getData().getCompound("inventory"); CompoundTag fluidNBT = source_item.getData().getCompound("fluidInventory"); @@ -74,33 +57,4 @@ public static void loadInvFromNBT(ItemStack source_item, IInventory inv, int amo } } } - - /*public static void loadPureNBT(CompoundTag nbt, IInventory inv, int amount){ - for(int i = 0; i < amount;i++){ - if(nbt.hasKey(String.valueOf(i))){ - ItemStack item = new ItemStack(nbt.getCompound(String.valueOf(i))); - inv.setInventorySlotContents(i,item); - } - } - }*/ - - /*public static NBTBase loadNBTFile(String name) { - try { - RandomAccessFile file = new RandomAccessFile(name, "r"); - NBTBase nbt = NBTBase.readTag(file); - return nbt; - } catch(IOException e){ - e.printStackTrace(); - } - return new CompoundTag(); - } - - public static void saveNBTFile(String name, NBTBase nbt) { - try { - RandomAccessFile file = new RandomAccessFile(name, "rw"); - NBTBase.writeTag(nbt, file); - } catch (IOException e){ - e.printStackTrace(); - } - }*/ }