Skip to content

Commit

Permalink
1.0.1 - Fix Server Launch
Browse files Browse the repository at this point in the history
ReclipseTheOne committed Oct 6, 2024
1 parent 1780be6 commit 15a39f0
Showing 2 changed files with 2 additions and 42 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -18,7 +18,7 @@ loader_version_range=[4,)
mod_id=bagz
mod_name=Bagz
mod_license=MIT
mod_version=0.0.1
mod_version=1.0.1
mod_group_id=com.portingdeadmods.bagz
mod_authors=Reclipse
mod_description=Like ender pouches, but better!
Original file line number Diff line number Diff line change
@@ -5,7 +5,6 @@
import com.portingdeadmods.bagz.content.menus.BagMenuColored;
import com.portingdeadmods.bagz.data.DataComponents;
import com.portingdeadmods.bagz.content.menus.BagMenu;
import net.minecraft.client.color.item.ItemColor;
import net.minecraft.network.chat.Component;
import net.minecraft.world.InteractionHand;
import net.minecraft.world.InteractionResultHolder;
@@ -20,7 +19,7 @@
import org.jetbrains.annotations.Nullable;


public class BagItem extends Item implements ItemColor, MenuProvider {
public class BagItem extends Item implements MenuProvider {
public final String color;
public final BagContainer bagContainer;

@@ -35,40 +34,6 @@ public BagItem(String color) {
this.bagContainer = new BagContainer(color);
}

@Override
public int getColor(ItemStack stack, int tintIndex) {
if (tintIndex == 1) { // Assuming tintIndex 1 is for the bag color
try {
byte red = stack.get(DataComponents.RED);
byte green = stack.get(DataComponents.GREEN);
byte blue = stack.get(DataComponents.BLUE);
return ((red & 0xFF) << 16) | ((green & 0xFF) << 8) | (blue & 0xFF);
} catch (NullPointerException e) {
Bagz.LOGGER.info("Searchable Catch: Bag getColor error\n" + e.getMessage());
return 0xFFFFFF; // Default to white
}
};
return switch (color) {
case "red" -> 0xFF0000;
case "green" -> 0x00FF00;
case "blue" -> 0x0000FF;
case "yellow" -> 0xFFFF00;
case "purple" -> 0xFF00FF;
case "cyan" -> 0x00FFFF;
case "white" -> 0xFFFFFF;
case "black" -> 0x000000;
case "orange" -> 0xFFA500;
case "pink" -> 0xFFC0CB;
case "brown" -> 0xA52A2A;
case "gray" -> 0x808080;
case "light_gray" -> 0xD3D3D3;
case "lime" -> 0x00FF00;
case "magenta" -> 0xFF00FF;
case "light_blue" -> 0xADD8E6;
default -> 0xFFFFFF; // Default white
};
}

@Override
public InteractionResultHolder<ItemStack> use(Level level, Player player, InteractionHand usedHand) {

@@ -122,9 +87,4 @@ public AbstractContainerMenu createMenu(int containerId, Inventory playerInvento
default: return new SimpleMenuProvider((id, inv, player1) -> new BagMenu(id, inv, bagContainer), getDisplayName()).createMenu(containerId, playerInventory, player);
}
}

@Override
public int getBarColor(ItemStack stack) {
return getColor(stack, 1);
}
}

0 comments on commit 15a39f0

Please sign in to comment.