Repackage NMS

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2021-03-16 09:00:00 +11:00
parent 18496e998f
commit 9da047989c
968 changed files with 5448 additions and 5050 deletions

View File

@@ -1,8 +1,8 @@
--- a/net/minecraft/server/EntityEnderCrystal.java
+++ b/net/minecraft/server/EntityEnderCrystal.java
@@ -3,6 +3,11 @@
import java.util.Optional;
import javax.annotation.Nullable;
--- a/net/minecraft/world/entity/boss/enderdragon/EntityEnderCrystal.java
+++ b/net/minecraft/world/entity/boss/enderdragon/EntityEnderCrystal.java
@@ -20,6 +20,11 @@
import net.minecraft.world.level.block.BlockFireAbstract;
import net.minecraft.world.level.dimension.end.EnderDragonBattle;
+// CraftBukkit start
+import org.bukkit.craftbukkit.event.CraftEventFactory;
@@ -12,7 +12,7 @@
public class EntityEnderCrystal extends Entity {
private static final DataWatcherObject<Optional<BlockPosition>> c = DataWatcher.a(EntityEnderCrystal.class, DataWatcherRegistry.m);
@@ -38,7 +43,11 @@
@@ -55,7 +60,11 @@
BlockPosition blockposition = this.getChunkCoordinates();
if (((WorldServer) this.world).getDragonBattle() != null && this.world.getType(blockposition).isAir()) {
@@ -25,7 +25,7 @@
}
}
@@ -78,9 +87,22 @@
@@ -95,9 +104,22 @@
return false;
} else {
if (!this.dead && !this.world.isClientSide) {

View File

@@ -1,10 +1,15 @@
--- a/net/minecraft/server/EntityEnderDragon.java
+++ b/net/minecraft/server/EntityEnderDragon.java
@@ -7,6 +7,12 @@
--- a/net/minecraft/world/entity/boss/enderdragon/EntityEnderDragon.java
+++ b/net/minecraft/world/entity/boss/enderdragon/EntityEnderDragon.java
@@ -51,6 +51,17 @@
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
+// CraftBukkit start
+import net.minecraft.world.item.ItemStack;
+import net.minecraft.world.level.Explosion;
+import net.minecraft.world.level.block.entity.TileEntity;
+import net.minecraft.world.level.storage.loot.LootTableInfo;
+import net.minecraft.world.level.storage.loot.parameters.LootContextParameters;
+import org.bukkit.craftbukkit.block.CraftBlock;
+import org.bukkit.event.entity.EntityExplodeEvent;
+import org.bukkit.event.entity.EntityRegainHealthEvent;
@@ -13,7 +18,7 @@
public class EntityEnderDragon extends EntityInsentient implements IMonster {
private static final Logger LOGGER = LogManager.getLogger();
@@ -38,6 +44,7 @@
@@ -82,6 +93,7 @@
private final PathPoint[] bJ = new PathPoint[24];
private final int[] bK = new int[24];
private final Path bL = new Path();
@@ -21,7 +26,7 @@
public EntityEnderDragon(EntityTypes<? extends EntityEnderDragon> entitytypes, World world) {
super(EntityTypes.ENDER_DRAGON, world);
@@ -175,7 +182,7 @@
@@ -219,7 +231,7 @@
Vec3D vec3d1 = idragoncontroller.g();
@@ -30,7 +35,7 @@
d0 = vec3d1.x - this.locX();
d1 = vec3d1.y - this.locY();
d2 = vec3d1.z - this.locZ();
@@ -313,7 +320,14 @@
@@ -357,7 +369,14 @@
if (this.currentEnderCrystal.dead) {
this.currentEnderCrystal = null;
} else if (this.ticksLived % 10 == 0 && this.getHealth() < this.getMaxHealth()) {
@@ -46,7 +51,7 @@
}
}
@@ -388,6 +402,9 @@
@@ -432,6 +451,9 @@
int j1 = MathHelper.floor(axisalignedbb.maxZ);
boolean flag = false;
boolean flag1 = false;
@@ -56,7 +61,7 @@
for (int k1 = i; k1 <= l; ++k1) {
for (int l1 = j; l1 <= i1; ++l1) {
@@ -398,7 +415,11 @@
@@ -442,7 +464,11 @@
if (!iblockdata.isAir() && iblockdata.getMaterial() != Material.FIRE) {
if (this.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING) && !TagsBlock.DRAGON_IMMUNE.isTagged(block)) {
@@ -69,7 +74,7 @@
} else {
flag = true;
}
@@ -407,6 +428,51 @@
@@ -451,6 +477,51 @@
}
}

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/server/DragonControllerManager.java
+++ b/net/minecraft/server/DragonControllerManager.java
@@ -3,6 +3,11 @@
--- a/net/minecraft/world/entity/boss/enderdragon/phases/DragonControllerManager.java
+++ b/net/minecraft/world/entity/boss/enderdragon/phases/DragonControllerManager.java
@@ -4,6 +4,11 @@
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@@ -12,7 +12,7 @@
public class DragonControllerManager {
private static final Logger LOGGER = LogManager.getLogger();
@@ -21,6 +26,19 @@
@@ -22,6 +27,19 @@
this.currentDragonController.e();
}
@@ -32,7 +32,7 @@
this.currentDragonController = this.b(dragoncontrollerphase);
if (!this.enderDragon.world.isClientSide) {
this.enderDragon.getDataWatcher().set(EntityEnderDragon.PHASE, dragoncontrollerphase.b());
@@ -42,6 +60,6 @@
@@ -43,6 +61,6 @@
this.dragonControllers[i] = dragoncontrollerphase.a(this.enderDragon);
}

View File

@@ -1,10 +1,14 @@
--- a/net/minecraft/server/EntityWither.java
+++ b/net/minecraft/server/EntityWither.java
@@ -6,6 +6,13 @@
import java.util.function.Predicate;
import javax.annotation.Nullable;
--- a/net/minecraft/world/entity/boss/wither/EntityWither.java
+++ b/net/minecraft/world/entity/boss/wither/EntityWither.java
@@ -52,6 +52,17 @@
import net.minecraft.world.level.block.state.IBlockData;
import net.minecraft.world.phys.Vec3D;
+// CraftBukkit start
+import net.minecraft.network.protocol.game.PacketPlayOutWorldEvent;
+import net.minecraft.server.MinecraftServer;
+import net.minecraft.server.level.WorldServer;
+import net.minecraft.world.level.block.Blocks;
+import org.bukkit.craftbukkit.event.CraftEventFactory;
+import org.bukkit.event.entity.EntityRegainHealthEvent;
+import org.bukkit.event.entity.EntityTargetEvent;
@@ -14,7 +18,7 @@
public class EntityWither extends EntityMonster implements IRangedEntity {
private static final DataWatcherObject<Integer> b = DataWatcher.a(EntityWither.class, DataWatcherRegistry.b);
@@ -188,16 +195,40 @@
@@ -234,16 +245,40 @@
i = this.getInvul() - 1;
if (i <= 0) {
Explosion.Effect explosion_effect = this.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING) ? Explosion.Effect.DESTROY : Explosion.Effect.NONE;
@@ -58,7 +62,7 @@
}
} else {
@@ -249,9 +280,11 @@
@@ -295,9 +330,11 @@
if (entityliving != this && entityliving.isAlive() && this.hasLineOfSight(entityliving)) {
if (entityliving instanceof EntityHuman) {
if (!((EntityHuman) entityliving).abilities.isInvulnerable) {
@@ -70,7 +74,7 @@
this.setHeadTarget(i, entityliving.getId());
}
break;
@@ -287,6 +320,11 @@
@@ -333,6 +370,11 @@
IBlockData iblockdata = this.world.getType(blockposition);
if (c(iblockdata)) {
@@ -82,7 +86,7 @@
flag = this.world.a(blockposition, true, this) || flag;
}
}
@@ -300,7 +338,7 @@
@@ -346,7 +388,7 @@
}
if (this.ticksLived % 20 == 0) {