Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,8 @@ public void onArmorTick(World world, EntityPlayer player, ItemStack stack) {
super.onArmorTick(world, player, stack);

if (world.isRemote && this == RegistrarBloodMagicItems.LIVING_ARMOUR_CHEST) {
setLivingArmour(stack, getLivingArmourFromStack(stack)); // updates the living armor

if (player instanceof EntityPlayerSP) //Sanity check
{
EntityPlayerSP spPlayer = (EntityPlayerSP) player;
Expand Down Expand Up @@ -328,7 +330,8 @@ public void onArmorTick(World world, EntityPlayer player, ItemStack stack) {
armour.onTick(world, player);
}

setLivingArmour(stack, armour, false);
if (!world.isRemote) // client shouldn't change the nbt data
setLivingArmour(stack, armour, false);
}
}

Expand Down
12 changes: 12 additions & 0 deletions src/main/java/WayofTime/bloodmagic/proxy/ClientProxy.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import WayofTime.bloodmagic.entity.projectile.EntityMeteor;
import WayofTime.bloodmagic.entity.projectile.EntitySentientArrow;
import WayofTime.bloodmagic.entity.projectile.EntitySoulSnare;
import WayofTime.bloodmagic.item.armour.ItemLivingArmour;
import WayofTime.bloodmagic.item.types.AlchemicVialType;
import WayofTime.bloodmagic.soul.DemonWillHolder;
import WayofTime.bloodmagic.tile.*;
Expand All @@ -30,12 +31,15 @@
import net.minecraftforge.client.model.ModelLoaderRegistry;
import net.minecraftforge.client.model.animation.AnimationTESR;
import net.minecraftforge.client.model.obj.OBJLoader;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.common.animation.Event;
import net.minecraftforge.common.animation.ITimeValue;
import net.minecraftforge.common.model.animation.IAnimationStateMachine;
import net.minecraftforge.fml.client.registry.ClientRegistry;
import net.minecraftforge.fml.client.registry.RenderingRegistry;
import net.minecraftforge.fml.common.ObfuscationReflectionHelper;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.network.FMLNetworkEvent;

import java.awt.Color;
import java.util.Map;
Expand Down Expand Up @@ -66,6 +70,8 @@ public void handleEvents(TileInversionPillar chest, float time, Iterable<Event>
// Initialize key-binds during startup so they load correctly
for (KeyBindings key : KeyBindings.values())
key.getKey();

MinecraftForge.EVENT_BUS.register(this);
}

@Override
Expand Down Expand Up @@ -142,4 +148,10 @@ private void addElytraLayer() {
public IAnimationStateMachine load(ResourceLocation location, ImmutableMap<String, ITimeValue> parameters) {
return ModelLoaderRegistry.loadASM(location, parameters);
}

@SubscribeEvent
public void onClientDisconnected(FMLNetworkEvent.ClientDisconnectionFromServerEvent event) {
// clean up the living armour's cache
ItemLivingArmour.armourMap.clear();
}
}