Texture compress & entity mixin
|
@ -0,0 +1,30 @@
|
||||||
|
package ru.betterend.mixin.common;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
|
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 net.minecraft.entity.EntityType;
|
||||||
|
import net.minecraft.entity.SpawnReason;
|
||||||
|
import net.minecraft.entity.mob.EndermanEntity;
|
||||||
|
import net.minecraft.entity.mob.HostileEntity;
|
||||||
|
import net.minecraft.util.math.BlockPos;
|
||||||
|
import net.minecraft.util.math.Box;
|
||||||
|
import net.minecraft.world.ServerWorldAccess;
|
||||||
|
|
||||||
|
@Mixin(HostileEntity.class)
|
||||||
|
public class HostileEntityMixin {
|
||||||
|
@Inject(method = "canSpawnInDark", at = @At(value = "RETURN"))
|
||||||
|
private static void endermenCheck(EntityType<? extends HostileEntity> type, ServerWorldAccess serverWorldAccess, SpawnReason spawnReason, BlockPos pos, Random random, CallbackInfoReturnable<Boolean> info) {
|
||||||
|
boolean canSpawn = info.getReturnValue();
|
||||||
|
if (canSpawn && spawnReason == SpawnReason.NATURAL) {
|
||||||
|
Box box = new Box(pos).expand(16);
|
||||||
|
List<EndermanEntity> entities = serverWorldAccess.getEntitiesByClass(EndermanEntity.class, box, (entity) -> { return true; });
|
||||||
|
info.setReturnValue(entities.size() < 6);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 283 B |
Before Width: | Height: | Size: 2 KiB After Width: | Height: | Size: 334 B |
Before Width: | Height: | Size: 2 KiB After Width: | Height: | Size: 319 B |
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 299 B |
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 422 B |
Before Width: | Height: | Size: 3 KiB After Width: | Height: | Size: 368 B |
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 586 B |
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 604 B |
Before Width: | Height: | Size: 2 KiB After Width: | Height: | Size: 710 B |
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 140 B |
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 173 B |
Before Width: | Height: | Size: 2 KiB After Width: | Height: | Size: 274 B |
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 331 B |
Before Width: | Height: | Size: 744 B After Width: | Height: | Size: 739 B |
Before Width: | Height: | Size: 718 B After Width: | Height: | Size: 715 B |
Before Width: | Height: | Size: 704 B After Width: | Height: | Size: 703 B |
Before Width: | Height: | Size: 602 B After Width: | Height: | Size: 598 B |
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 437 B |
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 431 B |
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 597 B |
Before Width: | Height: | Size: 703 B After Width: | Height: | Size: 607 B |
Before Width: | Height: | Size: 4 KiB After Width: | Height: | Size: 587 B |
Before Width: | Height: | Size: 3.6 KiB After Width: | Height: | Size: 281 B |
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 639 B |
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 252 B |
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 656 B |
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 645 B |
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 298 B |
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 294 B |
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 251 B |
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 413 B |
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 597 B |
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 433 B |
Before Width: | Height: | Size: 2 KiB After Width: | Height: | Size: 450 B |
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 403 B |
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 583 B |
Before Width: | Height: | Size: 2 KiB After Width: | Height: | Size: 551 B |
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 475 B |
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 592 B |
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 377 B |
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 483 B |
Before Width: | Height: | Size: 645 B After Width: | Height: | Size: 645 B |
Before Width: | Height: | Size: 720 B After Width: | Height: | Size: 720 B |
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 606 B After Width: | Height: | Size: 606 B |
Before Width: | Height: | Size: 743 B After Width: | Height: | Size: 734 B |
Before Width: | Height: | Size: 749 B After Width: | Height: | Size: 741 B |
Before Width: | Height: | Size: 722 B After Width: | Height: | Size: 717 B |
Before Width: | Height: | Size: 734 B After Width: | Height: | Size: 731 B |
Before Width: | Height: | Size: 736 B After Width: | Height: | Size: 733 B |
Before Width: | Height: | Size: 726 B After Width: | Height: | Size: 724 B |
Before Width: | Height: | Size: 729 B After Width: | Height: | Size: 727 B |
Before Width: | Height: | Size: 726 B After Width: | Height: | Size: 723 B |
Before Width: | Height: | Size: 738 B After Width: | Height: | Size: 734 B |
Before Width: | Height: | Size: 719 B After Width: | Height: | Size: 719 B |
Before Width: | Height: | Size: 729 B After Width: | Height: | Size: 724 B |
Before Width: | Height: | Size: 705 B After Width: | Height: | Size: 702 B |
Before Width: | Height: | Size: 723 B After Width: | Height: | Size: 721 B |
Before Width: | Height: | Size: 723 B After Width: | Height: | Size: 720 B |
Before Width: | Height: | Size: 707 B After Width: | Height: | Size: 703 B |
Before Width: | Height: | Size: 712 B After Width: | Height: | Size: 711 B |
Before Width: | Height: | Size: 707 B After Width: | Height: | Size: 704 B |
Before Width: | Height: | Size: 717 B After Width: | Height: | Size: 717 B |
Before Width: | Height: | Size: 672 B After Width: | Height: | Size: 672 B |
Before Width: | Height: | Size: 659 B After Width: | Height: | Size: 659 B |
Before Width: | Height: | Size: 635 B After Width: | Height: | Size: 635 B |
Before Width: | Height: | Size: 676 B After Width: | Height: | Size: 676 B |
Before Width: | Height: | Size: 681 B After Width: | Height: | Size: 681 B |
Before Width: | Height: | Size: 726 B After Width: | Height: | Size: 726 B |
Before Width: | Height: | Size: 507 B After Width: | Height: | Size: 507 B |
Before Width: | Height: | Size: 195 B After Width: | Height: | Size: 195 B |
Before Width: | Height: | Size: 6.6 KiB After Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 6.1 KiB After Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 6.4 KiB After Width: | Height: | Size: 2.7 KiB |
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 348 B |
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 355 B |
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 296 B |
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 378 B |
|
@ -21,6 +21,7 @@
|
||||||
"DimensionTypeMixin",
|
"DimensionTypeMixin",
|
||||||
"RecipeManagerMixin",
|
"RecipeManagerMixin",
|
||||||
"AbstractBlockMixin",
|
"AbstractBlockMixin",
|
||||||
|
"HostileEntityMixin",
|
||||||
"LivingEntityMixin",
|
"LivingEntityMixin",
|
||||||
"BoneMealItemMixin",
|
"BoneMealItemMixin",
|
||||||
"SlimeEntityMixin",
|
"SlimeEntityMixin",
|
||||||
|
|