Update to forge 39.1.2

This commit is contained in:
IzzelAliz 2022-03-07 19:03:25 +08:00
parent ff83ef6eaf
commit 802f5b9d8e
No known key found for this signature in database
GPG Key ID: EE50E123A11D8338
6 changed files with 18 additions and 7 deletions

View File

@ -6,7 +6,7 @@ A Bukkit server implementation utilizing Mixin.
| Minecraft | Forge | Status | Build |
| :----: |:-------:| :---: | :---: |
| 1.18.x | 39.0.59 | ACTIVE | [![1.18 Status](https://img.shields.io/appveyor/build/IzzelAliz/arclight-18?style=flat-square)](https://ci.appveyor.com/project/IzzelAliz/arclight-18) |
| 1.18.x | 39.1.2 | ACTIVE | [![1.18 Status](https://img.shields.io/appveyor/build/IzzelAliz/arclight-18?style=flat-square)](https://ci.appveyor.com/project/IzzelAliz/arclight-18) |
| 1.17.x | 37.1.0 | [LEGACY](https://github.com/IzzelAliz/Arclight/releases/tag/1.17/1.0.2) | [![1.17 Status](https://img.shields.io/appveyor/build/IzzelAliz/arclight-17?style=flat-square)](https://ci.appveyor.com/project/IzzelAliz/arclight-17) |
| 1.16.x | 36.2.26 | ACTIVE | [![1.16 Status](https://img.shields.io/appveyor/build/IzzelAliz/arclight-16?style=flat-square)](https://ci.appveyor.com/project/IzzelAliz/arclight-16) |
| 1.15.x | 31.2.48 | [LEGACY](https://github.com/IzzelAliz/Arclight/releases/tag/1.15/1.0.19) | [![1.15 Status](https://img.shields.io/appveyor/build/IzzelAliz/arclight-15?style=flat-square)](https://ci.appveyor.com/project/IzzelAliz/arclight-15) |

View File

@ -233,7 +233,8 @@ public abstract class LivingEntityMixin extends EntityMixin implements LivingEnt
protected void dropExperience() {
// if (!this.world.isRemote && (this.isPlayer() || this.recentlyHit > 0 && this.canDropLoot() && this.world.getGameRules().getBoolean(GameRules.DO_MOB_LOOT))) {
if (true) {
ExperienceOrb.award((ServerLevel) this.level, this.position(), this.expToDrop);
int reward = ForgeEventFactory.getExperienceDrop((LivingEntity)(Object) this, this.lastHurtByPlayer, this.expToDrop);
ExperienceOrb.award((ServerLevel) this.level, this.position(), reward);
bridge$setExpToDrop(0);
}
}

View File

@ -9,6 +9,7 @@ import net.minecraft.sounds.SoundEvents;
import net.minecraft.util.Mth;
import net.minecraft.world.entity.monster.Shulker;
import net.minecraft.world.phys.AABB;
import net.minecraftforge.event.ForgeEventFactory;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.event.entity.CreatureSpawnEvent;
@ -45,6 +46,11 @@ public abstract class ShulkerMixin extends PathfinderMobMixin {
BlockPos blockpos1 = blockpos.offset(Mth.randomBetweenInclusive(this.random, -8, 8), Mth.randomBetweenInclusive(this.random, -8, 8), Mth.randomBetweenInclusive(this.random, -8, 8));
if (blockpos1.getY() > this.level.getMinBuildHeight() && this.level.isEmptyBlock(blockpos1) && this.level.getWorldBorder().isWithinBounds(blockpos1) && this.level.noCollision((Shulker) (Object) this, (new AABB(blockpos1)).deflate(1.0E-6D))) {
Direction direction = this.findAttachableSurface(blockpos1);
if (direction != null) {
var event = ForgeEventFactory.onEnderTeleport((Shulker) (Object) this, blockpos1.getX(), blockpos1.getY(), blockpos1.getZ());
if (event.isCanceled()) direction = null;
blockpos1 = new BlockPos(event.getTargetX(), event.getTargetY(), event.getTargetZ());
}
if (direction != null) {
EntityTeleportEvent teleport = new EntityTeleportEvent(this.getBukkitEntity(), this.getBukkitEntity().getLocation(), new Location(((WorldBridge) this.level).bridge$getWorld(), blockpos1.getX(), blockpos1.getY(), blockpos1.getZ()));
Bukkit.getPluginManager().callEvent(teleport);

View File

@ -474,7 +474,7 @@ public abstract class ServerPlayerMixin extends PlayerMixin implements ServerPla
if (registrykey == LevelStem.END && ((WorldBridge) server).bridge$getTypeKey() == LevelStem.OVERWORLD && teleporter.isVanilla()) { //Forge: Fix non-vanilla teleporters triggering end credits
this.isChangingDimension = true;
this.unRide();
this.getLevel().removePlayer((ServerPlayer) (Object) this, true); //Forge: The player entity is cloned so keep the data until after cloning calls copyFrom
this.getLevel().removePlayerImmediately((ServerPlayer) (Object) this, Entity.RemovalReason.CHANGED_DIMENSION);
if (!this.wonGame) {
this.wonGame = true;
this.connection.send(new ClientboundGameEventPacket(ClientboundGameEventPacket.WIN_GAME, this.seenCredits ? 0.0F : 1.0F));
@ -494,7 +494,7 @@ public abstract class ServerPlayerMixin extends PlayerMixin implements ServerPla
this.connection.send(new ClientboundChangeDifficultyPacket(iworldinfo.getDifficulty(), iworldinfo.isDifficultyLocked()));
PlayerList playerlist = this.server.getPlayerList();
playerlist.sendPlayerPermissionLevel((ServerPlayer) (Object) this);
serverworld.removeEntity((ServerPlayer) (Object) this, true); //Forge: the player entity is moved to the new world, NOT cloned. So keep the data alive with no matching invalidate call.
this.getLevel().removePlayerImmediately((ServerPlayer) (Object) this, Entity.RemovalReason.CHANGED_DIMENSION);
this.revive();
Entity e = teleporter.placeEntity((ServerPlayer) (Object) this, serverworld, exitWorld[0], this.getYRot(), spawnPortal -> {//Forge: Start vanilla logic
serverworld.getProfiler().push("moving");

View File

@ -111,8 +111,12 @@ public abstract class BaseSpawnerMixin {
entity.moveTo(entity.getX(), entity.getY(), entity.getZ(), level.random.nextFloat() * 360.0F, 0.0F);
if (entity instanceof Mob mob) {
if (this.nextSpawnData.getCustomSpawnRules().isEmpty() && !ForgeEventFactory.canEntitySpawnSpawner(mob, level, (float) entity.getX(), (float) entity.getY(), (float) entity.getZ(), (BaseSpawner) (Object) this)) {
continue;
var res = ForgeEventFactory.canEntitySpawn(mob, level, (float) entity.getX(), (float) entity.getY(), (float) entity.getZ(), (BaseSpawner) (Object) this, MobSpawnType.SPAWNER);
if (res == net.minecraftforge.eventbus.api.Event.Result.DENY) continue;
if (res == net.minecraftforge.eventbus.api.Event.Result.DEFAULT) {
if (this.nextSpawnData.getCustomSpawnRules().isEmpty() && !ForgeEventFactory.canEntitySpawnSpawner(mob, level, (float) entity.getX(), (float) entity.getY(), (float) entity.getZ(), (BaseSpawner) (Object) this)) {
continue;
}
}
if (this.nextSpawnData.getEntityToSpawn().size() == 1 && this.nextSpawnData.getEntityToSpawn().contains("id", 8)) {

View File

@ -14,7 +14,7 @@ allprojects {
ext {
agpVersion = '1.22'
minecraftVersion = '1.18.1'
forgeVersion = '39.0.59'
forgeVersion = '39.1.2'
apiVersion = '1.2.5'
toolsVersion = '1.3.+'
mixinVersion = '0.8.5'