diff --git a/src/main/java/vazkii/botania/client/render/tile/RenderTileCocoon.java b/src/main/java/vazkii/botania/client/render/tile/RenderTileCocoon.java index a4e4fae19..6f910819d 100644 --- a/src/main/java/vazkii/botania/client/render/tile/RenderTileCocoon.java +++ b/src/main/java/vazkii/botania/client/render/tile/RenderTileCocoon.java @@ -41,7 +41,6 @@ public class RenderTileCocoon extends TileEntityRenderer { } ms.push(); - ms.translate(0, 0, 1); ms.translate(0.5, 0, 0); ms.multiply(Vector3f.POSITIVE_X.getDegreesQuaternion(rot)); ms.translate(-0.5, 0, 0); diff --git a/src/main/java/vazkii/botania/common/core/handler/PixieHandler.java b/src/main/java/vazkii/botania/common/core/handler/PixieHandler.java index f0e6b11ae..bf6d9652b 100644 --- a/src/main/java/vazkii/botania/common/core/handler/PixieHandler.java +++ b/src/main/java/vazkii/botania/common/core/handler/PixieHandler.java @@ -8,6 +8,7 @@ */ package vazkii.botania.common.core.handler; +import net.minecraft.entity.Entity; import net.minecraft.entity.LivingEntity; import net.minecraft.entity.SpawnReason; import net.minecraft.entity.ai.attributes.AbstractAttributeMap; @@ -22,6 +23,7 @@ import net.minecraft.potion.EffectInstance; import net.minecraft.potion.Effects; import net.minecraft.util.Util; import net.minecraft.util.math.BlockPos; +import net.minecraftforge.event.AttachCapabilitiesEvent; import net.minecraftforge.event.entity.EntityJoinWorldEvent; import net.minecraftforge.event.entity.living.LivingHurtEvent; import net.minecraftforge.eventbus.api.SubscribeEvent; @@ -63,10 +65,11 @@ public final class PixieHandler { return new AttributeModifier(DEFAULT_MODIFIER_UUIDS.get(slot), name, amount, AttributeModifier.Operation.ADDITION); } + // Want to do this as early as possible -- doing it at entity join world means attribute modifiers are ignored when loading @SubscribeEvent - public static void playerJoin(EntityJoinWorldEvent evt) { - if (evt.getEntity() instanceof PlayerEntity) { - AbstractAttributeMap attributes = ((PlayerEntity) evt.getEntity()).getAttributes(); + public static void registerAttribute(AttachCapabilitiesEvent evt) { + if (evt.getObject() instanceof PlayerEntity) { + AbstractAttributeMap attributes = ((PlayerEntity) evt.getObject()).getAttributes(); if (attributes.getAttributeInstance(PIXIE_SPAWN_CHANCE) == null) { attributes.registerAttribute(PIXIE_SPAWN_CHANCE); }