Skip to content

Commit

Permalink
Update to 7.1-pre1a, fix bug where item inventories wouldn't save.
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinSVK12 committed Dec 23, 2023
1 parent 26696c4 commit d734a73
Show file tree
Hide file tree
Showing 14 changed files with 34 additions and 66 deletions.
11 changes: 6 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
6 changes: 3 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -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
Expand Down
12 changes: 11 additions & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,14 @@ pluginManagement {
url = 'https://maven.quiltmc.org/repository/release'
}
}
}
}

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")
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package sunsetsatellite.signalindustries.api.impl.fluidapi;
package sunsetsatellite.signalindustries.api.impl.catalyst;


import net.minecraft.core.block.BlockFluid;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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){
}
}*/
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
46 changes: 0 additions & 46 deletions src/main/java/sunsetsatellite/signalindustries/util/NBTHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand All @@ -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();
}
}*/
}

0 comments on commit d734a73

Please sign in to comment.