Update mappings to 20210215

This commit is contained in:
IzzelAliz 2021-02-16 01:12:08 +08:00
parent ab2ab51db6
commit 66530a65cd
48 changed files with 117 additions and 117 deletions

View File

@ -36,7 +36,7 @@ arclight {
sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8'
minecraft {
mappings channel: 'snapshot', version: "20201028-1.16.3"
mappings channel: 'snapshot', version: "20210215-1.16.3"
accessTransformer = project.file('src/main/resources/META-INF/accesstransformer.cfg')
}

View File

@ -83,7 +83,7 @@ public class CauldronBlockMixin {
@Inject(method = "fillWithRain", cancellable = true, at = @At(value = "INVOKE", target = "Lnet/minecraft/world/World;setBlockState(Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;I)Z"))
public void arclight$fillRain(World worldIn, BlockPos pos, CallbackInfo ci) {
BlockState state = worldIn.getBlockState(pos);
BlockState cycle = state.func_235896_a_(CauldronBlock.LEVEL);
BlockState cycle = state.cycleValue(CauldronBlock.LEVEL);
int newLevel = cycle.get(CauldronBlock.LEVEL);
if (!changeLevel(worldIn, pos, state, newLevel, null, CauldronLevelChangeEvent.ChangeReason.UNKNOWN)) {
ci.cancel();

View File

@ -19,7 +19,7 @@ public abstract class AgeableEntityMixin extends CreatureEntityMixin implements
// @formatter:off
@Shadow public abstract boolean isChild();
@Shadow @Nullable public abstract AgeableEntity func_241840_a(ServerWorld p_241840_1_, AgeableEntity p_241840_2_);
@Shadow @Nullable public abstract AgeableEntity createChild(ServerWorld world, AgeableEntity mate);
@Shadow public abstract void setGrowingAge(int age);
// @formatter:on

View File

@ -188,7 +188,7 @@ public abstract class EntityMixin implements InternalEntityBridge, EntityBridge,
@Shadow public abstract boolean canBePushed();
@Shadow protected abstract void setDead();
@Shadow protected abstract Optional<TeleportationRepositioner.Result> func_241830_a(ServerWorld p_241830_1_, BlockPos p_241830_2_, boolean p_241830_3_);
@Shadow protected BlockPos field_242271_ac;
@Shadow protected BlockPos entityBlockPosition;
@Shadow protected abstract Vector3d func_241839_a(Direction.Axis axis, TeleportationRepositioner.Result result);
@Shadow public abstract EntitySize getSize(Pose poseIn);
@Shadow protected abstract boolean func_233566_aG_();
@ -727,7 +727,7 @@ public abstract class EntityMixin implements InternalEntityBridge, EntityBridge,
// CraftBukkit end
}
@Redirect(method = "func_241841_a", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/Entity;setFire(I)V"))
@Redirect(method = "causeLightningStrike", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/Entity;setFire(I)V"))
public void arclight$onStruckByLightning$EntityCombustByEntityEvent0(Entity entity, int seconds) {
final org.bukkit.entity.Entity thisBukkitEntity = this.getBukkitEntity();
final org.bukkit.entity.Entity stormBukkitEntity = ((EntityBridge) entity).bridge$getBukkitEntity();
@ -741,7 +741,7 @@ public abstract class EntityMixin implements InternalEntityBridge, EntityBridge,
// CraftBukkit end
}
@Redirect(method = "func_241841_a", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/Entity;attackEntityFrom(Lnet/minecraft/util/DamageSource;F)Z"))
@Redirect(method = "causeLightningStrike", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/Entity;attackEntityFrom(Lnet/minecraft/util/DamageSource;F)Z"))
public boolean arclight$onStruckByLightning$EntityCombustByEntityEvent1(Entity entity, DamageSource source, float amount) {
final org.bukkit.entity.Entity thisBukkitEntity = this.getBukkitEntity();
final org.bukkit.entity.Entity stormBukkitEntity = ((EntityBridge) entity).bridge$getBukkitEntity();
@ -827,7 +827,7 @@ public abstract class EntityMixin implements InternalEntityBridge, EntityBridge,
world.addFromAnotherDimension(entity);
if (((WorldBridge) world).bridge$getTypeKey() == DimensionType.THE_END) {
ArclightCaptures.captureEndPortalEntity((Entity) (Object) this, spawnPortal);
ServerWorld.func_241121_a_(world);
ServerWorld.setupEndSpawnPlatform(world);
}
}
return entity;
@ -886,14 +886,14 @@ public abstract class EntityMixin implements InternalEntityBridge, EntityBridge,
ServerWorld worldFinal = world = ((CraftWorld) event.getTo().getWorld()).getHandle();
blockpos1 = new BlockPos(event.getTo().getX(), event.getTo().getY(), event.getTo().getZ());
return this.findOrCreatePortal(world, blockpos1, flag2, event.getSearchRadius(), event.getCanCreatePortal(), event.getCreationRadius()).map((p_242275_2_) -> {
BlockState blockstate = this.world.getBlockState(this.field_242271_ac);
return this.findOrCreatePortal(world, blockpos1, flag2, event.getSearchRadius(), event.getCanCreatePortal(), event.getCreationRadius()).map((result) -> {
BlockState blockstate = this.world.getBlockState(this.entityBlockPosition);
Direction.Axis direction$axis;
Vector3d vector3d;
if (blockstate.hasProperty(BlockStateProperties.HORIZONTAL_AXIS)) {
direction$axis = blockstate.get(BlockStateProperties.HORIZONTAL_AXIS);
TeleportationRepositioner.Result teleportationrepositioner$result = TeleportationRepositioner.findLargestRectangle(this.field_242271_ac, direction$axis, 21, Direction.Axis.Y, 21, (p_242276_2_) -> {
return this.world.getBlockState(p_242276_2_) == blockstate;
TeleportationRepositioner.Result teleportationrepositioner$result = TeleportationRepositioner.findLargestRectangle(this.entityBlockPosition, direction$axis, 21, Direction.Axis.Y, 21, (pos) -> {
return this.world.getBlockState(pos) == blockstate;
});
vector3d = this.func_241839_a(direction$axis, teleportationrepositioner$result);
} else {
@ -902,13 +902,13 @@ public abstract class EntityMixin implements InternalEntityBridge, EntityBridge,
}
ArclightCaptures.captureCraftPortalEvent(event);
return PortalSize.func_242963_a(worldFinal, p_242275_2_, direction$axis, vector3d, this.getSize(this.getPose()), this.getMotion(), this.rotationYaw, this.rotationPitch);
return PortalSize.func_242963_a(worldFinal, result, direction$axis, vector3d, this.getSize(this.getPose()), this.getMotion(), this.rotationYaw, this.rotationPitch);
}).orElse(null);
}
} else {
BlockPos blockpos;
if (flag1) {
blockpos = ServerWorld.field_241108_a_;
blockpos = ServerWorld.END_SPAWN_AREA;
} else {
blockpos = world.getHeight(Heightmap.Type.MOTION_BLOCKING_NO_LEAVES, world.getSpawnPoint());
}

View File

@ -26,7 +26,7 @@ public interface IAngerableMixin extends MobEntityBridge {
* @reason
*/
@Overwrite
default void func_241356_K__() {
default void resetTargets() {
this.setRevengeTarget(null);
this.setAngerTarget(null);
this.bridge$pushGoalTargetReason(EntityTargetEvent.TargetReason.FORGOT_TARGET, true);

View File

@ -568,7 +568,7 @@ public abstract class LivingEntityMixin extends EntityMixin implements LivingEnt
if ((Object) this instanceof AnimalEntity) {
((AnimalEntity) (Object) this).resetInLove();
if ((Object) this instanceof TameableEntity) {
((TameableEntity) (Object) this).func_233687_w_(false);
((TameableEntity) (Object) this).setSitting(false);
}
}

View File

@ -257,7 +257,7 @@ public abstract class MobEntityMixin extends LivingEntityMixin implements MobEnt
}
}
@Inject(method = "func_233661_c_", cancellable = true, at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/MobEntity;setLeashHolder(Lnet/minecraft/entity/Entity;Z)V"))
@Inject(method = "processInteract", cancellable = true, at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/MobEntity;setLeashHolder(Lnet/minecraft/entity/Entity;Z)V"))
private void arclight$leash(PlayerEntity player, Hand hand, CallbackInfoReturnable<ActionResultType> cir) {
if (CraftEventFactory.callPlayerLeashEntityEvent((MobEntity) (Object) this, player, player).isCancelled()) {
((ServerPlayerEntity) player).connection.sendPacket(new SMountEntityPacket((MobEntity) (Object) this, this.getLeashHolder()));

View File

@ -14,9 +14,9 @@ import org.spongepowered.asm.mixin.injection.Redirect;
@Mixin(CreateBabyVillagerTask.class)
public class CreateBabyVillagerTaskMixin {
@Redirect(method = "createChild", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/merchant/villager/VillagerEntity;func_241840_a(Lnet/minecraft/world/server/ServerWorld;Lnet/minecraft/entity/AgeableEntity;)Lnet/minecraft/entity/merchant/villager/VillagerEntity;"))
@Redirect(method = "createChild", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/merchant/villager/VillagerEntity;createChild(Lnet/minecraft/world/server/ServerWorld;Lnet/minecraft/entity/AgeableEntity;)Lnet/minecraft/entity/merchant/villager/VillagerEntity;"))
private VillagerEntity arclight$entityBreed(VillagerEntity lona, ServerWorld world, AgeableEntity anonymous) {
VillagerEntity child = lona.func_241840_a(world, anonymous);
VillagerEntity child = lona.createChild(world, anonymous);
if (child != null && !CraftEventFactory.callEntityBreedEvent(child, lona, anonymous, null, null, 0).isCancelled()) {
((WorldBridge) world).bridge$pushAddEntityReason(CreatureSpawnEvent.SpawnReason.BREEDING);
return child;

View File

@ -36,9 +36,9 @@ public abstract class InteractWithDoorTaskMixin {
@Overwrite
protected void startExecuting(ServerWorld worldIn, LivingEntity entityIn, long gameTimeIn) {
Path path = entityIn.getBrain().getMemory(MemoryModuleType.PATH).get();
this.field_242292_b = path.func_237225_h_();
this.field_242292_b = path.getCurrentPoint();
PathPoint pathpoint = path.func_242950_i();
PathPoint pathpoint1 = path.func_237225_h_();
PathPoint pathpoint1 = path.getCurrentPoint();
BlockPos blockpos = pathpoint.func_224759_a();
BlockState blockstate = worldIn.getBlockState(blockpos);
if (blockstate.isIn(BlockTags.WOODEN_DOORS)) {

View File

@ -107,7 +107,7 @@ public abstract class EnderDragonEntityMixin extends MobEntityMixin {
final net.minecraft.block.Block nmsBlock = craftBlock.getNMS().getBlock();
if (nmsBlock.canDropFromExplosion(this.explosionSource)) {
TileEntity tileentity = nmsBlock.hasTileEntity(craftBlock.getNMS()) ? this.world.getTileEntity(blockposition2) : null;
LootContext.Builder loottableinfo_builder = new LootContext.Builder((ServerWorld)this.world).withRandom(this.world.rand).withParameter(LootParameters.field_237457_g_, Vector3d.copyCentered(blockposition2)).withParameter(LootParameters.TOOL, ItemStack.EMPTY).withParameter(LootParameters.EXPLOSION_RADIUS, 1.0f / event.getYield()).withNullableParameter(LootParameters.BLOCK_ENTITY, tileentity);
LootContext.Builder loottableinfo_builder = new LootContext.Builder((ServerWorld)this.world).withRandom(this.world.rand).withParameter(LootParameters.ORIGIN, Vector3d.copyCentered(blockposition2)).withParameter(LootParameters.TOOL, ItemStack.EMPTY).withParameter(LootParameters.EXPLOSION_RADIUS, 1.0f / event.getYield()).withNullableParameter(LootParameters.BLOCK_ENTITY, tileentity);
for (ItemStack stack : craftBlock.getNMS().getDrops(loottableinfo_builder)) {
Block.spawnAsEntity(this.world, blockposition2, stack);
}

View File

@ -19,12 +19,12 @@ public abstract class LightningBoltEntityMixin extends EntityMixin {
public boolean isSilent = false;
@Inject(method = "tick", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/Entity;func_241841_a(Lnet/minecraft/world/server/ServerWorld;Lnet/minecraft/entity/effect/LightningBoltEntity;)V"))
@Inject(method = "tick", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/Entity;causeLightningStrike(Lnet/minecraft/world/server/ServerWorld;Lnet/minecraft/entity/effect/LightningBoltEntity;)V"))
private void arclight$captureEntity(CallbackInfo ci) {
ArclightCaptures.captureDamageEventEntity((Entity) (Object) this);
}
@Inject(method = "tick", at = @At(value = "INVOKE", shift = At.Shift.AFTER, target = "Lnet/minecraft/entity/Entity;func_241841_a(Lnet/minecraft/world/server/ServerWorld;Lnet/minecraft/entity/effect/LightningBoltEntity;)V"))
@Inject(method = "tick", at = @At(value = "INVOKE", shift = At.Shift.AFTER, target = "Lnet/minecraft/entity/Entity;causeLightningStrike(Lnet/minecraft/world/server/ServerWorld;Lnet/minecraft/entity/effect/LightningBoltEntity;)V"))
private void arclight$resetEntity(CallbackInfo ci) {
ArclightCaptures.captureDamageEventEntity(null);
}

View File

@ -40,7 +40,7 @@ public abstract class VillagerEntityMixin extends AbstractVillagerEntityMixin {
}
}
@Inject(method = "func_241841_a", cancellable = true, locals = LocalCapture.CAPTURE_FAILHARD, at = @At(value = "INVOKE", target = "Lnet/minecraft/world/server/ServerWorld;func_242417_l(Lnet/minecraft/entity/Entity;)V"))
@Inject(method = "causeLightningStrike", cancellable = true, locals = LocalCapture.CAPTURE_FAILHARD, at = @At(value = "INVOKE", target = "Lnet/minecraft/world/server/ServerWorld;func_242417_l(Lnet/minecraft/entity/Entity;)V"))
private void arclight$transformWitch(ServerWorld serverWorld, LightningBoltEntity lightningBolt, CallbackInfo ci, WitchEntity witchEntity) {
if (CraftEventFactory.callEntityTransformEvent((VillagerEntity) (Object) this, witchEntity, EntityTransformEvent.TransformReason.LIGHTNING).isCancelled()) {
ci.cancel();

View File

@ -37,7 +37,7 @@ public abstract class CreeperEntityMixin extends CreatureEntityMixin implements
@Shadow private int timeSinceIgnited;
// @formatter:on
@Inject(method = "func_241841_a", cancellable = true, at = @At(value = "FIELD", target = "Lnet/minecraft/entity/monster/CreeperEntity;dataManager:Lnet/minecraft/network/datasync/EntityDataManager;"))
@Inject(method = "causeLightningStrike", cancellable = true, at = @At(value = "FIELD", target = "Lnet/minecraft/entity/monster/CreeperEntity;dataManager:Lnet/minecraft/network/datasync/EntityDataManager;"))
private void arclight$lightningBolt(ServerWorld world, LightningBoltEntity lightningBolt, CallbackInfo ci) {
if (CraftEventFactory.callCreeperPowerEvent((CreeperEntity) (Object) this, lightningBolt, CreeperPowerEvent.PowerCause.LIGHTNING).isCancelled()) {
ci.cancel();

View File

@ -66,7 +66,7 @@ public abstract class ZombieEntityMixin extends CreatureEntityMixin {
}
}
@Eject(method = "func_241847_a", at = @At(value = "INVOKE", remap = false, target = "Lnet/minecraft/entity/merchant/villager/VillagerEntity;func_233656_b_(Lnet/minecraft/entity/EntityType;Z)Lnet/minecraft/entity/MobEntity;"))
@Eject(method = "onKillEntity", at = @At(value = "INVOKE", remap = false, target = "Lnet/minecraft/entity/merchant/villager/VillagerEntity;func_233656_b_(Lnet/minecraft/entity/EntityType;Z)Lnet/minecraft/entity/MobEntity;"))
private <T extends MobEntity> T arclight$transform(VillagerEntity villagerEntity, EntityType<T> entityType, boolean flag, CallbackInfo ci) {
T t = this.a(entityType, flag, EntityTransformEvent.TransformReason.INFECTION, CreatureSpawnEvent.SpawnReason.INFECTION);
if (t == null) {

View File

@ -35,7 +35,7 @@ import javax.annotation.Nullable;
public abstract class AnimalEntityMixin extends AgeableEntityMixin implements AnimalEntityBridge {
// @formatter:off
@Shadow public ActionResultType func_230254_b_(PlayerEntity p_230254_1_, Hand p_230254_2_) { return null; }
@Shadow public ActionResultType getEntityInteractionResult(PlayerEntity playerIn, Hand hand) { return null; }
@Shadow public int inLove;
@Shadow public abstract void resetInLove();
@Shadow @Nullable public abstract ServerPlayerEntity getLoveCause();
@ -82,8 +82,8 @@ public abstract class AnimalEntityMixin extends AgeableEntityMixin implements An
* @reason
*/
@Overwrite
public void func_234177_a_(ServerWorld world, AnimalEntity animalEntity) {
AgeableEntity child = this.func_241840_a(world, animalEntity);
public void spawnBabyAnimal(ServerWorld world, AnimalEntity animalEntity) {
AgeableEntity child = this.createChild(world, animalEntity);
final BabyEntitySpawnEvent event = new BabyEntitySpawnEvent((AnimalEntity) (Object) this, animalEntity, child);
final boolean cancelled = MinecraftForge.EVENT_BUS.post(event);
child = event.getChild();

View File

@ -22,7 +22,7 @@ public abstract class CowEntityMixin extends AnimalEntityMixin {
* @reason
*/
@Overwrite
public ActionResultType func_230254_b_(PlayerEntity playerEntity, Hand hand) {
public ActionResultType getEntityInteractionResult(PlayerEntity playerEntity, Hand hand) {
ItemStack itemstack = playerEntity.getHeldItem(hand);
if (itemstack.getItem() == Items.BUCKET && !this.isChild()) {
playerEntity.playSound(SoundEvents.ENTITY_COW_MILK, 1.0F, 1.0F);
@ -35,7 +35,7 @@ public abstract class CowEntityMixin extends AnimalEntityMixin {
playerEntity.setHeldItem(hand, itemstack1);
return ActionResultType.func_233537_a_(this.world.isRemote);
} else {
return super.func_230254_b_(playerEntity, hand);
return super.getEntityInteractionResult(playerEntity, hand);
}
}
}

View File

@ -32,7 +32,7 @@ public abstract class FoxEntity_MateGoalMixin extends BreedGoal {
@Overwrite
protected void spawnBaby() {
ServerWorld serverworld = (ServerWorld) this.world;
FoxEntity foxentity = (FoxEntity) this.animal.func_241840_a(serverworld, this.targetMate);
FoxEntity foxentity = (FoxEntity) this.animal.createChild(serverworld, this.targetMate);
final BabyEntitySpawnEvent event = new BabyEntitySpawnEvent(animal, targetMate, foxentity);
final boolean cancelled = MinecraftForge.EVENT_BUS.post(event);
foxentity = (FoxEntity) event.getChild();

View File

@ -14,8 +14,8 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
@Mixin(ParrotEntity.class)
public abstract class ParrotEntityMixin extends AnimalEntityMixin {
@Inject(method = "func_230254_b_", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/passive/ParrotEntity;addPotionEffect(Lnet/minecraft/potion/EffectInstance;)Z"))
private void arclight$feed(PlayerEntity p_230254_1_, Hand p_230254_2_, CallbackInfoReturnable<ActionResultType> cir) {
@Inject(method = "getEntityInteractionResult", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/passive/ParrotEntity;addPotionEffect(Lnet/minecraft/potion/EffectInstance;)Z"))
private void arclight$feed(PlayerEntity playerIn, Hand hand, CallbackInfoReturnable<ActionResultType> cir) {
bridge$pushEffectCause(EntityPotionEffectEvent.Cause.FOOD);
}

View File

@ -16,9 +16,9 @@ import org.spongepowered.asm.mixin.injection.callback.LocalCapture;
@Mixin(PigEntity.class)
public abstract class PigEntityMixin extends AnimalEntityMixin {
@Inject(method = "func_241841_a", cancellable = true, locals = LocalCapture.CAPTURE_FAILHARD,
@Inject(method = "causeLightningStrike", cancellable = true, locals = LocalCapture.CAPTURE_FAILHARD,
at = @At(value = "INVOKE", target = "Lnet/minecraft/world/server/ServerWorld;addEntity(Lnet/minecraft/entity/Entity;)Z"))
private void arclight$pigZap(ServerWorld p_241841_1_, LightningBoltEntity lightningBolt, CallbackInfo ci, ZombifiedPiglinEntity piglin) {
private void arclight$pigZap(ServerWorld world, LightningBoltEntity lightningBolt, CallbackInfo ci, ZombifiedPiglinEntity piglin) {
if (CraftEventFactory.callPigZapEvent((PigEntity) (Object) this, lightningBolt, piglin).isCancelled()) {
ci.cancel();
} else {

View File

@ -32,13 +32,13 @@ public abstract class TurtleEntityMixin extends AnimalEntityMixin implements Tur
forceDrops = false;
}
@Inject(method = "func_241841_a", at = @At("HEAD"))
private void arclight$lightning(ServerWorld p_241841_1_, LightningBoltEntity lightningBolt, CallbackInfo ci) {
@Inject(method = "causeLightningStrike", at = @At("HEAD"))
private void arclight$lightning(ServerWorld world, LightningBoltEntity lightningBolt, CallbackInfo ci) {
CraftEventFactory.entityDamage = lightningBolt;
}
@Inject(method = "func_241841_a", at = @At("RETURN"))
private void arclight$lightningReset(ServerWorld p_241841_1_, LightningBoltEntity lightningBolt, CallbackInfo ci) {
@Inject(method = "causeLightningStrike", at = @At("RETURN"))
private void arclight$lightningReset(ServerWorld world, LightningBoltEntity lightningBolt, CallbackInfo ci) {
CraftEventFactory.entityDamage = null;
}
}

View File

@ -16,7 +16,7 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
@Mixin(WolfEntity.class)
public abstract class WolfEntityMixin extends TameableEntityMixin {
@Redirect(method = "attackEntityFrom", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/passive/WolfEntity;func_233687_w_(Z)V"))
@Redirect(method = "attackEntityFrom", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/passive/WolfEntity;setSitting(Z)V"))
private void arclight$handledBy(WolfEntity wolfEntity, boolean p_233687_1_) {
}
@ -27,12 +27,12 @@ public abstract class WolfEntityMixin extends TameableEntityMixin {
}
}
@Inject(method = "func_230254_b_", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/passive/WolfEntity;heal(F)V"))
@Inject(method = "getEntityInteractionResult", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/passive/WolfEntity;heal(F)V"))
private void arclight$healReason(PlayerEntity player, Hand hand, CallbackInfoReturnable<ActionResultType> cir) {
bridge$pushHealReason(EntityRegainHealthEvent.RegainReason.EATING);
}
@Inject(method = "func_230254_b_", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/passive/WolfEntity;setAttackTarget(Lnet/minecraft/entity/LivingEntity;)V"))
@Inject(method = "getEntityInteractionResult", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/passive/WolfEntity;setAttackTarget(Lnet/minecraft/entity/LivingEntity;)V"))
private void arclight$attackReason(PlayerEntity player, Hand hand, CallbackInfoReturnable<ActionResultType> cir) {
bridge$pushGoalTargetReason(EntityTargetEvent.TargetReason.FORGOT_TARGET, true);
}

View File

@ -205,7 +205,7 @@ public abstract class ServerPlayerEntityMixin extends PlayerEntityMixin implemen
public final BlockPos getSpawnPoint(ServerWorld worldserver) {
BlockPos blockposition = worldserver.getSpawnPoint();
if (worldserver.getDimensionType().hasSkyLight() && worldserver.field_241103_E_.getGameType() != GameType.ADVENTURE) {
if (worldserver.getDimensionType().hasSkyLight() && worldserver.serverWorldInfo.getGameType() != GameType.ADVENTURE) {
long k;
long l;
int i = Math.max(0, this.server.getSpawnRadius(worldserver));
@ -480,14 +480,14 @@ public abstract class ServerPlayerEntityMixin extends PlayerEntityMixin implemen
this.getServerWorld().removePlayer((ServerPlayerEntity) (Object) this, true); //Forge: The player entity is cloned so keep the data until after cloning calls copyFrom
if (!this.queuedEndExit) {
this.queuedEndExit = true;
this.connection.sendPacket(new SChangeGameStatePacket(SChangeGameStatePacket.field_241768_e_, this.seenCredits ? 0.0F : 1.0F));
this.connection.sendPacket(new SChangeGameStatePacket(SChangeGameStatePacket.PERFORM_RESPAWN, this.seenCredits ? 0.0F : 1.0F));
this.seenCredits = true;
}
return (ServerPlayerEntity) (Object) this;
} else {
IWorldInfo iworldinfo = server.getWorldInfo();
this.connection.sendPacket(new SRespawnPacket(server.getDimensionType(), server.getDimensionKey(), BiomeManager.getHashedSeed(server.getSeed()), this.interactionManager.getGameType(), this.interactionManager.func_241815_c_(), server.isDebug(), server.func_241109_A_(), true));
this.connection.sendPacket(new SRespawnPacket(server.getDimensionType(), server.getDimensionKey(), BiomeManager.getHashedSeed(server.getSeed()), this.interactionManager.getGameType(), this.interactionManager.func_241815_c_(), server.isDebug(), server.isFlatWorld(), true));
this.connection.sendPacket(new SServerDifficultyPacket(iworldinfo.getDifficulty(), iworldinfo.isDifficultyLocked()));
PlayerList playerlist = this.server.getPlayerList();
playerlist.updatePermissionLevel((ServerPlayerEntity) (Object) this);
@ -525,7 +525,7 @@ public abstract class ServerPlayerEntityMixin extends PlayerEntityMixin implemen
if (newWorld != exitWorld[0]) {
exitWorld[0] = newWorld;
IWorldInfo newWorldInfo = exitWorld[0].getWorldInfo();
this.connection.sendPacket(new SRespawnPacket(exitWorld[0].getDimensionType(), exitWorld[0].getDimensionKey(), BiomeManager.getHashedSeed(exitWorld[0].getSeed()), this.interactionManager.getGameType(), this.interactionManager.func_241815_c_(), exitWorld[0].isDebug(), exitWorld[0].func_241109_A_(), true));
this.connection.sendPacket(new SRespawnPacket(exitWorld[0].getDimensionType(), exitWorld[0].getDimensionKey(), BiomeManager.getHashedSeed(exitWorld[0].getSeed()), this.interactionManager.getGameType(), this.interactionManager.func_241815_c_(), exitWorld[0].isDebug(), exitWorld[0].isFlatWorld(), true));
this.connection.sendPacket(new SServerDifficultyPacket(newWorldInfo.getDifficulty(), newWorldInfo.isDifficultyLocked()));
}
@ -586,7 +586,7 @@ public abstract class ServerPlayerEntityMixin extends PlayerEntityMixin implemen
if (optional.isPresent() || !canCreatePortal) {
return optional;
}
Direction.Axis enumdirection_enumaxis = this.world.getBlockState(this.field_242271_ac).func_235903_d_(NetherPortalBlock.AXIS).orElse(Direction.Axis.X);
Direction.Axis enumdirection_enumaxis = this.world.getBlockState(this.entityBlockPosition).func_235903_d_(NetherPortalBlock.AXIS).orElse(Direction.Axis.X);
Optional<TeleportationRepositioner.Result> optional1 = ((TeleporterBridge) worldserver.getDefaultTeleporter()).bridge$createPortal(blockposition, enumdirection_enumaxis, (ServerPlayerEntity) (Object) this, createRadius);
if (!optional1.isPresent()) {
LOGGER.error("Unable to create a portal, likely target out of worldborder");
@ -843,25 +843,25 @@ public abstract class ServerPlayerEntityMixin extends PlayerEntityMixin implemen
this.weather = type;
}
if (type == WeatherType.DOWNFALL) {
this.connection.sendPacket(new SChangeGameStatePacket(SChangeGameStatePacket.field_241766_c_, 0.0f));
this.connection.sendPacket(new SChangeGameStatePacket(SChangeGameStatePacket.CLEAR, 0.0f));
} else {
this.connection.sendPacket(new SChangeGameStatePacket(SChangeGameStatePacket.field_241765_b_, 0.0f));
this.connection.sendPacket(new SChangeGameStatePacket(SChangeGameStatePacket.RAINING, 0.0f));
}
}
public void updateWeather(float oldRain, float newRain, float oldThunder, float newThunder) {
if (this.weather == null) {
if (oldRain != newRain) {
this.connection.sendPacket(new SChangeGameStatePacket(SChangeGameStatePacket.field_241771_h_, newRain));
this.connection.sendPacket(new SChangeGameStatePacket(SChangeGameStatePacket.SET_RAIN_STRENGTH, newRain));
}
} else if (this.pluginRainPositionPrevious != this.pluginRainPosition) {
this.connection.sendPacket(new SChangeGameStatePacket(SChangeGameStatePacket.field_241771_h_, this.pluginRainPosition));
this.connection.sendPacket(new SChangeGameStatePacket(SChangeGameStatePacket.SET_RAIN_STRENGTH, this.pluginRainPosition));
}
if (oldThunder != newThunder) {
if (this.weather == WeatherType.DOWNFALL || this.weather == null) {
this.connection.sendPacket(new SChangeGameStatePacket(SChangeGameStatePacket.field_241772_i_, newThunder));
this.connection.sendPacket(new SChangeGameStatePacket(SChangeGameStatePacket.SET_THUNDER_STRENGTH, newThunder));
} else {
this.connection.sendPacket(new SChangeGameStatePacket(SChangeGameStatePacket.field_241772_i_, 0.0f));
this.connection.sendPacket(new SChangeGameStatePacket(SChangeGameStatePacket.SET_THUNDER_STRENGTH, 0.0f));
}
}
}

View File

@ -61,7 +61,7 @@ public abstract class AbstractArrowEntityMixin extends ProjectileEntityMixin {
}
itemstack = item.getItem();
}
boolean flag = this.pickupStatus == AbstractArrowEntity.PickupStatus.ALLOWED || (this.pickupStatus == AbstractArrowEntity.PickupStatus.CREATIVE_ONLY && playerEntity.abilities.isCreativeMode) || (this.getNoClip() && this.func_234616_v_().getUniqueID() == playerEntity.getUniqueID());
boolean flag = this.pickupStatus == AbstractArrowEntity.PickupStatus.ALLOWED || (this.pickupStatus == AbstractArrowEntity.PickupStatus.CREATIVE_ONLY && playerEntity.abilities.isCreativeMode) || (this.getNoClip() && this.getShooter().getUniqueID() == playerEntity.getUniqueID());
if (this.pickupStatus == AbstractArrowEntity.PickupStatus.ALLOWED && !playerEntity.inventory.addItemStackToInventory(itemstack)) {
flag = false;
}

View File

@ -36,7 +36,7 @@ public abstract class EggEntityMixin extends ThrowableEntityMixin {
b0 = 0;
}
org.bukkit.entity.EntityType hatchingType = org.bukkit.entity.EntityType.CHICKEN;
Entity shooter = this.func_234616_v_();
Entity shooter = this.getShooter();
if (shooter instanceof ServerPlayerEntity) {
PlayerEggThrowEvent event = new PlayerEggThrowEvent(((ServerPlayerEntityBridge) shooter).bridge$getBukkitEntity(), (Egg) this.getBukkitEntity(), hatching, b0, hatchingType);
Bukkit.getPluginManager().callEvent(event);

View File

@ -82,8 +82,8 @@ public abstract class FishingBobberEntityMixin extends ProjectileEntityMixin {
this.world.setEntityState((FishingBobberEntity) (Object)this, (byte) 31);
i = this.caughtEntity instanceof ItemEntity ? 3 : 5;
} else if (this.ticksCatchable > 0) {
LootContext.Builder lootcontext$builder = (new LootContext.Builder((ServerWorld) this.world)).withParameter(LootParameters.field_237457_g_, this.getPositionVec()).withParameter(LootParameters.TOOL, p_146034_1_).withParameter(LootParameters.THIS_ENTITY, (FishingBobberEntity) (Object) this).withRandom(this.rand).withLuck((float) this.luck + playerentity.getLuck());
lootcontext$builder.withParameter(LootParameters.KILLER_ENTITY, this.func_234616_v_()).withParameter(LootParameters.THIS_ENTITY, (FishingBobberEntity) (Object) this);
LootContext.Builder lootcontext$builder = (new LootContext.Builder((ServerWorld) this.world)).withParameter(LootParameters.ORIGIN, this.getPositionVec()).withParameter(LootParameters.TOOL, p_146034_1_).withParameter(LootParameters.THIS_ENTITY, (FishingBobberEntity) (Object) this).withRandom(this.rand).withLuck((float) this.luck + playerentity.getLuck());
lootcontext$builder.withParameter(LootParameters.KILLER_ENTITY, this.getShooter()).withParameter(LootParameters.THIS_ENTITY, (FishingBobberEntity) (Object) this);
LootTable loottable = this.world.getServer().getLootTableManager().getLootTableFromLocation(LootTables.GAMEPLAY_FISHING);
List<ItemStack> list = loottable.generate(lootcontext$builder.build(LootParameterSets.FISHING));
event = new ItemFishedEvent(list, this.onGround ? 2 : 1, (FishingBobberEntity) (Object) this);

View File

@ -77,7 +77,7 @@ public abstract class PotionEntityMixin extends ProjectileItemEntityMixin {
double d2 = event.getIntensity(victim);
for (EffectInstance mobeffect : list) {
Effect mobeffectlist = mobeffect.getPotion();
if (!((WorldBridge) this.world).bridge$isPvpMode() && this.func_234616_v_() instanceof ServerPlayerEntity && entityliving2 instanceof ServerPlayerEntity && entityliving2 != this.func_234616_v_()) {
if (!((WorldBridge) this.world).bridge$isPvpMode() && this.getShooter() instanceof ServerPlayerEntity && entityliving2 instanceof ServerPlayerEntity && entityliving2 != this.getShooter()) {
int i = Effect.getId(mobeffectlist);
if (i == 2 || i == 4 || i == 7 || i == 15 || i == 17 || i == 18) {
continue;
@ -87,7 +87,7 @@ public abstract class PotionEntityMixin extends ProjectileItemEntityMixin {
}
}
if (mobeffectlist.isInstant()) {
mobeffectlist.affectEntity((PotionEntity) (Object) this, this.func_234616_v_(), entityliving2, mobeffect.getAmplifier(), d2);
mobeffectlist.affectEntity((PotionEntity) (Object) this, this.getShooter(), entityliving2, mobeffect.getAmplifier(), d2);
} else {
int i = (int) (d2 * mobeffect.getDuration() + 0.5);
if (i <= 20) {

View File

@ -20,7 +20,7 @@ import javax.annotation.Nullable;
public abstract class ProjectileEntityMixin extends EntityMixin {
// @formatter:off
@Shadow @Nullable public abstract Entity func_234616_v_();
@Shadow @Nullable public abstract Entity getShooter();
@Shadow protected void onImpact(RayTraceResult result) { }
// @formatter:on

View File

@ -24,7 +24,7 @@ public abstract class SmallFireballEntityMixin extends AbstractFireballEntityMix
@Inject(method = "<init>(Lnet/minecraft/world/World;Lnet/minecraft/entity/LivingEntity;DDD)V", at = @At("RETURN"))
private void arclight$init(World worldIn, LivingEntity shooter, double accelX, double accelY, double accelZ, CallbackInfo ci) {
if (this.func_234616_v_() != null && this.func_234616_v_() instanceof MobEntity) {
if (this.getShooter() != null && this.getShooter() instanceof MobEntity) {
this.isIncendiary = this.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING);
}
}

View File

@ -21,7 +21,7 @@ public abstract class WitherSkullEntityMixin extends DamagingProjectileEntityMix
@Inject(method = "onEntityHit", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/LivingEntity;heal(F)V"))
private void arclight$heal(EntityRayTraceResult result, CallbackInfo ci) {
((LivingEntityBridge) this.func_234616_v_()).bridge$pushHealReason(EntityRegainHealthEvent.RegainReason.WITHER);
((LivingEntityBridge) this.getShooter()).bridge$pushHealReason(EntityRegainHealthEvent.RegainReason.WITHER);
}
@Inject(method = "onEntityHit", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/LivingEntity;addPotionEffect(Lnet/minecraft/potion/EffectInstance;)Z"))

View File

@ -63,7 +63,7 @@ public abstract class BowItemMixin extends ShootableItem {
ArrowItem arrowitem = (ArrowItem) (itemstack.getItem() instanceof ArrowItem ? itemstack.getItem() : Items.ARROW);
AbstractArrowEntity abstractarrowentity = arrowitem.createArrow(worldIn, itemstack, playerentity);
abstractarrowentity = customArrow(abstractarrowentity);
abstractarrowentity.func_234612_a_(playerentity, playerentity.rotationPitch, playerentity.rotationYaw, 0.0F, f * 3.0F, 1.0F);
abstractarrowentity.setDirectionAndMovement(playerentity, playerentity.rotationPitch, playerentity.rotationYaw, 0.0F, f * 3.0F, 1.0F);
if (f == 1.0F) {
abstractarrowentity.setIsCritical(true);
}
@ -89,8 +89,8 @@ public abstract class BowItemMixin extends ShootableItem {
}
flag1 = !event.shouldConsumeItem();
stack.damageItem(1, playerentity, (p_220009_1_) -> {
p_220009_1_.sendBreakAnimation(playerentity.getActiveHand());
stack.damageItem(1, playerentity, (player) -> {
player.sendBreakAnimation(playerentity.getActiveHand());
});
if (flag1 || playerentity.abilities.isCreativeMode && (itemstack.getItem() == Items.SPECTRAL_ARROW || itemstack.getItem() == Items.TIPPED_ARROW)) {
abstractarrowentity.pickupStatus = AbstractArrowEntity.PickupStatus.CREATIVE_ONLY;

View File

@ -34,7 +34,7 @@ public class EnderPearlItemMixin extends Item {
if (!worldIn.isRemote) {
EnderPearlEntity enderpearlentity = new EnderPearlEntity(worldIn, playerIn);
enderpearlentity.setItem(itemstack);
enderpearlentity.func_234612_a_(playerIn, playerIn.rotationPitch, playerIn.rotationYaw, 0.0F, 1.5F, 1.0F);
enderpearlentity.setDirectionAndMovement(playerIn, playerIn.rotationPitch, playerIn.rotationYaw, 0.0F, 1.5F, 1.0F);
if (!worldIn.addEntity(enderpearlentity)) {
if (playerIn instanceof ServerPlayerEntityBridge) {
((ServerPlayerEntityBridge) playerIn).bridge$getBukkitEntity().updateInventory();

View File

@ -40,7 +40,7 @@ public class SnowballItemMixin extends Item {
itemstack.shrink(1);
}
worldIn.playSound(null, playerIn.getPosX(), playerIn.getPosY(), playerIn.getPosZ(), SoundEvents.ENTITY_SNOWBALL_THROW, SoundCategory.NEUTRAL, 0.5F, 0.4F / (random.nextFloat() * 0.4F + 0.8F));
snowballentity.func_234612_a_(playerIn, playerIn.rotationPitch, playerIn.rotationYaw, 0.0F, 1.5F, 1.0F);
snowballentity.setDirectionAndMovement(playerIn, playerIn.rotationPitch, playerIn.rotationYaw, 0.0F, 1.5F, 1.0F);
} else if (playerIn instanceof ServerPlayerEntity) {
((ServerPlayerEntityBridge) playerIn).bridge$getBukkitEntity().updateInventory();
}

View File

@ -34,7 +34,7 @@ public abstract class LootTableMixin implements LootTableBridge {
@Eject(method = "fillInventory", at = @At(value = "INVOKE", target = "Lnet/minecraft/loot/LootTable;generate(Lnet/minecraft/loot/LootContext;)Ljava/util/List;"))
private List<ItemStack> arclight$nonPluginEvent(LootTable lootTable, LootContext context, CallbackInfo ci, IInventory inv) {
List<ItemStack> list = lootTable.generate(context);
if (!context.has(LootParameters.field_237457_g_) && !context.has(LootParameters.THIS_ENTITY)) {
if (!context.has(LootParameters.ORIGIN) && !context.has(LootParameters.THIS_ENTITY)) {
return list;
}
LootGenerateEvent event = CraftEventFactory.callLootGenerateEvent(inv, (LootTable) (Object) this, context, list, false);

View File

@ -829,7 +829,7 @@ public abstract class ServerPlayNetHandlerMixin implements ServerPlayNetHandlerB
}
if (packetIn instanceof SWorldSpawnChangedPacket) {
SWorldSpawnChangedPacket packet6 = (SWorldSpawnChangedPacket) packetIn;
((ServerPlayerEntityBridge) this.player).bridge$setCompassTarget(new Location(this.getPlayer().getWorld(), packet6.field_240831_a_.getX(), packet6.field_240831_a_.getY(), packet6.field_240831_a_.getZ()));
((ServerPlayerEntityBridge) this.player).bridge$setCompassTarget(new Location(this.getPlayer().getWorld(), packet6.spawnPos.getX(), packet6.spawnPos.getY(), packet6.spawnPos.getZ()));
}
}
@ -1139,7 +1139,7 @@ public abstract class ServerPlayNetHandlerMixin implements ServerPlayNetHandlerB
return;
}
this.player.markPlayerActive();
this.player.setSneaking(packetIn.func_241792_e_());
this.player.setSneaking(packetIn.isSneaking());
if (entity != null) {
double d0 = 36.0D;
if (this.player.getDistanceSq(entity) < 36.0D) {

View File

@ -19,7 +19,7 @@ public class SChatPacketMixin {
// @formatter:off
@Shadow private ITextComponent chatComponent;
@Shadow private ChatType type;
@Shadow private UUID field_240809_c_;
@Shadow private UUID sender;
// @formatter:on
public BaseComponent[] components;
@ -36,6 +36,6 @@ public class SChatPacketMixin {
buf.writeTextComponent(this.chatComponent);
}
buf.writeByte(this.type.getId());
buf.writeUniqueId(this.field_240809_c_);
buf.writeUniqueId(this.sender);
}
}

View File

@ -158,7 +158,7 @@ public abstract class MinecraftServerMixin extends RecursiveEventLoop<TickDelaye
}
@Inject(method = "<init>", at = @At("RETURN"))
public void arclight$loadOptions(Thread serverThread, DynamicRegistries.Impl p_i232576_2_, SaveFormat.LevelSave anvilConverterForAnvilFile, IServerConfiguration p_i232576_4_, ResourcePackList dataPacks, Proxy serverProxy, DataFixer dataFixer, DataPackRegistries dataRegistries, MinecraftSessionService sessionService, GameProfileRepository profileRepo, PlayerProfileCache profileCache, IChunkStatusListenerFactory chunkStatusListenerFactory, CallbackInfo ci) {
public void arclight$loadOptions(Thread serverThread, DynamicRegistries.Impl dynamicRegistries, SaveFormat.LevelSave anvilConverterForAnvilFile, IServerConfiguration serverConfig, ResourcePackList dataPacks, Proxy serverProxy, DataFixer dataFixer, DataPackRegistries dataRegistries, MinecraftSessionService sessionService, GameProfileRepository profileRepo, PlayerProfileCache profileCache, IChunkStatusListenerFactory chunkStatusListenerFactory, CallbackInfo ci) {
String[] arguments = ManagementFactory.getRuntimeMXBean().getInputArguments().toArray(new String[0]);
OptionParser parser = new BukkitOptionParser();
try {
@ -385,7 +385,7 @@ public abstract class MinecraftServerMixin extends RecursiveEventLoop<TickDelaye
// bukkit methods
public void initWorld(ServerWorld serverWorld, IServerWorldInfo worldInfo, IServerConfiguration saveData, DimensionGeneratorSettings generatorSettings) {
boolean flag = generatorSettings.func_236227_h_();
boolean flag = generatorSettings.hasDebugChunkGenerator();
if (((WorldBridge) serverWorld).bridge$getGenerator() != null) {
((WorldBridge) serverWorld).bridge$getWorld().getPopulators().addAll(
((WorldBridge) serverWorld).bridge$getGenerator().getDefaultPopulators(

View File

@ -288,7 +288,7 @@ public abstract class PlayerListMixin implements PlayerListBridge {
isBedSpawn = true;
location = new Location(((WorldBridge) spawnWorld).bridge$getWorld(), vec3d.x, vec3d.y, vec3d.z);
} else if (pos != null) {
playerIn.connection.sendPacket(new SChangeGameStatePacket(SChangeGameStatePacket.field_241764_a_, 0.0f));
playerIn.connection.sendPacket(new SChangeGameStatePacket(SChangeGameStatePacket.SPAWN_NOT_VALID, 0.0f));
}
}
if (location == null) {
@ -316,12 +316,12 @@ public abstract class PlayerListMixin implements PlayerListBridge {
playerIn.setPosition(playerIn.getPosX(), playerIn.getPosY() + 1.0, playerIn.getPosZ());
}
IWorldInfo worlddata = serverWorld.getWorldInfo();
playerIn.connection.sendPacket(new SRespawnPacket(serverWorld.getDimensionType(), serverWorld.getDimensionKey(), BiomeManager.getHashedSeed(serverWorld.getSeed()), playerIn.interactionManager.getGameType(), playerIn.interactionManager.func_241815_c_(), serverWorld.isDebug(), serverWorld.func_241109_A_(), flag));
playerIn.connection.sendPacket(new SRespawnPacket(serverWorld.getDimensionType(), serverWorld.getDimensionKey(), BiomeManager.getHashedSeed(serverWorld.getSeed()), playerIn.interactionManager.getGameType(), playerIn.interactionManager.func_241815_c_(), serverWorld.isDebug(), serverWorld.isFlatWorld(), flag));
playerIn.connection.sendPacket(new SUpdateViewDistancePacket(((WorldBridge) serverWorld).bridge$spigotConfig().viewDistance));
playerIn.setWorld(serverWorld);
((ServerPlayNetHandlerBridge) playerIn.connection).bridge$teleport(new Location(((WorldBridge) serverWorld).bridge$getWorld(), playerIn.getPosX(), playerIn.getPosY(), playerIn.getPosZ(), playerIn.rotationYaw, playerIn.rotationPitch));
playerIn.setSneaking(false);
playerIn.connection.sendPacket(new SWorldSpawnChangedPacket(serverWorld.getSpawnPoint(), serverWorld.func_242107_v()));
playerIn.connection.sendPacket(new SWorldSpawnChangedPacket(serverWorld.getSpawnPoint(), serverWorld.getSpawnAngle()));
playerIn.connection.sendPacket(new SServerDifficultyPacket(worlddata.getDifficulty(), worlddata.isDifficultyLocked()));
playerIn.connection.sendPacket(new SSetExperiencePacket(playerIn.experience, playerIn.experienceTotal, playerIn.experienceLevel));
this.sendWorldInfo(playerIn, serverWorld);
@ -404,7 +404,7 @@ public abstract class PlayerListMixin implements PlayerListBridge {
isBedSpawn = true;
location = new Location(((WorldBridge) spawnWorld).bridge$getWorld(), vec3d.x, vec3d.y, vec3d.z);
} else if (pos != null) {
playerIn.connection.sendPacket(new SChangeGameStatePacket(SChangeGameStatePacket.field_241764_a_, 0.0f));
playerIn.connection.sendPacket(new SChangeGameStatePacket(SChangeGameStatePacket.SPAWN_NOT_VALID, 0.0f));
}
}
if (location == null) {
@ -465,12 +465,12 @@ public abstract class PlayerListMixin implements PlayerListBridge {
}
IWorldInfo iworldinfo = serverplayerentity.world.getWorldInfo();
serverplayerentity.connection.sendPacket(new SRespawnPacket(serverplayerentity.world.getDimensionType(), serverplayerentity.world.getDimensionKey(), BiomeManager.getHashedSeed(serverplayerentity.getServerWorld().getSeed()), serverplayerentity.interactionManager.getGameType(), serverplayerentity.interactionManager.func_241815_c_(), serverplayerentity.getServerWorld().isDebug(), serverplayerentity.getServerWorld().func_241109_A_(), conqueredEnd));
serverplayerentity.connection.sendPacket(new SRespawnPacket(serverplayerentity.world.getDimensionType(), serverplayerentity.world.getDimensionKey(), BiomeManager.getHashedSeed(serverplayerentity.getServerWorld().getSeed()), serverplayerentity.interactionManager.getGameType(), serverplayerentity.interactionManager.func_241815_c_(), serverplayerentity.getServerWorld().isDebug(), serverplayerentity.getServerWorld().isFlatWorld(), conqueredEnd));
serverplayerentity.connection.sendPacket(new SUpdateViewDistancePacket(((WorldBridge) serverWorld).bridge$spigotConfig().viewDistance));
serverplayerentity.setWorld(serverWorld);
((ServerPlayNetHandlerBridge) serverplayerentity.connection).bridge$teleport(new Location(((WorldBridge) serverWorld).bridge$getWorld(), serverplayerentity.getPosX(), serverplayerentity.getPosY(), serverplayerentity.getPosZ(), serverplayerentity.rotationYaw, serverplayerentity.rotationPitch));
serverplayerentity.setSneaking(false);
serverplayerentity.connection.sendPacket(new SWorldSpawnChangedPacket(serverWorld.getSpawnPoint(), serverWorld.func_242107_v()));
serverplayerentity.connection.sendPacket(new SWorldSpawnChangedPacket(serverWorld.getSpawnPoint(), serverWorld.getSpawnAngle()));
serverplayerentity.connection.sendPacket(new SServerDifficultyPacket(iworldinfo.getDifficulty(), iworldinfo.isDifficultyLocked()));
serverplayerentity.connection.sendPacket(new SSetExperiencePacket(serverplayerentity.experience, serverplayerentity.experienceTotal, serverplayerentity.experienceLevel));
this.sendWorldInfo(serverplayerentity, serverWorld);
@ -529,7 +529,7 @@ public abstract class PlayerListMixin implements PlayerListBridge {
playerEntity.connection.sendPacket(new SEntityStatusPacket(playerEntity, (byte) i));
if (ArclightVersion.atLeast(ArclightVersion.v1_15)) {
float immediateRespawn = playerEntity.world.getGameRules().getBoolean(GameRules.DO_IMMEDIATE_RESPAWN) ? 1.0f : 0.0f;
playerEntity.connection.sendPacket(new SChangeGameStatePacket(SChangeGameStatePacket.field_241775_l_, immediateRespawn));
playerEntity.connection.sendPacket(new SChangeGameStatePacket(SChangeGameStatePacket.SHOW_DEATH_SCREEN, immediateRespawn));
}
}

View File

@ -236,7 +236,7 @@ public abstract class ExplosionMixin implements ExplosionBridge {
this.world.getProfiler().startSection("explosion_blocks");
if (blockstate.canDropFromExplosion(this.world, blockpos, (Explosion) (Object) this) && this.world instanceof ServerWorld) {
TileEntity tileentity = blockstate.hasTileEntity() ? this.world.getTileEntity(blockpos) : null;
LootContext.Builder lootcontext$builder = (new LootContext.Builder((ServerWorld)this.world)).withRandom(this.world.rand).withParameter(LootParameters.field_237457_g_, Vector3d.copyCentered(blockpos)).withParameter(LootParameters.TOOL, ItemStack.EMPTY).withNullableParameter(LootParameters.BLOCK_ENTITY, tileentity).withNullableParameter(LootParameters.THIS_ENTITY, this.exploder);
LootContext.Builder lootcontext$builder = (new LootContext.Builder((ServerWorld)this.world)).withRandom(this.world.rand).withParameter(LootParameters.ORIGIN, Vector3d.copyCentered(blockpos)).withParameter(LootParameters.TOOL, ItemStack.EMPTY).withNullableParameter(LootParameters.BLOCK_ENTITY, tileentity).withNullableParameter(LootParameters.THIS_ENTITY, this.exploder);
if (this.mode == Explosion.Mode.DESTROY || yield < 1.0F) {
lootcontext$builder.withParameter(LootParameters.EXPLOSION_RADIUS, 1.0F / yield);
}

View File

@ -143,7 +143,7 @@ public abstract class TrackedEntityMixin implements TrackedEntityBridge {
++this.ticksSinceAbsoluteTeleport;
int l = MathHelper.floor(this.trackedEntity.rotationYaw * 256.0F / 360.0F);
int k1 = MathHelper.floor(this.trackedEntity.rotationPitch * 256.0F / 360.0F);
Vector3d vector3d = this.trackedEntity.getPositionVec().subtract(SEntityPacket.func_218744_a(this.encodedPosX, this.encodedPosY, this.encodedPosZ));
Vector3d vector3d = this.trackedEntity.getPositionVec().subtract(SEntityPacket.decodePosition(this.encodedPosX, this.encodedPosY, this.encodedPosZ));
boolean flag3 = vector3d.lengthSquared() >= (double) 7.6293945E-6F;
IPacket<?> ipacket1 = null;
boolean flag4 = flag3 || this.updateCounter % 60 == 0;

View File

@ -103,9 +103,9 @@ public abstract class WorldMixin implements WorldBridge, IWorldWriter {
this.ticksPerWaterSpawns = this.getServer().getTicksPerWaterSpawns();
this.ticksPerWaterAmbientSpawns = this.getServer().getTicksPerWaterAmbientSpawns();
this.ticksPerAmbientSpawns = this.getServer().getTicksPerAmbientSpawns();
this.typeKey = this.getServer().getHandle().getServer().func_244267_aX().func_230520_a_().getOptionalKey(dimensionType)
this.typeKey = this.getServer().getHandle().getServer().getDynamicRegistries().func_230520_a_().getOptionalKey(dimensionType)
.orElseGet(() -> {
Registry<DimensionType> registry = this.getServer().getHandle().getServer().func_244267_aX().func_230520_a_();
Registry<DimensionType> registry = this.getServer().getHandle().getServer().getDynamicRegistries().func_230520_a_();
RegistryKey<DimensionType> typeRegistryKey = RegistryKey.getOrCreateKey(registry.getRegistryKey(), dimension.getLocation());
ArclightMod.LOGGER.warn("Assign {} to unknown dimension type {} as {}", typeRegistryKey, dimType);
return typeRegistryKey;

View File

@ -53,6 +53,6 @@ public abstract class WorldGenRegionMixin implements WorldBridge {
*/
@Overwrite
public Stream<? extends StructureStart<?>> func_241827_a(SectionPos p_241827_1_, Structure<?> p_241827_2_) {
return this.world.func_241112_a_().getStructureManager((WorldGenRegion) (Object) this).func_235011_a_(p_241827_1_, p_241827_2_);
return this.world.getStructureManager().getStructureManager((WorldGenRegion) (Object) this).func_235011_a_(p_241827_1_, p_241827_2_);
}
}

View File

@ -23,7 +23,7 @@ public class TemplateManagerMixin {
@Shadow @Final @Mutable private Map<ResourceLocation, Template> templates;
@Inject(method = "<init>", at = @At("RETURN"))
private void arclight$init(IResourceManager p_i232119_1_, SaveFormat.LevelSave p_i232119_2_, DataFixer p_i232119_3_, CallbackInfo ci) {
private void arclight$init(IResourceManager p_i232119_1_, SaveFormat.LevelSave p_i232119_2_, DataFixer fixer, CallbackInfo ci) {
this.templates = Collections.synchronizedMap(this.templates);
}
}

View File

@ -23,7 +23,7 @@ public abstract class ChunkManager_EntityTrackerMixin {
// @formatter:on
@Inject(method = "<init>", at = @At("RETURN"))
private void arclight$setTrackedPlayers(ChunkManager outer, Entity entity, int p_i50468_3_, int updateFrequency, boolean sendVelocityUpdates, CallbackInfo ci) {
private void arclight$setTrackedPlayers(ChunkManager outer, Entity entity, int range, int updateFrequency, boolean sendVelocityUpdates, CallbackInfo ci) {
((TrackedEntityBridge) this.entry).bridge$setTrackedPlayers(this.trackingPlayers);
}
}

View File

@ -100,10 +100,10 @@ public abstract class ServerWorldMixin extends WorldMixin implements ServerWorld
@Shadow public abstract ServerChunkProvider getChunkProvider();
@Shadow private boolean allPlayersSleeping;
@Shadow protected abstract void wakeUpAllPlayers();
@Shadow @Final private ServerChunkProvider field_241102_C_;
@Shadow @Final private ServerChunkProvider serverChunkProvider;
@Shadow protected abstract boolean hasDuplicateEntity(Entity entityIn);
@Shadow @Final public static BlockPos field_241108_a_;
@Shadow @Final public IServerWorldInfo field_241103_E_;
@Shadow @Final public static BlockPos END_SPAWN_AREA;
@Shadow @Final public IServerWorldInfo serverWorldInfo;
// @formatter:on
@SuppressWarnings({"FieldCanBeLocal", "unused"})
@ -111,26 +111,26 @@ public abstract class ServerWorldMixin extends WorldMixin implements ServerWorld
public SaveFormat.LevelSave convertable;
public UUID uuid;
public void arclight$constructor(MinecraftServer p_i241885_1_, Executor p_i241885_2_, SaveFormat.LevelSave p_i241885_3_, IServerWorldInfo p_i241885_4_, RegistryKey<World> p_i241885_5_, DimensionType p_i241885_6_, IChunkStatusListener p_i241885_7_, ChunkGenerator p_i241885_8_, boolean p_i241885_9_, long p_i241885_10_, List<ISpecialSpawner> p_i241885_12_, boolean p_i241885_13_) {
public void arclight$constructor(MinecraftServer server, Executor backgroundExecutor, SaveFormat.LevelSave levelSave, IServerWorldInfo serverWorldInfo, RegistryKey<World> dimension, DimensionType dimensionType, IChunkStatusListener statusListener, ChunkGenerator chunkGenerator, boolean isDebug, long seed, List<ISpecialSpawner> specialSpawners, boolean shouldBeTicking) {
throw new RuntimeException();
}
public void arclight$constructor(MinecraftServer p_i241885_1_, Executor p_i241885_2_, SaveFormat.LevelSave p_i241885_3_, IServerWorldInfo p_i241885_4_, RegistryKey<World> p_i241885_5_, DimensionType p_i241885_6_, IChunkStatusListener p_i241885_7_, ChunkGenerator p_i241885_8_, boolean p_i241885_9_, long p_i241885_10_, List<ISpecialSpawner> p_i241885_12_, boolean p_i241885_13_, org.bukkit.World.Environment env, org.bukkit.generator.ChunkGenerator gen) {
arclight$constructor(p_i241885_1_, p_i241885_2_, p_i241885_3_, p_i241885_4_, p_i241885_5_, p_i241885_6_, p_i241885_7_, p_i241885_8_, p_i241885_9_, p_i241885_10_, p_i241885_12_, p_i241885_13_);
public void arclight$constructor(MinecraftServer server, Executor backgroundExecutor, SaveFormat.LevelSave levelSave, IServerWorldInfo serverWorldInfo, RegistryKey<World> dimension, DimensionType dimensionType, IChunkStatusListener statusListener, ChunkGenerator chunkGenerator, boolean isDebug, long seed, List<ISpecialSpawner> specialSpawners, boolean shouldBeTicking, org.bukkit.World.Environment env, org.bukkit.generator.ChunkGenerator gen) {
arclight$constructor(server, backgroundExecutor, levelSave, serverWorldInfo, dimension, dimensionType, statusListener, chunkGenerator, isDebug, seed, specialSpawners, shouldBeTicking);
this.generator = gen;
this.environment = env;
if (gen != null) {
CustomChunkGenerator generator = new CustomChunkGenerator((ServerWorld) (Object) this, this.field_241102_C_.getChunkGenerator(), gen);
((ServerChunkProviderBridge) this.field_241102_C_).bridge$setChunkGenerator(generator);
CustomChunkGenerator generator = new CustomChunkGenerator((ServerWorld) (Object) this, this.serverChunkProvider.getChunkGenerator(), gen);
((ServerChunkProviderBridge) this.serverChunkProvider).bridge$setChunkGenerator(generator);
}
bridge$getWorld();
}
@Inject(method = "<init>(Lnet/minecraft/server/MinecraftServer;Ljava/util/concurrent/Executor;Lnet/minecraft/world/storage/SaveFormat$LevelSave;Lnet/minecraft/world/storage/IServerWorldInfo;Lnet/minecraft/util/RegistryKey;Lnet/minecraft/world/DimensionType;Lnet/minecraft/world/chunk/listener/IChunkStatusListener;Lnet/minecraft/world/gen/ChunkGenerator;ZJLjava/util/List;Z)V", at = @At("RETURN"))
private void arclight$init(MinecraftServer minecraftServer, Executor p_i241885_2_, SaveFormat.LevelSave p_i241885_3_, IServerWorldInfo worldInfo, RegistryKey<World> p_i241885_5_, DimensionType p_i241885_6_, IChunkStatusListener p_i241885_7_, ChunkGenerator p_i241885_8_, boolean p_i241885_9_, long p_i241885_10_, List<ISpecialSpawner> p_i241885_12_, boolean p_i241885_13_, CallbackInfo ci) {
private void arclight$init(MinecraftServer minecraftServer, Executor backgroundExecutor, SaveFormat.LevelSave levelSave, IServerWorldInfo worldInfo, RegistryKey<World> dimension, DimensionType dimensionType, IChunkStatusListener statusListener, ChunkGenerator chunkGenerator, boolean isDebug, long seed, List<ISpecialSpawner> specialSpawners, boolean shouldBeTicking, CallbackInfo ci) {
this.pvpMode = minecraftServer.isPVPEnabled();
this.convertable = p_i241885_3_;
this.uuid = WorldUUID.getUUID(p_i241885_3_.getDimensionFolder(this.getDimensionKey()));
this.convertable = levelSave;
this.uuid = WorldUUID.getUUID(levelSave.getDimensionFolder(this.getDimensionKey()));
if (worldInfo instanceof ServerWorldInfo) {
this.$$worldDataServer = (ServerWorldInfo) worldInfo;
} else if (worldInfo instanceof DerivedWorldInfo) {
@ -138,12 +138,12 @@ public abstract class ServerWorldMixin extends WorldMixin implements ServerWorld
this.$$worldDataServer = DelegateWorldInfo.wrap(((DerivedWorldInfo) worldInfo));
((DerivedWorldInfoBridge) worldInfo).bridge$setDimType(this.getTypeKey());
}
((ServerChunkProviderBridge) this.field_241102_C_).bridge$setViewDistance(spigotConfig.viewDistance);
((ServerChunkProviderBridge) this.serverChunkProvider).bridge$setViewDistance(spigotConfig.viewDistance);
((WorldInfoBridge) this.$$worldDataServer).bridge$setWorld((ServerWorld) (Object) this);
}
public Chunk getChunkIfLoaded(int x, int z) {
return this.field_241102_C_.getChunk(x, z, false);
return this.serverChunkProvider.getChunk(x, z, false);
}
public <T extends IParticleData> int sendParticles(final ServerPlayerEntity sender, final T t0, final double d0, final double d1, final double d2, final int i, final double d3, final double d4, final double d5, final double d6, final boolean force) {
@ -233,11 +233,11 @@ public abstract class ServerWorldMixin extends WorldMixin implements ServerWorld
@Inject(method = "save", at = @At("RETURN"))
private void arclight$saveLevelDat(IProgressUpdate progress, boolean flush, boolean skipSave, CallbackInfo ci) {
if (this.field_241103_E_ instanceof ServerWorldInfo) {
ServerWorldInfo worldInfo = (ServerWorldInfo) this.field_241103_E_;
if (this.serverWorldInfo instanceof ServerWorldInfo) {
ServerWorldInfo worldInfo = (ServerWorldInfo) this.serverWorldInfo;
worldInfo.setWorldBorderSerializer(this.getWorldBorder().getSerializer());
worldInfo.setCustomBossEventData(this.shadow$getServer().getCustomBossEvents().write());
this.convertable.saveLevel(this.shadow$getServer().field_240767_f_, worldInfo, this.shadow$getServer().getPlayerList().getHostPlayerData());
this.convertable.saveLevel(this.shadow$getServer().dynamicRegistries, worldInfo, this.shadow$getServer().getPlayerList().getHostPlayerData());
}
}
@ -366,8 +366,8 @@ public abstract class ServerWorldMixin extends WorldMixin implements ServerWorld
}, mapName);
}
@Inject(method = "func_230547_a_", cancellable = true, at = @At(value = "INVOKE", target = "Lnet/minecraft/world/server/ServerWorld;notifyNeighborsOfStateChange(Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/Block;)V"))
private void arclight$returnIfPopulate(BlockPos p_230547_1_, Block p_230547_2_, CallbackInfo ci) {
@Inject(method = "updateBlock", cancellable = true, at = @At(value = "INVOKE", target = "Lnet/minecraft/world/server/ServerWorld;notifyNeighborsOfStateChange(Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/Block;)V"))
private void arclight$returnIfPopulate(BlockPos pos, Block block, CallbackInfo ci) {
if (populating) {
ci.cancel();
}
@ -465,17 +465,17 @@ public abstract class ServerWorldMixin extends WorldMixin implements ServerWorld
*/
@SuppressWarnings({"unchecked", "rawtypes"})
@Overwrite
public static void func_241121_a_(ServerWorld world) {
BlockPos blockpos = field_241108_a_;
public static void setupEndSpawnPlatform(ServerWorld world) {
BlockPos blockpos = END_SPAWN_AREA;
int i = blockpos.getX();
int j = blockpos.getY() - 2;
int k = blockpos.getZ();
BlockStateListPopulator blockList = new BlockStateListPopulator(world);
BlockPos.getAllInBoxMutable(i - 2, j + 1, k - 2, i + 2, j + 3, k + 2).forEach((p_241122_1_) -> {
blockList.setBlockState(p_241122_1_, Blocks.OBSIDIAN.getDefaultState(), 3);
BlockPos.getAllInBoxMutable(i - 2, j + 1, k - 2, i + 2, j + 3, k + 2).forEach((pos) -> {
blockList.setBlockState(pos, Blocks.OBSIDIAN.getDefaultState(), 3);
});
BlockPos.getAllInBoxMutable(i - 2, j, k - 2, i + 2, j, k + 2).forEach((p_241122_1_) -> {
blockList.setBlockState(p_241122_1_, Blocks.OBSIDIAN.getDefaultState(), 3);
BlockPos.getAllInBoxMutable(i - 2, j, k - 2, i + 2, j, k + 2).forEach((pos) -> {
blockList.setBlockState(pos, Blocks.OBSIDIAN.getDefaultState(), 3);
});
CraftWorld bworld = ((WorldBridge) world).bridge$getWorld();
boolean spawnPortal = ArclightCaptures.getEndPortalSpawn();

View File

@ -12,7 +12,7 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
@Mixin(PhantomSpawner.class)
public class PhantomSpawnerMixin {
@Inject(method = "func_230253_a_", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/server/ServerWorld;func_242417_l(Lnet/minecraft/entity/Entity;)V"))
@Inject(method = "onUpdate", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/server/ServerWorld;func_242417_l(Lnet/minecraft/entity/Entity;)V"))
public void arclight$spawnReason(ServerWorld worldIn, boolean spawnHostileMobs, boolean spawnPeacefulMobs, CallbackInfoReturnable<Integer> cir) {
((WorldBridge) worldIn).bridge$pushAddEntityReason(CreatureSpawnEvent.SpawnReason.NATURAL);
}

View File

@ -131,7 +131,7 @@ public class BukkitRegistry {
public static void registerEnvironments() {
int i = World.Environment.values().length;
List<World.Environment> newTypes = new ArrayList<>();
Registry<DimensionType> registry = ArclightServer.getMinecraftServer().func_244267_aX().getRegistry(Registry.DIMENSION_TYPE_KEY);
Registry<DimensionType> registry = ArclightServer.getMinecraftServer().getDynamicRegistries().getRegistry(Registry.DIMENSION_TYPE_KEY);
for (Map.Entry<RegistryKey<DimensionType>, DimensionType> entry : registry.getEntries()) {
RegistryKey<DimensionType> key = entry.getKey();
World.Environment environment = DIM_MAP.get(key);

View File

@ -42,7 +42,7 @@ configurations {
}
minecraft {
mappings channel: 'snapshot', version: "20201028-1.16.3"
mappings channel: 'snapshot', version: "20210215-1.16.3"
accessTransformer = project(':arclight-common').file('src/main/resources/META-INF/accesstransformer.cfg')
}

View File

@ -1,6 +1,6 @@
allprojects {
group 'io.izzel.arclight'
version '1.0.13'
version '1.0.14-SNAPSHOT'
ext {
agpVersion = '1.13'