Skip to content

Commit

Permalink
mob spawner entities can now properly variate again
Browse files Browse the repository at this point in the history
  • Loading branch information
Traben-0 committed Dec 29, 2023
1 parent 2f8c0b0 commit faae52e
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 31 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package traben.entity_texture_features.mixin.entity.block;

import net.minecraft.block.spawner.MobSpawnerLogic;
import net.minecraft.entity.Entity;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;

import java.util.UUID;

@Mixin(MobSpawnerLogic.class)
public abstract class MixinMobSpawnerLogic {


@Inject(method = "getRenderedEntity",
at = @At(value = "RETURN"))
private static void etf$stabiliseMobSpawnerUUID(World world, BlockPos pos, CallbackInfoReturnable<Entity> cir) {
Entity entity = cir.getReturnValue();
if(entity != null){
entity.setUuid(new UUID(pos.asLong(), world.hashCode()));
}
}
}


Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"accessor.PlayerSkinProviderAccessor",
"accessor.PlayerSkinTextureAccessor",
"accessor.TooltipAccessor",
"entity.block.MixinMobSpawnerBlockEntityRenderer",
"entity.block.MixinMobSpawnerLogic",
"entity.block.MixinSkullBlockEntityRenderer",
"entity.misc.MixinBlazeEntity",
"entity.misc.MixinBlockEntity",
Expand Down

0 comments on commit faae52e

Please sign in to comment.