-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
mob spawner entities can now properly variate again
- Loading branch information
Showing
3 changed files
with
29 additions
and
31 deletions.
There are no files selected for viewing
30 changes: 0 additions & 30 deletions
30
...traben/entity_texture_features/mixin/entity/block/MixinMobSpawnerBlockEntityRenderer.java
This file was deleted.
Oops, something went wrong.
28 changes: 28 additions & 0 deletions
28
...src/main/java/traben/entity_texture_features/mixin/entity/block/MixinMobSpawnerLogic.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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())); | ||
} | ||
} | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters