Updated Upstream (CraftBukkit/Spigot)
Doesn't compile yet. CraftBukkit Changes: 90d6905b Repackage NMS 69cf961d Repackage patches Spigot Changes: 79d53c28 Repackage NMS
This commit is contained in:
@@ -4,10 +4,10 @@ Date: Sat, 21 Jul 2018 03:11:03 -0500
|
||||
Subject: [PATCH] PlayerLaunchProjectileEvent
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/InteractionResultWrapper.java b/src/main/java/net/minecraft/server/InteractionResultWrapper.java
|
||||
diff --git a/src/main/java/net/minecraft/world/InteractionResultWrapper.java b/src/main/java/net/minecraft/world/InteractionResultWrapper.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/InteractionResultWrapper.java
|
||||
+++ b/src/main/java/net/minecraft/server/InteractionResultWrapper.java
|
||||
--- a/src/main/java/net/minecraft/world/InteractionResultWrapper.java
|
||||
+++ b/src/main/java/net/minecraft/world/InteractionResultWrapper.java
|
||||
@@ -0,0 +0,0 @@ public class InteractionResultWrapper<T> {
|
||||
this.b = t0;
|
||||
}
|
||||
@@ -16,10 +16,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
public EnumInteractionResult a() {
|
||||
return this.a;
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/ItemEgg.java b/src/main/java/net/minecraft/server/ItemEgg.java
|
||||
diff --git a/src/main/java/net/minecraft/world/item/ItemEgg.java b/src/main/java/net/minecraft/world/item/ItemEgg.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/ItemEgg.java
|
||||
+++ b/src/main/java/net/minecraft/server/ItemEgg.java
|
||||
--- a/src/main/java/net/minecraft/world/item/ItemEgg.java
|
||||
+++ b/src/main/java/net/minecraft/world/item/ItemEgg.java
|
||||
@@ -0,0 +0,0 @@ public class ItemEgg extends Item {
|
||||
|
||||
entityegg.setItem(itemstack);
|
||||
@@ -31,18 +31,18 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ if (event.callEvent() && world.addEntity(entityegg)) {
|
||||
+ if (event.shouldConsume() && !entityhuman.abilities.canInstantlyBuild) {
|
||||
+ itemstack.subtract(1);
|
||||
+ } else if (entityhuman instanceof EntityPlayer) {
|
||||
+ ((EntityPlayer) entityhuman).getBukkitEntity().updateInventory();
|
||||
+ } else if (entityhuman instanceof net.minecraft.server.level.EntityPlayer) {
|
||||
+ ((net.minecraft.server.level.EntityPlayer) entityhuman).getBukkitEntity().updateInventory();
|
||||
+ }
|
||||
+
|
||||
+ world.playSound((EntityHuman) null, entityhuman.locX(), entityhuman.locY(), entityhuman.locZ(), SoundEffects.ENTITY_EGG_THROW, SoundCategory.PLAYERS, 0.5F, 0.4F / (Entity.SHARED_RANDOM.nextFloat() * 0.4F + 0.8F));
|
||||
+ world.playSound((EntityHuman) null, entityhuman.locX(), entityhuman.locY(), entityhuman.locZ(), SoundEffects.ENTITY_EGG_THROW, SoundCategory.PLAYERS, 0.5F, 0.4F / (net.minecraft.world.entity.Entity.SHARED_RANDOM.nextFloat() * 0.4F + 0.8F));
|
||||
+ entityhuman.b(StatisticList.ITEM_USED.b(this));
|
||||
+ } else {
|
||||
if (entityhuman instanceof EntityPlayer) {
|
||||
((EntityPlayer) entityhuman).getBukkitEntity().updateInventory();
|
||||
if (entityhuman instanceof net.minecraft.server.level.EntityPlayer) {
|
||||
((net.minecraft.server.level.EntityPlayer) entityhuman).getBukkitEntity().updateInventory();
|
||||
}
|
||||
- return InteractionResultWrapper.fail(itemstack);
|
||||
+ return new InteractionResultWrapper<ItemStack>(EnumInteractionResult.FAIL, itemstack);
|
||||
+ return new InteractionResultWrapper<ItemStack>(net.minecraft.world.EnumInteractionResult.FAIL, itemstack);
|
||||
}
|
||||
- // CraftBukkit end
|
||||
+ // Paper end
|
||||
@@ -60,10 +60,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
|
||||
return InteractionResultWrapper.a(itemstack, world.s_());
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/ItemEnderPearl.java b/src/main/java/net/minecraft/server/ItemEnderPearl.java
|
||||
diff --git a/src/main/java/net/minecraft/world/item/ItemEnderPearl.java b/src/main/java/net/minecraft/world/item/ItemEnderPearl.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/ItemEnderPearl.java
|
||||
+++ b/src/main/java/net/minecraft/server/ItemEnderPearl.java
|
||||
--- a/src/main/java/net/minecraft/world/item/ItemEnderPearl.java
|
||||
+++ b/src/main/java/net/minecraft/world/item/ItemEnderPearl.java
|
||||
@@ -0,0 +0,0 @@ public class ItemEnderPearl extends Item {
|
||||
|
||||
entityenderpearl.setItem(itemstack);
|
||||
@@ -74,20 +74,20 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ if (event.callEvent() && world.addEntity(entityenderpearl)) {
|
||||
+ if (event.shouldConsume() && !entityhuman.abilities.canInstantlyBuild) {
|
||||
+ itemstack.subtract(1);
|
||||
+ } else if (entityhuman instanceof EntityPlayer) {
|
||||
+ ((EntityPlayer) entityhuman).getBukkitEntity().updateInventory();
|
||||
+ } else if (entityhuman instanceof net.minecraft.server.level.EntityPlayer) {
|
||||
+ ((net.minecraft.server.level.EntityPlayer) entityhuman).getBukkitEntity().updateInventory();
|
||||
+ }
|
||||
+
|
||||
+ world.playSound((EntityHuman) null, entityhuman.locX(), entityhuman.locY(), entityhuman.locZ(), SoundEffects.ENTITY_ENDER_PEARL_THROW, SoundCategory.NEUTRAL, 0.5F, 0.4F / (Entity.SHARED_RANDOM.nextFloat() * 0.4F + 0.8F));
|
||||
+ world.playSound((EntityHuman) null, entityhuman.locX(), entityhuman.locY(), entityhuman.locZ(), SoundEffects.ENTITY_ENDER_PEARL_THROW, SoundCategory.NEUTRAL, 0.5F, 0.4F / (net.minecraft.world.entity.Entity.SHARED_RANDOM.nextFloat() * 0.4F + 0.8F));
|
||||
+ entityhuman.b(StatisticList.ITEM_USED.b(this));
|
||||
+ entityhuman.getCooldownTracker().setCooldown(this, 20);
|
||||
+ } else {
|
||||
+ // Paper end
|
||||
if (entityhuman instanceof EntityPlayer) {
|
||||
((EntityPlayer) entityhuman).getBukkitEntity().updateInventory();
|
||||
if (entityhuman instanceof net.minecraft.server.level.EntityPlayer) {
|
||||
((net.minecraft.server.level.EntityPlayer) entityhuman).getBukkitEntity().updateInventory();
|
||||
}
|
||||
- return new InteractionResultWrapper(EnumInteractionResult.FAIL, itemstack);
|
||||
+ return new InteractionResultWrapper<ItemStack>(EnumInteractionResult.FAIL, itemstack);
|
||||
- return InteractionResultWrapper.fail(itemstack);
|
||||
+ return new InteractionResultWrapper<ItemStack>(net.minecraft.world.EnumInteractionResult.FAIL, itemstack);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -112,10 +112,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
|
||||
return InteractionResultWrapper.a(itemstack, world.s_());
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/ItemExpBottle.java b/src/main/java/net/minecraft/server/ItemExpBottle.java
|
||||
diff --git a/src/main/java/net/minecraft/world/item/ItemExpBottle.java b/src/main/java/net/minecraft/world/item/ItemExpBottle.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/ItemExpBottle.java
|
||||
+++ b/src/main/java/net/minecraft/server/ItemExpBottle.java
|
||||
--- a/src/main/java/net/minecraft/world/item/ItemExpBottle.java
|
||||
+++ b/src/main/java/net/minecraft/world/item/ItemExpBottle.java
|
||||
@@ -0,0 +0,0 @@ public class ItemExpBottle extends Item {
|
||||
public InteractionResultWrapper<ItemStack> a(World world, EntityHuman entityhuman, EnumHand enumhand) {
|
||||
ItemStack itemstack = entityhuman.b(enumhand);
|
||||
@@ -157,10 +157,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
|
||||
return InteractionResultWrapper.a(itemstack, world.s_());
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/ItemFireworks.java b/src/main/java/net/minecraft/server/ItemFireworks.java
|
||||
diff --git a/src/main/java/net/minecraft/world/item/ItemFireworks.java b/src/main/java/net/minecraft/world/item/ItemFireworks.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/ItemFireworks.java
|
||||
+++ b/src/main/java/net/minecraft/server/ItemFireworks.java
|
||||
--- a/src/main/java/net/minecraft/world/item/ItemFireworks.java
|
||||
+++ b/src/main/java/net/minecraft/world/item/ItemFireworks.java
|
||||
@@ -0,0 +0,0 @@ public class ItemFireworks extends Item {
|
||||
EntityFireworks entityfireworks = new EntityFireworks(world, itemactioncontext.getEntity(), vec3d.x + (double) enumdirection.getAdjacentX() * 0.15D, vec3d.y + (double) enumdirection.getAdjacentY() * 0.15D, vec3d.z + (double) enumdirection.getAdjacentZ() * 0.15D, itemstack);
|
||||
entityfireworks.spawningEntity = itemactioncontext.getEntity().getUniqueID(); // Paper
|
||||
@@ -176,10 +176,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
}
|
||||
|
||||
return EnumInteractionResult.a(world.isClientSide);
|
||||
diff --git a/src/main/java/net/minecraft/server/ItemLingeringPotion.java b/src/main/java/net/minecraft/server/ItemLingeringPotion.java
|
||||
diff --git a/src/main/java/net/minecraft/world/item/ItemLingeringPotion.java b/src/main/java/net/minecraft/world/item/ItemLingeringPotion.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/ItemLingeringPotion.java
|
||||
+++ b/src/main/java/net/minecraft/server/ItemLingeringPotion.java
|
||||
--- a/src/main/java/net/minecraft/world/item/ItemLingeringPotion.java
|
||||
+++ b/src/main/java/net/minecraft/world/item/ItemLingeringPotion.java
|
||||
@@ -0,0 +0,0 @@ public class ItemLingeringPotion extends ItemPotionThrowable {
|
||||
|
||||
@Override
|
||||
@@ -195,10 +195,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ // Paper end
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/ItemPotionThrowable.java b/src/main/java/net/minecraft/server/ItemPotionThrowable.java
|
||||
diff --git a/src/main/java/net/minecraft/world/item/ItemPotionThrowable.java b/src/main/java/net/minecraft/world/item/ItemPotionThrowable.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/ItemPotionThrowable.java
|
||||
+++ b/src/main/java/net/minecraft/server/ItemPotionThrowable.java
|
||||
--- a/src/main/java/net/minecraft/world/item/ItemPotionThrowable.java
|
||||
+++ b/src/main/java/net/minecraft/world/item/ItemPotionThrowable.java
|
||||
@@ -0,0 +0,0 @@ public class ItemPotionThrowable extends ItemPotion {
|
||||
|
||||
entitypotion.setItem(itemstack);
|
||||
@@ -232,10 +232,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
|
||||
return InteractionResultWrapper.a(itemstack, world.s_());
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/ItemSnowball.java b/src/main/java/net/minecraft/server/ItemSnowball.java
|
||||
diff --git a/src/main/java/net/minecraft/world/item/ItemSnowball.java b/src/main/java/net/minecraft/world/item/ItemSnowball.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/ItemSnowball.java
|
||||
+++ b/src/main/java/net/minecraft/server/ItemSnowball.java
|
||||
--- a/src/main/java/net/minecraft/world/item/ItemSnowball.java
|
||||
+++ b/src/main/java/net/minecraft/world/item/ItemSnowball.java
|
||||
@@ -0,0 +0,0 @@ public class ItemSnowball extends Item {
|
||||
|
||||
entitysnowball.setItem(itemstack);
|
||||
@@ -248,23 +248,23 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ if (event.shouldConsume() && !entityhuman.abilities.canInstantlyBuild) {
|
||||
+ // Paper end
|
||||
itemstack.subtract(1);
|
||||
+ } else if (entityhuman instanceof EntityPlayer) { // Paper
|
||||
+ ((EntityPlayer) entityhuman).getBukkitEntity().updateInventory(); // Paper
|
||||
+ } else if (entityhuman instanceof net.minecraft.server.level.EntityPlayer) { // Paper
|
||||
+ ((net.minecraft.server.level.EntityPlayer) entityhuman).getBukkitEntity().updateInventory(); // Paper
|
||||
}
|
||||
|
||||
world.playSound((EntityHuman) null, entityhuman.locX(), entityhuman.locY(), entityhuman.locZ(), SoundEffects.ENTITY_SNOWBALL_THROW, SoundCategory.NEUTRAL, 0.5F, 0.4F / (ItemSnowball.RANDOM.nextFloat() * 0.4F + 0.8F));
|
||||
- } else if (entityhuman instanceof EntityPlayer) {
|
||||
- ((EntityPlayer) entityhuman).getBukkitEntity().updateInventory();
|
||||
- } else if (entityhuman instanceof net.minecraft.server.level.EntityPlayer) {
|
||||
- ((net.minecraft.server.level.EntityPlayer) entityhuman).getBukkitEntity().updateInventory();
|
||||
+ } else { // Paper
|
||||
+ if (entityhuman instanceof EntityPlayer) ((EntityPlayer) entityhuman).getBukkitEntity().updateInventory(); // Paper
|
||||
+ return new InteractionResultWrapper<ItemStack>(EnumInteractionResult.FAIL, itemstack); // Paper
|
||||
+ if (entityhuman instanceof net.minecraft.server.level.EntityPlayer) ((net.minecraft.server.level.EntityPlayer) entityhuman).getBukkitEntity().updateInventory(); // Paper
|
||||
+ return new InteractionResultWrapper<ItemStack>(net.minecraft.world.EnumInteractionResult.FAIL, itemstack); // Paper
|
||||
}
|
||||
}
|
||||
// CraftBukkit end
|
||||
diff --git a/src/main/java/net/minecraft/server/ItemSplashPotion.java b/src/main/java/net/minecraft/server/ItemSplashPotion.java
|
||||
diff --git a/src/main/java/net/minecraft/world/item/ItemSplashPotion.java b/src/main/java/net/minecraft/world/item/ItemSplashPotion.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/ItemSplashPotion.java
|
||||
+++ b/src/main/java/net/minecraft/server/ItemSplashPotion.java
|
||||
--- a/src/main/java/net/minecraft/world/item/ItemSplashPotion.java
|
||||
+++ b/src/main/java/net/minecraft/world/item/ItemSplashPotion.java
|
||||
@@ -0,0 +0,0 @@ public class ItemSplashPotion extends ItemPotionThrowable {
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user