20w27a
This commit is contained in:
1 parent
150c1d41a7
commit
03061ba114
14 files changed
+60
-35
No files matched your search
@@ -15,6 +15,7 @@ public abstract class Entity_scarpetEventsMixin implements EntityInterface
|
||||
@Shadow public boolean removed;
|
||||
|
||||
@Shadow protected int netherPortalTime;
|
||||
@Shadow private int netherPortalCooldown;
|
||||
private boolean permanentVehicle;
|
||||
|
||||
private final EntityEventsGroup events = new EntityEventsGroup();
|
||||
@@ -37,6 +38,18 @@ public abstract class Entity_scarpetEventsMixin implements EntityInterface
|
||||
permanentVehicle = permanent;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getPublicNetherPortalCooldown()
|
||||
{
|
||||
return netherPortalCooldown;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPublicNetherPortalCooldown(int what)
|
||||
{
|
||||
netherPortalCooldown = what;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getPortalTimer()
|
||||
{
|
||||
|
||||
@@ -9,6 +9,7 @@ import net.minecraft.entity.mob.ElderGuardianEntity;
|
||||
import net.minecraft.entity.mob.GuardianEntity;
|
||||
import net.minecraft.entity.mob.HostileEntity;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.server.world.ServerWorld;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
@@ -20,15 +21,15 @@ public abstract class GuardianEntityMixin extends HostileEntity
|
||||
{
|
||||
super(entityType_1, world_1);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onStruckByLightning(LightningEntity lightning)
|
||||
public void onStruckByLightning(ServerWorld serverWorld, LightningEntity lightningEntity)
|
||||
{
|
||||
if (!this.world.isClient && !this.removed && CarpetSettings.renewableSponges && !((Object)this instanceof ElderGuardianEntity))
|
||||
{
|
||||
ElderGuardianEntity elderGuardian = new ElderGuardianEntity(EntityType.ELDER_GUARDIAN ,this.world);
|
||||
elderGuardian.refreshPositionAndAngles(this.getX(), this.getY(), this.getZ(), this.yaw, this.pitch);
|
||||
elderGuardian.initialize(this.world ,this.world.getLocalDifficulty(elderGuardian.getBlockPos()), SpawnReason.CONVERSION, (EntityData)null, (CompoundTag)null);
|
||||
elderGuardian.initialize(serverWorld ,this.world.getLocalDifficulty(elderGuardian.getBlockPos()), SpawnReason.CONVERSION, (EntityData)null, (CompoundTag)null);
|
||||
elderGuardian.setAiDisabled(this.isAiDisabled());
|
||||
|
||||
if (this.hasCustomName())
|
||||
@@ -42,7 +43,7 @@ public abstract class GuardianEntityMixin extends HostileEntity
|
||||
}
|
||||
else
|
||||
{
|
||||
super.onStruckByLightning(lightning);
|
||||
super.onStruckByLightning(serverWorld, lightningEntity);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
package carpet.mixins;
|
||||
|
||||
import carpet.CarpetSettings;
|
||||
import net.minecraft.class_5425;
|
||||
import net.minecraft.entity.mob.HuskEntity;
|
||||
import net.minecraft.server.world.ServerWorld;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
@@ -14,10 +15,10 @@ import org.spongepowered.asm.mixin.injection.Redirect;
|
||||
@Mixin(HuskEntity.class)
|
||||
public class HuskEntityMixin
|
||||
{
|
||||
@Redirect(method = "canSpawn", at = @At(value = "INVOKE", target="Lnet/minecraft/world/WorldAccess;isSkyVisible(Lnet/minecraft/util/math/BlockPos;)Z"))
|
||||
private static boolean isSkylightOrTempleVisible(WorldAccess WorldAccess, BlockPos blockPos_1)
|
||||
@Redirect(method = "canSpawn", at = @At(value = "INVOKE", target="Lnet/minecraft/class_5425;isSkyVisible(Lnet/minecraft/util/math/BlockPos;)Z"))
|
||||
private static boolean isSkylightOrTempleVisible(class_5425 class_5425, BlockPos pos)
|
||||
{
|
||||
return WorldAccess.isSkyVisible(blockPos_1) ||
|
||||
(CarpetSettings.huskSpawningInTemples && (((ServerWorld)WorldAccess).getStructureAccessor().method_28388(blockPos_1, false, StructureFeature.DESERT_PYRAMID).hasChildren()));
|
||||
return class_5425.isSkyVisible(pos) ||
|
||||
(CarpetSettings.huskSpawningInTemples && (((ServerWorld)class_5425).getStructureAccessor().method_28388(pos, false, StructureFeature.DESERT_PYRAMID).hasChildren()));
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,7 @@ import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.Blocks;
|
||||
import net.minecraft.block.InfestedBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.server.world.ServerWorld;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
@@ -23,11 +24,11 @@ public abstract class InfestedBlockMixin extends Block
|
||||
|
||||
@Inject(method = "spawnSilverfish", at = @At(value = "INVOKE", shift = At.Shift.AFTER,
|
||||
target = "Lnet/minecraft/entity/mob/SilverfishEntity;playSpawnEffects()V"))
|
||||
private void onOnStacksDropped(World world, BlockPos blockPos, CallbackInfo ci)
|
||||
private void onOnStacksDropped(ServerWorld serverWorld, BlockPos pos, CallbackInfo ci)
|
||||
{
|
||||
if (CarpetSettings.silverFishDropGravel)
|
||||
{
|
||||
dropStack(world, blockPos, new ItemStack(Blocks.GRAVEL));
|
||||
dropStack(serverWorld, pos, new ItemStack(Blocks.GRAVEL));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,7 @@ import carpet.utils.SpawnReporter;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.FenceGateBlock;
|
||||
import net.minecraft.class_5425;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.SpawnGroup;
|
||||
import net.minecraft.entity.EntityData;
|
||||
@@ -175,12 +176,12 @@ public class SpawnHelperMixin
|
||||
|
||||
@Redirect(method = "spawnEntitiesInChunk(Lnet/minecraft/entity/SpawnGroup;Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/world/chunk/Chunk;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/world/SpawnHelper$Checker;Lnet/minecraft/world/SpawnHelper$Runner;)V", at = @At(
|
||||
value = "INVOKE",
|
||||
target = "Lnet/minecraft/entity/mob/MobEntity;initialize(Lnet/minecraft/world/WorldAccess;Lnet/minecraft/world/LocalDifficulty;Lnet/minecraft/entity/SpawnReason;Lnet/minecraft/entity/EntityData;Lnet/minecraft/nbt/CompoundTag;)Lnet/minecraft/entity/EntityData;"
|
||||
target = "Lnet/minecraft/entity/mob/MobEntity;initialize(Lnet/minecraft/class_5425;Lnet/minecraft/world/LocalDifficulty;Lnet/minecraft/entity/SpawnReason;Lnet/minecraft/entity/EntityData;Lnet/minecraft/nbt/CompoundTag;)Lnet/minecraft/entity/EntityData;"
|
||||
))
|
||||
private static EntityData spawnEntity(MobEntity mobEntity, WorldAccess WorldAccess_1, LocalDifficulty localDifficulty_1, SpawnReason spawnType_1, EntityData entityData_1, CompoundTag compoundTag_1)
|
||||
private static EntityData spawnEntity(MobEntity mobEntity, class_5425 foo, LocalDifficulty localDifficulty_1, SpawnReason spawnType_1, EntityData entityData_1, CompoundTag compoundTag_1)
|
||||
{
|
||||
if (!SpawnReporter.mock_spawns)
|
||||
return mobEntity.initialize(WorldAccess_1, localDifficulty_1, spawnType_1, entityData_1, compoundTag_1);
|
||||
if (!SpawnReporter.mock_spawns) // WorldAccess
|
||||
return mobEntity.initialize(foo, localDifficulty_1, spawnType_1, entityData_1, compoundTag_1);
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ package carpet.mixins;
|
||||
|
||||
import carpet.CarpetSettings;
|
||||
import net.minecraft.block.entity.StructureBlockBlockEntity;
|
||||
import net.minecraft.class_5425;
|
||||
import net.minecraft.structure.Structure;
|
||||
import net.minecraft.structure.StructurePlacementData;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
@@ -17,9 +18,9 @@ public abstract class StructureBlockBlockEntity_fillUpdatesMixin
|
||||
{
|
||||
@Redirect(method = "place", at = @At(
|
||||
value = "INVOKE",
|
||||
target = "Lnet/minecraft/structure/Structure;place(Lnet/minecraft/world/WorldAccess;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/structure/StructurePlacementData;Ljava/util/Random;)V"
|
||||
target = "Lnet/minecraft/structure/Structure;place(Lnet/minecraft/class_5425;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/structure/StructurePlacementData;Ljava/util/Random;)V"
|
||||
))
|
||||
private void onStructurePlacen(Structure structure, WorldAccess world, BlockPos pos, StructurePlacementData placementData, Random random)
|
||||
private void onStructurePlacen(Structure structure, class_5425 world, BlockPos pos, StructurePlacementData placementData, Random random)
|
||||
{
|
||||
if(!CarpetSettings.fillUpdates)
|
||||
CarpetSettings.impendingFillSkipUpdates = true;
|
||||
|
||||
@@ -2,6 +2,7 @@ package carpet.mixins;
|
||||
|
||||
import carpet.CarpetSettings;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.class_5425;
|
||||
import net.minecraft.structure.Structure;
|
||||
import net.minecraft.structure.StructurePlacementData;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
@@ -13,17 +14,17 @@ import org.spongepowered.asm.mixin.injection.Redirect;
|
||||
@Mixin(Structure.class)
|
||||
public class Structure_fillUpdatesMixin
|
||||
{
|
||||
@Redirect( method = "place(Lnet/minecraft/world/WorldAccess;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/structure/StructurePlacementData;Ljava/util/Random;I)Z", at = @At(
|
||||
@Redirect( method = "place(Lnet/minecraft/class_5425;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/structure/StructurePlacementData;Ljava/util/Random;I)Z", at = @At(
|
||||
value = "INVOKE",
|
||||
target = "Lnet/minecraft/world/WorldAccess;updateNeighbors(Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/Block;)V"
|
||||
target = "Lnet/minecraft/class_5425;updateNeighbors(Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/Block;)V"
|
||||
))
|
||||
private void skipUpdateNeighbours(WorldAccess WorldAccess, BlockPos var1, Block var2)
|
||||
private void skipUpdateNeighbours(class_5425 class_5425, BlockPos pos, Block block)
|
||||
{
|
||||
if (!CarpetSettings.impendingFillSkipUpdates)
|
||||
WorldAccess.updateNeighbors(var1, var2);
|
||||
class_5425.updateNeighbors(pos, block);
|
||||
}
|
||||
|
||||
@Redirect(method = "place(Lnet/minecraft/world/WorldAccess;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/structure/StructurePlacementData;Ljava/util/Random;I)Z", at = @At(
|
||||
@Redirect(method = "place(Lnet/minecraft/class_5425;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/structure/StructurePlacementData;Ljava/util/Random;I)Z", at = @At(
|
||||
value = "INVOKE",
|
||||
target = "Lnet/minecraft/structure/StructurePlacementData;shouldUpdateNeighbors()Z"
|
||||
))
|
||||
|
||||
@@ -40,7 +40,7 @@ import java.util.stream.Collectors;
|
||||
@Mixin(VillagerEntity.class)
|
||||
public abstract class VillagerEntity_aiMixin extends AbstractTraderEntity
|
||||
{
|
||||
@Shadow protected abstract boolean hasSeenGolemRecently(long long_1);
|
||||
//@Shadow protected abstract boolean hasSeenGolemRecently(long long_1);
|
||||
|
||||
@Shadow protected abstract void sayNo();
|
||||
|
||||
@@ -62,14 +62,15 @@ public abstract class VillagerEntity_aiMixin extends AbstractTraderEntity
|
||||
if (MobAI.isTracking(this, MobAI.TrackingType.IRON_GOLEM_SPAWNING))
|
||||
{
|
||||
long time;
|
||||
Optional<Long> optional_1 = this.brain.getOptionalMemory(MemoryModuleType.GOLEM_LAST_SEEN_TIME);
|
||||
Optional<Boolean> optional_1 = this.brain.getOptionalMemory(MemoryModuleType.GOLEM_DETECTED_RECENTLY);
|
||||
if (!optional_1.isPresent()) {
|
||||
time = 0;
|
||||
} else {
|
||||
Long long_2 = optional_1.get();
|
||||
time = long_2+600 - getEntityWorld().getTime();
|
||||
//Long long_2 = optional_1.get(); #TODO fixme need last seen golem time.
|
||||
//time = long_2+600 - getEntityWorld().getTime();
|
||||
time = 600;
|
||||
}
|
||||
boolean recentlySeen = hasSeenGolemRecently(getEntityWorld().getTime());
|
||||
boolean recentlySeen = time > 0;
|
||||
Optional<Long> optional_11 = this.brain.getOptionalMemory(MemoryModuleType.LAST_SLEPT);
|
||||
//Optional<Timestamp> optional_22 = this.brain.getOptionalMemory(MemoryModuleType.LAST_WORKED_AT_POI);
|
||||
//boolean work = false;
|
||||
@@ -177,7 +178,7 @@ public abstract class VillagerEntity_aiMixin extends AbstractTraderEntity
|
||||
target = "Lnet/minecraft/util/math/Box;expand(DDD)Lnet/minecraft/util/math/Box;",
|
||||
shift = At.Shift.AFTER
|
||||
))
|
||||
private void particleIt(long long_1, int int_1, CallbackInfo ci)
|
||||
private void particleIt(ServerWorld serverWorld, long l, int i, CallbackInfo ci)
|
||||
{
|
||||
if (MobAI.isTracking(this, MobAI.TrackingType.IRON_GOLEM_SPAWNING))
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user