Apply spotless and fixing keeping item on death

This commit is contained in:
rjnasers committed 2023-04-26 16:20:41 -05:00
1 parent 729908b1b0
commit 2d78a84df1
3 files changed
+10 -8

No files matched your search

@@ -1,12 +1,14 @@
package magicbees.client.gui;
import cpw.mods.fml.common.registry.GameRegistry;
import magicbees.itemInventories.InventoryBeeRing;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
import cpw.mods.fml.common.registry.GameRegistry;
public class ContainerEffectRing extends Container {
InventoryBeeRing IBR;
@@ -14,7 +16,7 @@ public class ContainerEffectRing extends Container {
public ContainerEffectRing(InventoryBeeRing IBR, EntityPlayer player) {
this.IBR = IBR;
this.addSlotToContainer(
new SlotCustomItems(this.IBR, 0, 80, 22, GameRegistry.findItemStack("Forestry", "beeDroneGE", 1)));
new SlotCustomItems(this.IBR, 0, 80, 22, GameRegistry.findItemStack("Forestry", "beeDroneGE", 1)));
for (int i = 0; i < 3; ++i) {
for (int j = 0; j < 9; ++j) {
@@ -146,17 +146,13 @@ public class ItemBeeRing extends Item implements IBauble {
RingHousing housingLogic = new RingHousing(player, IBR);
IBR.setEffectAndInitialize(queen);
IBR.effectData = queen.doEffect(IBR.effectData, housingLogic);
if (player.isDead) {
return;
}
IBR.writeEffectNBT();
// Crashes irregularly for some reason I can't figure out, but this is just the bee effects around you, so it's
// not a huge deal. It would be nice to have though
// I will get around to it later. (Crash has something to do with entityFX when the player is moving)
// if (player.getEntityWorld().getWorldTime() % 5 == 0) {
// IBR.effectData = queen.doFX(IBR.effectData, housingLogic);
// }
@@ -159,13 +159,17 @@ public class InventoryBeeRing implements IInventory {
}
private void setInventorySlot(ItemStack parent) {
if (this.player.getHealth() == 0) {
return;
}
if (baubleFlag) {
InventoryBaubles baubles = PlayerHandler.getPlayerBaubles(this.player);
baubles.setInventorySlotContents(itemLocatedSlot, parent);
} else {
player.inventory.setInventorySlotContents(itemLocatedSlot, parent);
}
}
public void setCurrentBeeHealth(int health) {