3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-11-15 12:30:06 +01:00

Update to Minecraft 1.16.1

Dieser Commit ist enthalten in:
md_5 2020-06-25 10:00:00 +10:00
Ursprung be6aaf046e
Commit 7ea3c040bc
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: E8E901AC7C617C11
424 geänderte Dateien mit 5960 neuen und 5636 gelöschten Zeilen

Datei anzeigen

@ -1,6 +1,6 @@
--- a/net/minecraft/server/Advancement.java --- a/net/minecraft/server/Advancement.java
+++ b/net/minecraft/server/Advancement.java +++ b/net/minecraft/server/Advancement.java
@@ -27,6 +27,7 @@ @@ -26,6 +26,7 @@
private final String[][] requirements; private final String[][] requirements;
private final Set<Advancement> children = Sets.newLinkedHashSet(); private final Set<Advancement> children = Sets.newLinkedHashSet();
private final IChatBaseComponent chatComponent; private final IChatBaseComponent chatComponent;
@ -8,7 +8,7 @@
public Advancement(MinecraftKey minecraftkey, @Nullable Advancement advancement, @Nullable AdvancementDisplay advancementdisplay, AdvancementRewards advancementrewards, Map<String, Criterion> map, String[][] astring) { public Advancement(MinecraftKey minecraftkey, @Nullable Advancement advancement, @Nullable AdvancementDisplay advancementdisplay, AdvancementRewards advancementrewards, Map<String, Criterion> map, String[][] astring) {
this.key = minecraftkey; this.key = minecraftkey;
@@ -210,7 +211,7 @@ @@ -209,7 +210,7 @@
} }
public Advancement b(MinecraftKey minecraftkey) { public Advancement b(MinecraftKey minecraftkey) {

Datei anzeigen

@ -1,23 +1,23 @@
--- a/net/minecraft/server/AdvancementDataPlayer.java --- a/net/minecraft/server/AdvancementDataPlayer.java
+++ b/net/minecraft/server/AdvancementDataPlayer.java +++ b/net/minecraft/server/AdvancementDataPlayer.java
@@ -160,7 +160,11 @@ @@ -163,7 +163,11 @@
Advancement advancement = this.d.getAdvancementData().a((MinecraftKey) entry.getKey()); Advancement advancement = advancementdataworld.a((MinecraftKey) entry.getKey());
if (advancement == null) { if (advancement == null) {
- AdvancementDataPlayer.LOGGER.warn("Ignored advancement '{}' in progress file {} - it doesn't exist anymore?", entry.getKey(), this.e); - AdvancementDataPlayer.LOGGER.warn("Ignored advancement '{}' in progress file {} - it doesn't exist anymore?", entry.getKey(), this.f);
+ // CraftBukkit start + // CraftBukkit start
+ if (entry.getKey().getNamespace().equals("minecraft")) { + if (entry.getKey().getNamespace().equals("minecraft")) {
+ AdvancementDataPlayer.LOGGER.warn("Ignored advancement '{}' in progress file {} - it doesn't exist anymore?", entry.getKey(), this.e); + AdvancementDataPlayer.LOGGER.warn("Ignored advancement '{}' in progress file {} - it doesn't exist anymore?", entry.getKey(), this.f);
+ } + }
+ // CraftBukkit end + // CraftBukkit end
} else { } else {
this.a(advancement, (AdvancementProgress) entry.getValue()); this.a(advancement, (AdvancementProgress) entry.getValue());
} }
@@ -275,6 +279,7 @@ @@ -278,6 +282,7 @@
this.i.add(advancement); this.j.add(advancement);
flag = true; flag = true;
if (!flag1 && advancementprogress.isDone()) { if (!flag1 && advancementprogress.isDone()) {
+ this.player.world.getServer().getPluginManager().callEvent(new org.bukkit.event.player.PlayerAdvancementDoneEvent(this.player.getBukkitEntity(), advancement.bukkit)); // CraftBukkit + this.player.world.getServer().getPluginManager().callEvent(new org.bukkit.event.player.PlayerAdvancementDoneEvent(this.player.getBukkitEntity(), advancement.bukkit)); // CraftBukkit
advancement.d().a(this.player); advancement.d().a(this.player);
if (advancement.c() != null && advancement.c().i() && this.player.world.getGameRules().getBoolean(GameRules.ANNOUNCE_ADVANCEMENTS)) { if (advancement.c() != null && advancement.c().i() && this.player.world.getGameRules().getBoolean(GameRules.ANNOUNCE_ADVANCEMENTS)) {
this.d.getPlayerList().sendMessage(new ChatMessage("chat.type.advancement." + advancement.c().e().a(), new Object[]{this.player.getScoreboardDisplayName(), advancement.j()})); this.e.sendMessage(new ChatMessage("chat.type.advancement." + advancement.c().e().a(), new Object[]{this.player.getScoreboardDisplayName(), advancement.j()}), ChatMessageType.SYSTEM, SystemUtils.b);

Datei anzeigen

@ -1,7 +1,7 @@
--- a/net/minecraft/server/ArgumentBlock.java --- a/net/minecraft/server/ArgumentBlock.java
+++ b/net/minecraft/server/ArgumentBlock.java +++ b/net/minecraft/server/ArgumentBlock.java
@@ -41,7 +41,7 @@ @@ -43,7 +43,7 @@
private static final Function<SuggestionsBuilder, CompletableFuture<Suggestions>> h = SuggestionsBuilder::buildFuture; };
private final StringReader i; private final StringReader i;
private final boolean j; private final boolean j;
- private final Map<IBlockState<?>, Comparable<?>> k = Maps.newHashMap(); - private final Map<IBlockState<?>, Comparable<?>> k = Maps.newHashMap();
@ -9,7 +9,7 @@
private final Map<String, String> l = Maps.newHashMap(); private final Map<String, String> l = Maps.newHashMap();
private MinecraftKey m = new MinecraftKey(""); private MinecraftKey m = new MinecraftKey("");
private BlockStateList<Block, IBlockData> n; private BlockStateList<Block, IBlockData> n;
@@ -217,7 +217,7 @@ @@ -219,7 +219,7 @@
Iterator iterator = iblockstate.getValues().iterator(); Iterator iterator = iblockstate.getValues().iterator();
while (iterator.hasNext()) { while (iterator.hasNext()) {
@ -18,7 +18,7 @@
if (t0 instanceof Integer) { if (t0 instanceof Integer) {
suggestionsbuilder.suggest((Integer) t0); suggestionsbuilder.suggest((Integer) t0);
@@ -486,7 +486,7 @@ @@ -488,7 +488,7 @@
Optional<T> optional = iblockstate.b(s); Optional<T> optional = iblockstate.b(s);
if (optional.isPresent()) { if (optional.isPresent()) {
@ -27,12 +27,12 @@
this.k.put(iblockstate, optional.get()); this.k.put(iblockstate, optional.get());
} else { } else {
this.i.setCursor(i); this.i.setCursor(i);
@@ -520,7 +520,7 @@ @@ -522,7 +522,7 @@
private static <T extends Comparable<T>> void a(StringBuilder stringbuilder, IBlockState<T> iblockstate, Comparable<?> comparable) { private static <T extends Comparable<T>> void a(StringBuilder stringbuilder, IBlockState<T> iblockstate, Comparable<?> comparable) {
stringbuilder.append(iblockstate.a()); stringbuilder.append(iblockstate.getName());
stringbuilder.append('='); stringbuilder.append('=');
- stringbuilder.append(iblockstate.a(comparable)); - stringbuilder.append(iblockstate.a(comparable));
+ stringbuilder.append(iblockstate.a((T) comparable)); // CraftBukkit - decompile error + stringbuilder.append(iblockstate.a((T) comparable)); // CraftBukkit - decompile error
} }
public CompletableFuture<Suggestions> a(SuggestionsBuilder suggestionsbuilder) { public CompletableFuture<Suggestions> a(SuggestionsBuilder suggestionsbuilder, Tags<Block> tags) {

Datei anzeigen

@ -1,6 +1,6 @@
--- a/net/minecraft/server/AttributeRanged.java --- a/net/minecraft/server/AttributeRanged.java
+++ b/net/minecraft/server/AttributeRanged.java +++ b/net/minecraft/server/AttributeRanged.java
@@ -32,6 +32,8 @@ @@ -20,6 +20,8 @@
@Override @Override
public double a(double d0) { public double a(double d0) {

Datei anzeigen

@ -1,9 +1,9 @@
--- a/net/minecraft/server/BehaviorCareer.java --- a/net/minecraft/server/BehaviorCareer.java
+++ b/net/minecraft/server/BehaviorCareer.java +++ b/net/minecraft/server/BehaviorCareer.java
@@ -1,6 +1,11 @@ @@ -2,6 +2,11 @@
package net.minecraft.server;
import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableMap;
import java.util.Optional;
+// CraftBukkit start +// CraftBukkit start
+import org.bukkit.craftbukkit.entity.CraftVillager; +import org.bukkit.craftbukkit.entity.CraftVillager;
+import org.bukkit.craftbukkit.event.CraftEventFactory; +import org.bukkit.craftbukkit.event.CraftEventFactory;
@ -12,10 +12,19 @@
public class BehaviorCareer extends Behavior<EntityVillager> { public class BehaviorCareer extends Behavior<EntityVillager> {
@@ -20,7 +25,14 @@ @@ -19,7 +24,7 @@
IRegistry.VILLAGER_PROFESSION.d().filter((villagerprofession) -> { GlobalPos globalpos = (GlobalPos) entityvillager.getBehaviorController().getMemory(MemoryModuleType.POTENTIAL_JOB_SITE).get();
return villagerprofession.b() == villageplacetype;
}).findFirst().ifPresent((villagerprofession) -> { entityvillager.getBehaviorController().removeMemory(MemoryModuleType.POTENTIAL_JOB_SITE);
- entityvillager.getBehaviorController().setMemory(MemoryModuleType.JOB_SITE, (Object) globalpos);
+ entityvillager.getBehaviorController().setMemory(MemoryModuleType.JOB_SITE, globalpos); // CraftBukkit - decompile error
if (entityvillager.getVillagerData().getProfession() == VillagerProfession.NONE) {
MinecraftServer minecraftserver = worldserver.getMinecraftServer();
@@ -30,7 +35,14 @@
return villagerprofession.b() == villageplacetype;
}).findFirst();
}).ifPresent((villagerprofession) -> {
- entityvillager.setVillagerData(entityvillager.getVillagerData().withProfession(villagerprofession)); - entityvillager.setVillagerData(entityvillager.getVillagerData().withProfession(villagerprofession));
+ // CraftBukkit start - Fire VillagerCareerChangeEvent where Villager gets employed + // CraftBukkit start - Fire VillagerCareerChangeEvent where Villager gets employed
+ VillagerCareerChangeEvent event = CraftEventFactory.callVillagerCareerChangeEvent(entityvillager, CraftVillager.nmsToBukkitProfession(villagerprofession), VillagerCareerChangeEvent.ChangeReason.EMPLOYED); + VillagerCareerChangeEvent event = CraftEventFactory.callVillagerCareerChangeEvent(entityvillager, CraftVillager.nmsToBukkitProfession(villagerprofession), VillagerCareerChangeEvent.ChangeReason.EMPLOYED);
@ -25,6 +34,6 @@
+ +
+ entityvillager.setVillagerData(entityvillager.getVillagerData().withProfession(CraftVillager.bukkitToNmsProfession(event.getProfession()))); + entityvillager.setVillagerData(entityvillager.getVillagerData().withProfession(CraftVillager.bukkitToNmsProfession(event.getProfession())));
+ // CraftBukkit end + // CraftBukkit end
entityvillager.a(worldserver); entityvillager.b(worldserver);
}); });
}); }

Datei anzeigen

@ -1,70 +1,70 @@
--- a/net/minecraft/server/BehaviorFarm.java --- a/net/minecraft/server/BehaviorFarm.java
+++ b/net/minecraft/server/BehaviorFarm.java +++ b/net/minecraft/server/BehaviorFarm.java
@@ -79,8 +79,8 @@ @@ -58,8 +58,8 @@
protected void a(WorldServer worldserver, EntityVillager entityvillager, long i) { protected void a(WorldServer worldserver, EntityVillager entityvillager, long i) {
if (i > this.d && this.a != null) { if (i > this.c && this.farmBlock != null) {
- entityvillager.getBehaviorController().setMemory(MemoryModuleType.LOOK_TARGET, (Object) (new BehaviorTarget(this.a))); - entityvillager.getBehaviorController().setMemory(MemoryModuleType.LOOK_TARGET, (Object) (new BehaviorTarget(this.farmBlock)));
- entityvillager.getBehaviorController().setMemory(MemoryModuleType.WALK_TARGET, (Object) (new MemoryTarget(new BehaviorTarget(this.a), 0.5F, 1))); - entityvillager.getBehaviorController().setMemory(MemoryModuleType.WALK_TARGET, (Object) (new MemoryTarget(new BehaviorTarget(this.farmBlock), 0.5F, 1)));
+ entityvillager.getBehaviorController().setMemory(MemoryModuleType.LOOK_TARGET, (new BehaviorTarget(this.a))); // CraftBukkit - decompile error + entityvillager.getBehaviorController().setMemory(MemoryModuleType.LOOK_TARGET, (new BehaviorTarget(this.farmBlock))); // CraftBukkit - decompile error
+ entityvillager.getBehaviorController().setMemory(MemoryModuleType.WALK_TARGET, (new MemoryTarget(new BehaviorTarget(this.a), 0.5F, 1))); // CraftBukkit - decompile error + entityvillager.getBehaviorController().setMemory(MemoryModuleType.WALK_TARGET, (new MemoryTarget(new BehaviorTarget(this.farmBlock), 0.5F, 1))); // CraftBukkit - decompile error
} }
} }
@@ -99,7 +99,11 @@ @@ -79,7 +79,11 @@
Block block1 = worldserver.getType(this.a.down()).getBlock(); Block block1 = worldserver.getType(this.farmBlock.down()).getBlock();
if (block instanceof BlockCrops && ((BlockCrops) block).isRipe(iblockdata) && this.c) { if (block instanceof BlockCrops && ((BlockCrops) block).isRipe(iblockdata)) {
- worldserver.a(this.a, true, entityvillager); - worldserver.a(this.farmBlock, true, entityvillager);
+ // CraftBukkit start + // CraftBukkit start
+ if (!org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(entityvillager, this.a, Blocks.AIR.getBlockData()).isCancelled()) { + if (!org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(entityvillager, this.farmBlock, Blocks.AIR.getBlockData()).isCancelled()) {
+ worldserver.a(this.a, true, entityvillager); + worldserver.a(this.farmBlock, true, entityvillager);
+ } + }
+ // CraftBukkit end + // CraftBukkit end
} }
if (iblockdata.isAir() && block1 instanceof BlockSoil && this.b) { if (iblockdata.isAir() && block1 instanceof BlockSoil && entityvillager.canPlant()) {
@@ -110,19 +114,28 @@ @@ -90,19 +94,28 @@
boolean flag = false; boolean flag = false;
if (!itemstack.isEmpty()) { if (!itemstack.isEmpty()) {
+ // CraftBukkit start + // CraftBukkit start
+ Block planted = null; + Block planted = null;
if (itemstack.getItem() == Items.WHEAT_SEEDS) { if (itemstack.getItem() == Items.WHEAT_SEEDS) {
- worldserver.setTypeAndData(this.a, Blocks.WHEAT.getBlockData(), 3); - worldserver.setTypeAndData(this.farmBlock, Blocks.WHEAT.getBlockData(), 3);
+ planted = Blocks.WHEAT; + planted = Blocks.WHEAT;
flag = true; flag = true;
} else if (itemstack.getItem() == Items.POTATO) { } else if (itemstack.getItem() == Items.POTATO) {
- worldserver.setTypeAndData(this.a, Blocks.POTATOES.getBlockData(), 3); - worldserver.setTypeAndData(this.farmBlock, Blocks.POTATOES.getBlockData(), 3);
+ planted = Blocks.POTATOES; + planted = Blocks.POTATOES;
flag = true; flag = true;
} else if (itemstack.getItem() == Items.CARROT) { } else if (itemstack.getItem() == Items.CARROT) {
- worldserver.setTypeAndData(this.a, Blocks.CARROTS.getBlockData(), 3); - worldserver.setTypeAndData(this.farmBlock, Blocks.CARROTS.getBlockData(), 3);
+ planted = Blocks.CARROTS; + planted = Blocks.CARROTS;
flag = true; flag = true;
} else if (itemstack.getItem() == Items.BEETROOT_SEEDS) { } else if (itemstack.getItem() == Items.BEETROOT_SEEDS) {
- worldserver.setTypeAndData(this.a, Blocks.BEETROOTS.getBlockData(), 3); - worldserver.setTypeAndData(this.farmBlock, Blocks.BEETROOTS.getBlockData(), 3);
+ planted = Blocks.BEETROOTS; + planted = Blocks.BEETROOTS;
flag = true; flag = true;
} }
+ +
+ if (planted != null && !org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(entityvillager, this.a, planted.getBlockData()).isCancelled()) { + if (planted != null && !org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(entityvillager, this.farmBlock, planted.getBlockData()).isCancelled()) {
+ worldserver.setTypeAndData(this.a, planted.getBlockData(), 3); + worldserver.setTypeAndData(this.farmBlock, planted.getBlockData(), 3);
+ } else { + } else {
+ flag = false; + flag = false;
+ } + }
+ // CraftBukkit end + // CraftBukkit end
} }
if (flag) { if (flag) {
@@ -141,8 +154,8 @@ @@ -121,8 +134,8 @@
this.a = this.a(worldserver); this.farmBlock = this.a(worldserver);
if (this.a != null) { if (this.farmBlock != null) {
this.d = i + 20L; this.c = i + 20L;
- entityvillager.getBehaviorController().setMemory(MemoryModuleType.WALK_TARGET, (Object) (new MemoryTarget(new BehaviorTarget(this.a), 0.5F, 1))); - entityvillager.getBehaviorController().setMemory(MemoryModuleType.WALK_TARGET, (Object) (new MemoryTarget(new BehaviorTarget(this.farmBlock), 0.5F, 1)));
- entityvillager.getBehaviorController().setMemory(MemoryModuleType.LOOK_TARGET, (Object) (new BehaviorTarget(this.a))); - entityvillager.getBehaviorController().setMemory(MemoryModuleType.LOOK_TARGET, (Object) (new BehaviorTarget(this.farmBlock)));
+ entityvillager.getBehaviorController().setMemory(MemoryModuleType.WALK_TARGET, (new MemoryTarget(new BehaviorTarget(this.a), 0.5F, 1))); // CraftBukkit - decompile error + entityvillager.getBehaviorController().setMemory(MemoryModuleType.WALK_TARGET, (new MemoryTarget(new BehaviorTarget(this.farmBlock), 0.5F, 1))); // CraftBukkit - decompile error
+ entityvillager.getBehaviorController().setMemory(MemoryModuleType.LOOK_TARGET, (new BehaviorTarget(this.a))); // CraftBukkit - decompile error + entityvillager.getBehaviorController().setMemory(MemoryModuleType.LOOK_TARGET, (new BehaviorTarget(this.farmBlock))); // CraftBukkit - decompile error
}
} }
} }
}

Datei anzeigen

@ -12,7 +12,7 @@
+ } + }
+ // CaftBukkit end + // CaftBukkit end
((BlockDoor) block).setDoor(worldserver, blockposition, flag); ((BlockDoor) block).setDoor(worldserver, blockposition, flag);
GlobalPos globalpos = GlobalPos.create(worldserver.getWorldProvider().getDimensionManager(), blockposition); GlobalPos globalpos = GlobalPos.create(worldserver.getDimensionKey(), blockposition);
if (!behaviorcontroller.getMemory(MemoryModuleType.OPENED_DOORS).isPresent() && flag) { if (!behaviorcontroller.getMemory(MemoryModuleType.OPENED_DOORS).isPresent() && flag) {
- behaviorcontroller.setMemory(MemoryModuleType.OPENED_DOORS, (Object) Sets.newHashSet(new GlobalPos[]{globalpos})); - behaviorcontroller.setMemory(MemoryModuleType.OPENED_DOORS, (Object) Sets.newHashSet(new GlobalPos[]{globalpos}));

Datei anzeigen

@ -1,6 +1,6 @@
--- a/net/minecraft/server/BehaviorMakeLove.java --- a/net/minecraft/server/BehaviorMakeLove.java
+++ b/net/minecraft/server/BehaviorMakeLove.java +++ b/net/minecraft/server/BehaviorMakeLove.java
@@ -100,6 +100,11 @@ @@ -93,6 +93,11 @@
private Optional<EntityVillager> a(EntityVillager entityvillager, EntityVillager entityvillager1) { private Optional<EntityVillager> a(EntityVillager entityvillager, EntityVillager entityvillager1) {
EntityVillager entityvillager2 = entityvillager.createChild(entityvillager1); EntityVillager entityvillager2 = entityvillager.createChild(entityvillager1);
@ -12,7 +12,7 @@
if (entityvillager2 == null) { if (entityvillager2 == null) {
return Optional.empty(); return Optional.empty();
@@ -108,7 +113,7 @@ @@ -101,7 +106,7 @@
entityvillager1.setAgeRaw(6000); entityvillager1.setAgeRaw(6000);
entityvillager2.setAgeRaw(-24000); entityvillager2.setAgeRaw(-24000);
entityvillager2.setPositionRotation(entityvillager.locX(), entityvillager.locY(), entityvillager.locZ(), 0.0F, 0.0F); entityvillager2.setPositionRotation(entityvillager.locX(), entityvillager.locY(), entityvillager.locZ(), 0.0F, 0.0F);
@ -21,9 +21,9 @@
entityvillager.world.broadcastEntityEffect(entityvillager2, (byte) 12); entityvillager.world.broadcastEntityEffect(entityvillager2, (byte) 12);
return Optional.of(entityvillager2); return Optional.of(entityvillager2);
} }
@@ -117,6 +122,6 @@ @@ -110,6 +115,6 @@
private void a(WorldServer worldserver, EntityVillager entityvillager, BlockPosition blockposition) { private void a(WorldServer worldserver, EntityVillager entityvillager, BlockPosition blockposition) {
GlobalPos globalpos = GlobalPos.create(worldserver.getWorldProvider().getDimensionManager(), blockposition); GlobalPos globalpos = GlobalPos.create(worldserver.getDimensionKey(), blockposition);
- entityvillager.getBehaviorController().setMemory(MemoryModuleType.HOME, (Object) globalpos); - entityvillager.getBehaviorController().setMemory(MemoryModuleType.HOME, (Object) globalpos);
+ entityvillager.getBehaviorController().setMemory(MemoryModuleType.HOME, globalpos); // CraftBukkit - decompile error + entityvillager.getBehaviorController().setMemory(MemoryModuleType.HOME, globalpos); // CraftBukkit - decompile error

Datei anzeigen

@ -25,6 +25,6 @@
+ +
+ entityvillager.setVillagerData(entityvillager.getVillagerData().withProfession(CraftVillager.bukkitToNmsProfession(event.getProfession()))); + entityvillager.setVillagerData(entityvillager.getVillagerData().withProfession(CraftVillager.bukkitToNmsProfession(event.getProfession())));
+ // CraftBukkit end + // CraftBukkit end
entityvillager.a(worldserver); entityvillager.b(worldserver);
} }
} }

Datei anzeigen

@ -1,30 +1,39 @@
--- a/net/minecraft/server/BehaviorUtil.java --- a/net/minecraft/server/BehaviorUtil.java
+++ b/net/minecraft/server/BehaviorUtil.java +++ b/net/minecraft/server/BehaviorUtil.java
@@ -31,7 +31,7 @@ @@ -38,7 +38,7 @@
} }
public static void c(EntityLiving entityliving, EntityLiving entityliving1) { public static void a(EntityLiving entityliving, EntityLiving entityliving1) {
- entityliving.getBehaviorController().setMemory(MemoryModuleType.LOOK_TARGET, (Object) (new BehaviorPositionEntity(entityliving1))); - entityliving.getBehaviorController().setMemory(MemoryModuleType.LOOK_TARGET, (Object) (new BehaviorPositionEntity(entityliving1, true)));
+ entityliving.getBehaviorController().setMemory(MemoryModuleType.LOOK_TARGET, (new BehaviorPositionEntity(entityliving1))); // CraftBukkit - decompile error + entityliving.getBehaviorController().setMemory(MemoryModuleType.LOOK_TARGET, (new BehaviorPositionEntity(entityliving1, true))); // CraftBukkit - decompile error
} }
public static void d(EntityLiving entityliving, EntityLiving entityliving1) { private static void b(EntityLiving entityliving, EntityLiving entityliving1, float f) {
@@ -46,11 +46,12 @@ @@ -51,18 +51,19 @@
BehaviorPositionEntity behaviorpositionentity = new BehaviorPositionEntity(entityliving1); public static void a(EntityLiving entityliving, Entity entity, float f, int i) {
MemoryTarget memorytarget = new MemoryTarget(behaviorpositionentity, f, i); MemoryTarget memorytarget = new MemoryTarget(new BehaviorPositionEntity(entity, false), f, i);
- entityliving.getBehaviorController().setMemory(MemoryModuleType.LOOK_TARGET, (Object) behaviorpositionentity); - entityliving.getBehaviorController().setMemory(MemoryModuleType.LOOK_TARGET, (Object) (new BehaviorPositionEntity(entity, true)));
- entityliving.getBehaviorController().setMemory(MemoryModuleType.WALK_TARGET, (Object) memorytarget); - entityliving.getBehaviorController().setMemory(MemoryModuleType.WALK_TARGET, (Object) memorytarget);
+ entityliving.getBehaviorController().setMemory(MemoryModuleType.LOOK_TARGET, behaviorpositionentity); // CraftBukkit - decompile error + entityliving.getBehaviorController().setMemory(MemoryModuleType.LOOK_TARGET, (new BehaviorPositionEntity(entity, true))); // CraftBukkit - decompile error
+ entityliving.getBehaviorController().setMemory(MemoryModuleType.WALK_TARGET, memorytarget); // CraftBukkit - decompile error + entityliving.getBehaviorController().setMemory(MemoryModuleType.WALK_TARGET, memorytarget); // CraftBukkit - decompile error
} }
public static void a(EntityLiving entityliving, ItemStack itemstack, EntityLiving entityliving1) { public static void a(EntityLiving entityliving, BlockPosition blockposition, float f, int i) {
MemoryTarget memorytarget = new MemoryTarget(new BehaviorTarget(blockposition), f, i);
- entityliving.getBehaviorController().setMemory(MemoryModuleType.LOOK_TARGET, (Object) (new BehaviorTarget(blockposition)));
- entityliving.getBehaviorController().setMemory(MemoryModuleType.WALK_TARGET, (Object) memorytarget);
+ entityliving.getBehaviorController().setMemory(MemoryModuleType.LOOK_TARGET, (new BehaviorTarget(blockposition))); // CraftBukkit - decompile error
+ entityliving.getBehaviorController().setMemory(MemoryModuleType.WALK_TARGET, memorytarget); // CraftBukkit - decompile error
}
public static void a(EntityLiving entityliving, ItemStack itemstack, Vec3D vec3d) {
+ if (itemstack.isEmpty()) return; // CraftBukkit - SPIGOT-4940: no empty loot + if (itemstack.isEmpty()) return; // CraftBukkit - SPIGOT-4940: no empty loot
double d0 = entityliving.getHeadY() - 0.30000001192092896D; double d0 = entityliving.getHeadY() - 0.30000001192092896D;
EntityItem entityitem = new EntityItem(entityliving.world, entityliving.locX(), d0, entityliving.locZ(), itemstack); EntityItem entityitem = new EntityItem(entityliving.world, entityliving.locX(), d0, entityliving.locZ(), itemstack);
BlockPosition blockposition = new BlockPosition(entityliving1); float f = 0.3F;
@@ -66,7 +67,7 @@ @@ -76,7 +77,7 @@
public static SectionPosition a(WorldServer worldserver, SectionPosition sectionposition, int i) { public static SectionPosition a(WorldServer worldserver, SectionPosition sectionposition, int i) {
int j = worldserver.b(sectionposition); int j = worldserver.b(sectionposition);

Datei anzeigen

@ -1,6 +1,6 @@
--- a/net/minecraft/server/Block.java --- a/net/minecraft/server/Block.java
+++ b/net/minecraft/server/Block.java +++ b/net/minecraft/server/Block.java
@@ -489,7 +489,13 @@ @@ -217,7 +217,13 @@
EntityItem entityitem = new EntityItem(world, (double) blockposition.getX() + d0, (double) blockposition.getY() + d1, (double) blockposition.getZ() + d2, itemstack); EntityItem entityitem = new EntityItem(world, (double) blockposition.getX() + d0, (double) blockposition.getY() + d1, (double) blockposition.getZ() + d2, itemstack);
entityitem.defaultPickupDelay(); entityitem.defaultPickupDelay();
@ -15,8 +15,8 @@
} }
} }
@@ -682,6 +688,12 @@ @@ -344,6 +350,12 @@
return "Block{" + IRegistry.BLOCK.getKey(this) + "}"; return this;
} }
+ // CraftBukkit start + // CraftBukkit start
@ -25,6 +25,6 @@
+ } + }
+ // CraftBukkit end + // CraftBukkit end
+ +
public static enum EnumRandomOffset { public static final class a {
NONE, XZ, XYZ; private final IBlockData a;

Datei anzeigen

@ -1,16 +1,16 @@
--- a/net/minecraft/server/BlockBamboo.java --- a/net/minecraft/server/BlockBamboo.java
+++ b/net/minecraft/server/BlockBamboo.java +++ b/net/minecraft/server/BlockBamboo.java
@@ -159,14 +159,18 @@ @@ -168,14 +168,18 @@
BlockPosition blockposition1 = blockposition.down(2); BlockPosition blockposition1 = blockposition.down(2);
IBlockData iblockdata2 = world.getType(blockposition1); IBlockData iblockdata2 = world.getType(blockposition1);
BlockPropertyBambooSize blockpropertybamboosize = BlockPropertyBambooSize.NONE; BlockPropertyBambooSize blockpropertybamboosize = BlockPropertyBambooSize.NONE;
+ boolean shouldUpdateOthers = false; // CraftBukkit + boolean shouldUpdateOthers = false; // CraftBukkit
if (i >= 1) { if (i >= 1) {
if (iblockdata1.getBlock() == Blocks.BAMBOO && iblockdata1.get(BlockBamboo.e) != BlockPropertyBambooSize.NONE) { if (iblockdata1.a(Blocks.BAMBOO) && iblockdata1.get(BlockBamboo.e) != BlockPropertyBambooSize.NONE) {
if (iblockdata1.getBlock() == Blocks.BAMBOO && iblockdata1.get(BlockBamboo.e) != BlockPropertyBambooSize.NONE) { if (iblockdata1.a(Blocks.BAMBOO) && iblockdata1.get(BlockBamboo.e) != BlockPropertyBambooSize.NONE) {
blockpropertybamboosize = BlockPropertyBambooSize.LARGE; blockpropertybamboosize = BlockPropertyBambooSize.LARGE;
if (iblockdata2.getBlock() == Blocks.BAMBOO) { if (iblockdata2.a(Blocks.BAMBOO)) {
- world.setTypeAndData(blockposition.down(), (IBlockData) iblockdata1.set(BlockBamboo.e, BlockPropertyBambooSize.SMALL), 3); - world.setTypeAndData(blockposition.down(), (IBlockData) iblockdata1.set(BlockBamboo.e, BlockPropertyBambooSize.SMALL), 3);
- world.setTypeAndData(blockposition1, (IBlockData) iblockdata2.set(BlockBamboo.e, BlockPropertyBambooSize.NONE), 3); - world.setTypeAndData(blockposition1, (IBlockData) iblockdata2.set(BlockBamboo.e, BlockPropertyBambooSize.NONE), 3);
+ // CraftBukkit start - moved down + // CraftBukkit start - moved down
@ -21,8 +21,8 @@
} }
} }
} else { } else {
@@ -177,7 +181,14 @@ @@ -186,7 +190,14 @@
int j = (Integer) iblockdata.get(BlockBamboo.d) != 1 && iblockdata2.getBlock() != Blocks.BAMBOO ? 0 : 1; int j = (Integer) iblockdata.get(BlockBamboo.d) != 1 && !iblockdata2.a(Blocks.BAMBOO) ? 0 : 1;
int k = (i < 11 || random.nextFloat() >= 0.25F) && i != 15 ? 0 : 1; int k = (i < 11 || random.nextFloat() >= 0.25F) && i != 15 ? 0 : 1;
- world.setTypeAndData(blockposition.up(), (IBlockData) ((IBlockData) ((IBlockData) this.getBlockData().set(BlockBamboo.d, j)).set(BlockBamboo.e, blockpropertybamboosize)).set(BlockBamboo.f, k), 3); - world.setTypeAndData(blockposition.up(), (IBlockData) ((IBlockData) ((IBlockData) this.getBlockData().set(BlockBamboo.d, j)).set(BlockBamboo.e, blockpropertybamboosize)).set(BlockBamboo.f, k), 3);

Datei anzeigen

@ -1,54 +1,67 @@
--- a/net/minecraft/server/BlockBed.java --- a/net/minecraft/server/BlockBed.java
+++ b/net/minecraft/server/BlockBed.java +++ b/net/minecraft/server/BlockBed.java
@@ -43,7 +43,8 @@ @@ -39,7 +39,8 @@
} }
} }
- if (world.worldProvider.canRespawn() && world.getBiome(blockposition) != Biomes.NETHER) { - if (!a(world)) {
+ // CraftBukkit - moved world and biome check into EntityHuman + // CraftBukkit - moved world and biome check into EntityHuman
+ if (true || world.worldProvider.canRespawn() && world.getBiome(blockposition) != Biomes.NETHER) { + if (false && !a(world)) {
if ((Boolean) iblockdata.get(BlockBed.OCCUPIED)) { world.a(blockposition, false);
if (!this.a(world, blockposition)) { BlockPosition blockposition1 = blockposition.shift(((EnumDirection) iblockdata.get(BlockBed.FACING)).opposite());
entityhuman.a((IChatBaseComponent) (new ChatMessage("block.minecraft.bed.occupied", new Object[0])), true);
@@ -51,7 +52,16 @@
return EnumInteractionResult.SUCCESS; @@ -56,7 +57,16 @@
} else {
+ // CraftBukkit start return EnumInteractionResult.SUCCESS;
+ IBlockData finaliblockdata = iblockdata;
+ BlockPosition finalblockposition = blockposition;
+ // CraftBukkit end
entityhuman.sleep(blockposition).ifLeft((entityhuman_enumbedresult) -> {
+ // CraftBukkit start - handling bed explosion from below here
+ if (entityhuman_enumbedresult == EntityHuman.EnumBedResult.NOT_POSSIBLE_HERE) {
+ this.explodeBed(finaliblockdata, world, finalblockposition);
+ } else
+ // CraftBukkit end
if (entityhuman_enumbedresult != null) {
entityhuman.a(entityhuman_enumbedresult.a(), true);
}
@@ -59,7 +69,14 @@
});
return EnumInteractionResult.SUCCESS;
}
+ // CraftBukkit start - moved bed explosion into separate method
} else { } else {
+ // CraftBukkit start
+ IBlockData finaliblockdata = iblockdata;
+ BlockPosition finalblockposition = blockposition;
+ // CraftBukkit end
entityhuman.sleep(blockposition).ifLeft((entityhuman_enumbedresult) -> {
+ // CraftBukkit start - handling bed explosion from below here
+ if (entityhuman_enumbedresult == EntityHuman.EnumBedResult.NOT_POSSIBLE_HERE) {
+ this.explodeBed(finaliblockdata, world, finalblockposition);
+ } else
+ // CraftBukkit end
if (entityhuman_enumbedresult != null) {
entityhuman.a(entityhuman_enumbedresult.a(), true);
}
@@ -67,8 +77,27 @@
}
}
+ // CraftBukkit start
+ private EnumInteractionResult explodeBed(IBlockData iblockdata, World world, BlockPosition blockposition) {
+ {
+ {
+ world.a(blockposition, false);
+ BlockPosition blockposition1 = blockposition.shift(((EnumDirection) iblockdata.get(BlockBed.FACING)).opposite());
+
+ if (world.getType(blockposition1).getBlock() == this) {
+ world.a(blockposition1, false);
+ }
+
+ world.createExplosion((Entity) null, DamageSource.a(), (ExplosionDamageCalculator) null, (double) blockposition.getX() + 0.5D, (double) blockposition.getY() + 0.5D, (double) blockposition.getZ() + 0.5D, 5.0F, true, Explosion.Effect.DESTROY);
+ return EnumInteractionResult.SUCCESS; + return EnumInteractionResult.SUCCESS;
+ } + }
+ } + }
+ } + }
+ // CraftBukkit end
+ +
+ private EnumInteractionResult explodeBed(IBlockData iblockdata, World world, BlockPosition blockposition) { public static boolean a(World world) {
world.a(blockposition, false); - return world.getDimensionManager().isBedWorks();
BlockPosition blockposition1 = blockposition.shift(((EnumDirection) iblockdata.get(BlockBed.FACING)).opposite()); + // CraftBukkit - moved world and biome check into EntityHuman
+ return true || world.getDimensionManager().isBedWorks();
@@ -69,8 +86,7 @@
world.createExplosion((Entity) null, DamageSource.a(), (double) blockposition.getX() + 0.5D, (double) blockposition.getY() + 0.5D, (double) blockposition.getZ() + 0.5D, 5.0F, true, Explosion.Effect.DESTROY);
return EnumInteractionResult.SUCCESS;
- }
- }
+ // CraftBukkit end
} }
private boolean a(World world, BlockPosition blockposition) { private boolean a(World world, BlockPosition blockposition) {
@@ -225,7 +254,7 @@
AxisAlignedBB axisalignedbb = entitytypes.a(vec3d.x, vec3d.y, vec3d.z);
if (iworldreader.b(axisalignedbb)) {
- Stream stream = iworldreader.a(axisalignedbb.b(0.0D, -0.20000000298023224D, 0.0D));
+ Stream<IBlockData> stream = iworldreader.a(axisalignedbb.b(0.0D, -0.20000000298023224D, 0.0D)); // CraftBukkit - decompile error
entitytypes.getClass();
if (stream.noneMatch(entitytypes::a)) {

Datei anzeigen

@ -12,7 +12,7 @@
public abstract class BlockButtonAbstract extends BlockAttachable { public abstract class BlockButtonAbstract extends BlockAttachable {
public static final BlockStateBoolean POWERED = BlockProperties.w; public static final BlockStateBoolean POWERED = BlockProperties.w;
@@ -71,6 +76,19 @@ @@ -70,6 +75,19 @@
if ((Boolean) iblockdata.get(BlockButtonAbstract.POWERED)) { if ((Boolean) iblockdata.get(BlockButtonAbstract.POWERED)) {
return EnumInteractionResult.CONSUME; return EnumInteractionResult.CONSUME;
} else { } else {
@ -31,9 +31,9 @@
+ // CraftBukkit end + // CraftBukkit end
this.d(iblockdata, world, blockposition); this.d(iblockdata, world, blockposition);
this.a(entityhuman, world, blockposition, true); this.a(entityhuman, world, blockposition, true);
return EnumInteractionResult.SUCCESS; return EnumInteractionResult.a(world.isClientSide);
@@ -121,6 +139,16 @@ @@ -120,6 +138,16 @@
if (this.D) { if (this.v) {
this.e(iblockdata, (World) worldserver, blockposition); this.e(iblockdata, (World) worldserver, blockposition);
} else { } else {
+ // CraftBukkit start + // CraftBukkit start
@ -47,9 +47,9 @@
+ } + }
+ // CraftBukkit end + // CraftBukkit end
worldserver.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockButtonAbstract.POWERED, false), 3); worldserver.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockButtonAbstract.POWERED, false), 3);
this.f(iblockdata, worldserver, blockposition); this.f(iblockdata, (World) worldserver, blockposition);
this.a((EntityHuman) null, worldserver, blockposition, false); this.a((EntityHuman) null, worldserver, blockposition, false);
@@ -141,7 +169,44 @@ @@ -140,7 +168,44 @@
boolean flag = !list.isEmpty(); boolean flag = !list.isEmpty();
boolean flag1 = (Boolean) iblockdata.get(BlockButtonAbstract.POWERED); boolean flag1 = (Boolean) iblockdata.get(BlockButtonAbstract.POWERED);

Datei anzeigen

@ -8,17 +8,17 @@
+ +
public class BlockCactus extends Block { public class BlockCactus extends Block {
public static final BlockStateInteger AGE = BlockProperties.ad; public static final BlockStateInteger AGE = BlockProperties.aj;
@@ -32,7 +34,7 @@ @@ -37,7 +39,7 @@
int j = (Integer) iblockdata.get(BlockCactus.AGE); int j = (Integer) iblockdata.get(BlockCactus.AGE);
if (j == 15) { if (j == 15) {
- worldserver.setTypeUpdate(blockposition1, this.getBlockData()); - worldserver.setTypeUpdate(blockposition1, this.getBlockData());
+ CraftEventFactory.handleBlockGrowEvent(worldserver, blockposition1, this.getBlockData()); // CraftBukkit + CraftEventFactory.handleBlockGrowEvent(worldserver, blockposition1, this.getBlockData()); // CraftBukkit
IBlockData iblockdata1 = (IBlockData) iblockdata.set(BlockCactus.AGE, 0); IBlockData iblockdata1 = (IBlockData) iblockdata.set(BlockCactus.AGE, 0);
worldserver.setTypeAndData(blockposition, iblockdata1, 4); worldserver.setTypeAndData(blockposition, iblockdata1, 4);
@@ -90,7 +92,9 @@ @@ -94,7 +96,9 @@
@Override @Override
public void a(IBlockData iblockdata, World world, BlockPosition blockposition, Entity entity) { public void a(IBlockData iblockdata, World world, BlockPosition blockposition, Entity entity) {

Datei anzeigen

@ -1,14 +1,14 @@
--- a/net/minecraft/server/BlockCampfire.java --- a/net/minecraft/server/BlockCampfire.java
+++ b/net/minecraft/server/BlockCampfire.java +++ b/net/minecraft/server/BlockCampfire.java
@@ -148,6 +148,11 @@ @@ -144,6 +144,11 @@
if (flag1 && !(Boolean) iblockdata.get(BlockCampfire.b) && !(Boolean) iblockdata.get(BlockCampfire.d)) { if (flag && !(Boolean) iblockdata.get(BlockCampfire.b) && !(Boolean) iblockdata.get(BlockCampfire.d)) {
BlockPosition blockposition = movingobjectpositionblock.getBlockPosition(); BlockPosition blockposition = movingobjectpositionblock.getBlockPosition();
+ // CraftBukkit start + // CraftBukkit start
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callBlockIgniteEvent(world, blockposition, entity).isCancelled()) { + if (org.bukkit.craftbukkit.event.CraftEventFactory.callBlockIgniteEvent(world, blockposition, entity).isCancelled()) {
+ return; + return;
+ } + }
+ // CraftBukkit end + // CraftBukkit end
world.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockProperties.r, true), 11); world.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockProperties.r, true), 11);
}
} }
}

Datei anzeigen

@ -7,7 +7,7 @@
+ +
public class BlockCauldron extends Block { public class BlockCauldron extends Block {
public static final BlockStateInteger LEVEL = BlockProperties.al; public static final BlockStateInteger LEVEL = BlockProperties.ar;
@@ -27,8 +29,13 @@ @@ -27,8 +29,13 @@
float f = (float) blockposition.getY() + (6.0F + (float) (3 * i)) / 16.0F; float f = (float) blockposition.getY() + (6.0F + (float) (3 * i)) / 16.0F;
@ -42,7 +42,7 @@
world.playSound((EntityHuman) null, blockposition, SoundEffects.ITEM_BUCKET_EMPTY, SoundCategory.BLOCKS, 1.0F, 1.0F); world.playSound((EntityHuman) null, blockposition, SoundEffects.ITEM_BUCKET_EMPTY, SoundCategory.BLOCKS, 1.0F, 1.0F);
} }
return EnumInteractionResult.SUCCESS; return EnumInteractionResult.a(world.isClientSide);
} else if (item == Items.BUCKET) { } else if (item == Items.BUCKET) {
if (i == 3 && !world.isClientSide) { if (i == 3 && !world.isClientSide) {
+ // CraftBukkit start + // CraftBukkit start
@ -82,7 +82,7 @@
+ // CraftBukkit end + // CraftBukkit end
} }
return EnumInteractionResult.SUCCESS; return EnumInteractionResult.a(world.isClientSide);
} else if (item == Items.POTION && PotionUtil.d(itemstack) == Potions.WATER) { } else if (item == Items.POTION && PotionUtil.d(itemstack) == Potions.WATER) {
if (i < 3 && !world.isClientSide) { if (i < 3 && !world.isClientSide) {
+ // CraftBukkit start + // CraftBukkit start
@ -101,7 +101,7 @@
+ // CraftBukkit end + // CraftBukkit end
} }
return EnumInteractionResult.SUCCESS; return EnumInteractionResult.a(world.isClientSide);
@@ -116,8 +143,13 @@ @@ -116,8 +143,13 @@
IDyeable idyeable = (IDyeable) item; IDyeable idyeable = (IDyeable) item;

Datei anzeigen

@ -19,7 +19,7 @@
- -
- @Override - @Override
- public IChatBaseComponent getScoreboardDisplayName() { - public IChatBaseComponent getScoreboardDisplayName() {
- return (IChatBaseComponent) (tileentitychest.hasCustomName() ? tileentitychest.getScoreboardDisplayName() : (tileentitychest1.hasCustomName() ? tileentitychest1.getScoreboardDisplayName() : new ChatMessage("container.chestDouble", new Object[0]))); - return (IChatBaseComponent) (tileentitychest.hasCustomName() ? tileentitychest.getScoreboardDisplayName() : (tileentitychest1.hasCustomName() ? tileentitychest1.getScoreboardDisplayName() : new ChatMessage("container.chestDouble")));
- } - }
- }); - });
+ return Optional.of(new DoubleInventory(tileentitychest, tileentitychest1, inventorylargechest)); // CraftBukkit + return Optional.of(new DoubleInventory(tileentitychest, tileentitychest1, inventorylargechest)); // CraftBukkit
@ -57,15 +57,15 @@
+ +
+ @Override + @Override
+ public IChatBaseComponent getScoreboardDisplayName() { + public IChatBaseComponent getScoreboardDisplayName() {
+ return (IChatBaseComponent) (tileentitychest.hasCustomName() ? tileentitychest.getScoreboardDisplayName() : (tileentitychest1.hasCustomName() ? tileentitychest1.getScoreboardDisplayName() : new ChatMessage("container.chestDouble", new Object[0]))); + return (IChatBaseComponent) (tileentitychest.hasCustomName() ? tileentitychest.getScoreboardDisplayName() : (tileentitychest1.hasCustomName() ? tileentitychest1.getScoreboardDisplayName() : new ChatMessage("container.chestDouble")));
+ } + }
+ }; + };
+ // CraftBukkit end + // CraftBukkit end
+ +
protected BlockChest(Block.Info block_info, Supplier<TileEntityTypes<? extends TileEntityChest>> supplier) { protected BlockChest(BlockBase.Info blockbase_info, Supplier<TileEntityTypes<? extends TileEntityChest>> supplier) {
super(block_info, supplier); super(blockbase_info, supplier);
this.p((IBlockData) ((IBlockData) ((IBlockData) ((IBlockData) this.blockStateList.getBlockData()).set(BlockChest.FACING, EnumDirection.NORTH)).set(BlockChest.c, BlockPropertyChestType.SINGLE)).set(BlockChest.d, false)); this.j((IBlockData) ((IBlockData) ((IBlockData) ((IBlockData) this.blockStateList.getBlockData()).set(BlockChest.FACING, EnumDirection.NORTH)).set(BlockChest.c, BlockPropertyChestType.SINGLE)).set(BlockChest.d, false));
@@ -217,7 +232,7 @@ @@ -218,7 +233,7 @@
} }
public DoubleBlockFinder.Result<? extends TileEntityChest> a(IBlockData iblockdata, World world, BlockPosition blockposition, boolean flag) { public DoubleBlockFinder.Result<? extends TileEntityChest> a(IBlockData iblockdata, World world, BlockPosition blockposition, boolean flag) {

Datei anzeigen

@ -8,47 +8,39 @@
+ +
public class BlockChorusFlower extends Block { public class BlockChorusFlower extends Block {
public static final BlockStateInteger AGE = BlockProperties.ab; public static final BlockStateInteger AGE = BlockProperties.ah;
@@ -58,8 +60,12 @@ @@ -68,8 +70,12 @@
} }
if (flag && b((IWorldReader) worldserver, blockposition1, (EnumDirection) null) && worldserver.isEmpty(blockposition.up(2))) { if (flag && b((IWorldReader) worldserver, blockposition1, (EnumDirection) null) && worldserver.isEmpty(blockposition.up(2))) {
- worldserver.setTypeAndData(blockposition, this.b.a((IBlockAccess) worldserver, blockposition), 2); - worldserver.setTypeAndData(blockposition, this.b.a((IBlockAccess) worldserver, blockposition), 2);
- this.b(worldserver, blockposition1, i); - this.b(worldserver, blockposition1, i);
+ // CraftBukkit start - add event + // CraftBukkit start - add event
+ if (CraftEventFactory.handleBlockSpreadEvent(worldserver, blockposition, blockposition1, this.getBlockData().set(BlockChorusFlower.AGE, Integer.valueOf(i)), 2)) { + if (CraftEventFactory.handleBlockSpreadEvent(worldserver, blockposition, blockposition1, this.getBlockData().set(BlockChorusFlower.AGE, Integer.valueOf(i)), 2)) {
+ worldserver.setTypeAndData(blockposition, this.b.a((IBlockAccess) worldserver, blockposition), 2); + worldserver.setTypeAndData(blockposition, this.b.a((IBlockAccess) worldserver, blockposition), 2);
+ this.b(worldserver, blockposition1, i); + this.b(worldserver, blockposition1, i);
+ } + }
+ // CraftBukkit end + // CraftBukkit end
} else if (i < 4) { } else if (i < 4) {
j = random.nextInt(4); j = random.nextInt(4);
if (flag1) { if (flag1) {
@@ -73,18 +79,30 @@ @@ -83,18 +89,30 @@
BlockPosition blockposition2 = blockposition.shift(enumdirection); BlockPosition blockposition2 = blockposition.shift(enumdirection);
if (worldserver.isEmpty(blockposition2) && worldserver.isEmpty(blockposition2.down()) && b((IWorldReader) worldserver, blockposition2, enumdirection.opposite())) { if (worldserver.isEmpty(blockposition2) && worldserver.isEmpty(blockposition2.down()) && b((IWorldReader) worldserver, blockposition2, enumdirection.opposite())) {
- this.b(worldserver, blockposition2, i + 1); - this.b(worldserver, blockposition2, i + 1);
- flag2 = true; - flag2 = true;
+ // CraftBukkit start - add event + // CraftBukkit start - add event
+ if (CraftEventFactory.handleBlockSpreadEvent(worldserver, blockposition, blockposition2, this.getBlockData().set(BlockChorusFlower.AGE, Integer.valueOf(i + 1)), 2)) { + if (CraftEventFactory.handleBlockSpreadEvent(worldserver, blockposition, blockposition2, this.getBlockData().set(BlockChorusFlower.AGE, Integer.valueOf(i + 1)), 2)) {
+ this.b(worldserver, blockposition2, i + 1); + this.b(worldserver, blockposition2, i + 1);
+ flag2 = true; + flag2 = true;
+ }
+ // CraftBukkit end
}
}
if (flag2) {
worldserver.setTypeAndData(blockposition, this.b.a((IBlockAccess) worldserver, blockposition), 2);
} else {
- this.a((World) worldserver, blockposition);
+ // CraftBukkit - add event
+ if (CraftEventFactory.handleBlockGrowEvent(worldserver, blockposition, this.getBlockData().set(BlockChorusFlower.AGE, Integer.valueOf(5)), 2)) {
+ this.a((World) worldserver, blockposition);
+ } + }
+ // CraftBukkit end + // CraftBukkit end
} }
}
if (flag2) {
worldserver.setTypeAndData(blockposition, this.b.a((IBlockAccess) worldserver, blockposition), 2);
} else { } else {
- this.a((World) worldserver, blockposition); - this.a((World) worldserver, blockposition);
+ // CraftBukkit - add event + // CraftBukkit - add event
@ -57,5 +49,13 @@
+ } + }
+ // CraftBukkit end + // CraftBukkit end
} }
} else {
- this.a((World) worldserver, blockposition);
+ // CraftBukkit - add event
+ if (CraftEventFactory.handleBlockGrowEvent(worldserver, blockposition, this.getBlockData().set(BlockChorusFlower.AGE, Integer.valueOf(5)), 2)) {
+ this.a((World) worldserver, blockposition);
+ }
+ // CraftBukkit end
} }
}

Datei anzeigen

@ -8,8 +8,8 @@
+ +
public class BlockCocoa extends BlockFacingHorizontal implements IBlockFragilePlantElement { public class BlockCocoa extends BlockFacingHorizontal implements IBlockFragilePlantElement {
public static final BlockStateInteger AGE = BlockProperties.Z; public static final BlockStateInteger AGE = BlockProperties.af;
@@ -22,7 +24,7 @@ @@ -27,7 +29,7 @@
int i = (Integer) iblockdata.get(BlockCocoa.AGE); int i = (Integer) iblockdata.get(BlockCocoa.AGE);
if (i < 2) { if (i < 2) {
@ -18,7 +18,7 @@
} }
} }
@@ -92,7 +94,7 @@ @@ -97,7 +99,7 @@
@Override @Override
public void a(WorldServer worldserver, Random random, BlockPosition blockposition, IBlockData iblockdata) { public void a(WorldServer worldserver, Random random, BlockPosition blockposition, IBlockData iblockdata) {

Datei anzeigen

@ -8,15 +8,15 @@
public class BlockComposter extends Block implements IInventoryHolder { public class BlockComposter extends Block implements IInventoryHolder {
public static final BlockStateInteger a = BlockProperties.am; public static final BlockStateInteger a = BlockProperties.as;
public static final Object2FloatMap<IMaterial> b = new Object2FloatOpenHashMap(); public static final Object2FloatMap<IMaterial> b = new Object2FloatOpenHashMap();
public static final VoxelShape c = VoxelShapes.b(); private static final VoxelShape c = VoxelShapes.b();
- private static final VoxelShape[] d = (VoxelShape[]) SystemUtils.a((Object) (new VoxelShape[9]), (avoxelshape) -> { - private static final VoxelShape[] d = (VoxelShape[]) SystemUtils.a((Object) (new VoxelShape[9]), (avoxelshape) -> {
+ private static final VoxelShape[] d = (VoxelShape[]) SystemUtils.a((new VoxelShape[9]), (avoxelshape) -> { // CraftBukkit - decompile error + private static final VoxelShape[] d = (VoxelShape[]) SystemUtils.a((new VoxelShape[9]), (avoxelshape) -> { // CraftBukkit - decompile error
for (int i = 0; i < 8; ++i) { for (int i = 0; i < 8; ++i) {
avoxelshape[i] = VoxelShapes.a(BlockComposter.c, Block.a(2.0D, (double) Math.max(2, 1 + i * 2), 2.0D, 14.0D, 16.0D, 14.0D), OperatorBoolean.ONLY_FIRST); avoxelshape[i] = VoxelShapes.a(BlockComposter.c, Block.a(2.0D, (double) Math.max(2, 1 + i * 2), 2.0D, 14.0D, 16.0D, 14.0D), OperatorBoolean.ONLY_FIRST);
} }
@@ -220,7 +221,8 @@ @@ -254,7 +255,8 @@
public IWorldInventory a(IBlockData iblockdata, GeneratorAccess generatoraccess, BlockPosition blockposition) { public IWorldInventory a(IBlockData iblockdata, GeneratorAccess generatoraccess, BlockPosition blockposition) {
int i = (Integer) iblockdata.get(BlockComposter.a); int i = (Integer) iblockdata.get(BlockComposter.a);
@ -26,7 +26,7 @@
} }
static class ContainerInput extends InventorySubcontainer implements IWorldInventory { static class ContainerInput extends InventorySubcontainer implements IWorldInventory {
@@ -232,6 +234,7 @@ @@ -266,6 +268,7 @@
public ContainerInput(IBlockData iblockdata, GeneratorAccess generatoraccess, BlockPosition blockposition) { public ContainerInput(IBlockData iblockdata, GeneratorAccess generatoraccess, BlockPosition blockposition) {
super(1); super(1);
@ -34,7 +34,7 @@
this.a = iblockdata; this.a = iblockdata;
this.b = generatoraccess; this.b = generatoraccess;
this.c = blockposition; this.c = blockposition;
@@ -282,6 +285,7 @@ @@ -318,6 +321,7 @@
this.blockData = iblockdata; this.blockData = iblockdata;
this.generatorAccess = generatoraccess; this.generatorAccess = generatoraccess;
this.blockPosition = blockposition; this.blockPosition = blockposition;
@ -42,7 +42,7 @@
} }
@Override @Override
@@ -306,15 +310,23 @@ @@ -342,15 +346,23 @@
@Override @Override
public void update() { public void update() {

Datei anzeigen

@ -13,7 +13,7 @@
private final IBlockData a; private final IBlockData a;
@@ -12,7 +17,7 @@ @@ -12,7 +17,7 @@
@Override @Override
public void a(World world, BlockPosition blockposition, IBlockData iblockdata, IBlockData iblockdata1) { public void a(World world, BlockPosition blockposition, IBlockData iblockdata, IBlockData iblockdata1, EntityFallingBlock entityfallingblock) {
if (canHarden(world, blockposition, iblockdata1)) { if (canHarden(world, blockposition, iblockdata1)) {
- world.setTypeAndData(blockposition, this.a, 3); - world.setTypeAndData(blockposition, this.a, 3);
+ org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockFormEvent(world, blockposition, this.a, 3); // CraftBukkit + org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockFormEvent(world, blockposition, this.a, 3); // CraftBukkit

Datei anzeigen

@ -2,7 +2,7 @@
+++ b/net/minecraft/server/BlockCoral.java +++ b/net/minecraft/server/BlockCoral.java
@@ -15,6 +15,11 @@ @@ -15,6 +15,11 @@
@Override @Override
public void tick(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, Random random) { public void tickAlways(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, Random random) {
if (!this.a((IBlockAccess) worldserver, blockposition)) { if (!this.a((IBlockAccess) worldserver, blockposition)) {
+ // CraftBukkit start + // CraftBukkit start
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callBlockFadeEvent(worldserver, blockposition, this.a.getBlockData()).isCancelled()) { + if (org.bukkit.craftbukkit.event.CraftEventFactory.callBlockFadeEvent(worldserver, blockposition, this.a.getBlockData()).isCancelled()) {

Datei anzeigen

@ -2,8 +2,8 @@
+++ b/net/minecraft/server/BlockCoralFan.java +++ b/net/minecraft/server/BlockCoralFan.java
@@ -19,6 +19,11 @@ @@ -19,6 +19,11 @@
@Override @Override
public void tick(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, Random random) { public void tickAlways(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, Random random) {
if (!b_(iblockdata, worldserver, blockposition)) { if (!c(iblockdata, (IBlockAccess) worldserver, blockposition)) {
+ // CraftBukkit start + // CraftBukkit start
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callBlockFadeEvent(worldserver, blockposition, this.a.getBlockData().set(BlockCoralFan.b, false)).isCancelled()) { + if (org.bukkit.craftbukkit.event.CraftEventFactory.callBlockFadeEvent(worldserver, blockposition, this.a.getBlockData().set(BlockCoralFan.b, false)).isCancelled()) {
+ return; + return;

Datei anzeigen

@ -2,8 +2,8 @@
+++ b/net/minecraft/server/BlockCoralFanWall.java +++ b/net/minecraft/server/BlockCoralFanWall.java
@@ -19,6 +19,11 @@ @@ -19,6 +19,11 @@
@Override @Override
public void tick(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, Random random) { public void tickAlways(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, Random random) {
if (!b_(iblockdata, worldserver, blockposition)) { if (!c(iblockdata, (IBlockAccess) worldserver, blockposition)) {
+ // CraftBukkit start + // CraftBukkit start
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callBlockFadeEvent(worldserver, blockposition, this.c.getBlockData().set(BlockCoralFanWall.b, false).set(BlockCoralFanWall.a, iblockdata.get(BlockCoralFanWall.a))).isCancelled()) { + if (org.bukkit.craftbukkit.event.CraftEventFactory.callBlockFadeEvent(worldserver, blockposition, this.c.getBlockData().set(BlockCoralFanWall.b, false).set(BlockCoralFanWall.a, iblockdata.get(BlockCoralFanWall.a))).isCancelled()) {
+ return; + return;

Datei anzeigen

@ -2,8 +2,8 @@
+++ b/net/minecraft/server/BlockCoralPlant.java +++ b/net/minecraft/server/BlockCoralPlant.java
@@ -20,6 +20,11 @@ @@ -20,6 +20,11 @@
@Override @Override
public void tick(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, Random random) { public void tickAlways(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, Random random) {
if (!b_(iblockdata, worldserver, blockposition)) { if (!c(iblockdata, (IBlockAccess) worldserver, blockposition)) {
+ // CraftBukkit start + // CraftBukkit start
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callBlockFadeEvent(worldserver, blockposition, this.c.getBlockData().set(BlockCoralPlant.b, false)).isCancelled()) { + if (org.bukkit.craftbukkit.event.CraftEventFactory.callBlockFadeEvent(worldserver, blockposition, this.c.getBlockData().set(BlockCoralPlant.b, false)).isCancelled()) {
+ return; + return;

Datei anzeigen

@ -8,8 +8,8 @@
+ +
public class BlockCrops extends BlockPlant implements IBlockFragilePlantElement { public class BlockCrops extends BlockPlant implements IBlockFragilePlantElement {
public static final BlockStateInteger AGE = BlockProperties.ac; public static final BlockStateInteger AGE = BlockProperties.ai;
@@ -52,7 +54,7 @@ @@ -56,7 +58,7 @@
float f = a((Block) this, (IBlockAccess) worldserver, blockposition); float f = a((Block) this, (IBlockAccess) worldserver, blockposition);
if (random.nextInt((int) (25.0F / f) + 1) == 0) { if (random.nextInt((int) (25.0F / f) + 1) == 0) {
@ -18,7 +18,7 @@
} }
} }
} }
@@ -67,7 +69,7 @@ @@ -71,7 +73,7 @@
i = j; i = j;
} }
@ -27,7 +27,7 @@
} }
protected int a(World world) { protected int a(World world) {
@@ -125,7 +127,7 @@ @@ -129,7 +131,7 @@
@Override @Override
public void a(IBlockData iblockdata, World world, BlockPosition blockposition, Entity entity) { public void a(IBlockData iblockdata, World world, BlockPosition blockposition, Entity entity) {

Datei anzeigen

@ -27,4 +27,4 @@
+ // CraftBukkit end + // CraftBukkit end
worldserver.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockDiodeAbstract.c, true), 2); worldserver.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockDiodeAbstract.c, true), 2);
if (!flag1) { if (!flag1) {
worldserver.getBlockTickList().a(blockposition, this, this.h(iblockdata), TickListPriority.VERY_HIGH); worldserver.getBlockTickList().a(blockposition, this, this.g(iblockdata), TickListPriority.VERY_HIGH);

Datei anzeigen

@ -1,6 +1,6 @@
--- a/net/minecraft/server/BlockDirtSnowSpreadable.java --- a/net/minecraft/server/BlockDirtSnowSpreadable.java
+++ b/net/minecraft/server/BlockDirtSnowSpreadable.java +++ b/net/minecraft/server/BlockDirtSnowSpreadable.java
@@ -30,6 +30,11 @@ @@ -32,6 +32,11 @@
@Override @Override
public void tick(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, Random random) { public void tick(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, Random random) {
if (!b(iblockdata, (IWorldReader) worldserver, blockposition)) { if (!b(iblockdata, (IWorldReader) worldserver, blockposition)) {
@ -12,12 +12,12 @@
worldserver.setTypeUpdate(blockposition, Blocks.DIRT.getBlockData()); worldserver.setTypeUpdate(blockposition, Blocks.DIRT.getBlockData());
} else { } else {
if (worldserver.getLightLevel(blockposition.up()) >= 9) { if (worldserver.getLightLevel(blockposition.up()) >= 9) {
@@ -39,7 +44,7 @@ @@ -41,7 +46,7 @@
BlockPosition blockposition1 = blockposition.b(random.nextInt(3) - 1, random.nextInt(5) - 3, random.nextInt(3) - 1); BlockPosition blockposition1 = blockposition.b(random.nextInt(3) - 1, random.nextInt(5) - 3, random.nextInt(3) - 1);
if (worldserver.getType(blockposition1).getBlock() == Blocks.DIRT && c(iblockdata1, (IWorldReader) worldserver, blockposition1)) { if (worldserver.getType(blockposition1).a(Blocks.DIRT) && c(iblockdata1, (IWorldReader) worldserver, blockposition1)) {
- worldserver.setTypeUpdate(blockposition1, (IBlockData) iblockdata1.set(BlockDirtSnowSpreadable.a, worldserver.getType(blockposition1.up()).getBlock() == Blocks.SNOW)); - worldserver.setTypeUpdate(blockposition1, (IBlockData) iblockdata1.set(BlockDirtSnowSpreadable.a, worldserver.getType(blockposition1.up()).a(Blocks.SNOW)));
+ org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockSpreadEvent(worldserver, blockposition, blockposition1, (IBlockData) iblockdata1.set(BlockDirtSnowSpreadable.a, worldserver.getType(blockposition1.up()).getBlock() == Blocks.SNOW)); // CraftBukkit + org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockSpreadEvent(worldserver, blockposition, blockposition1, (IBlockData) iblockdata1.set(BlockDirtSnowSpreadable.a, worldserver.getType(blockposition1.up()).a(Blocks.SNOW))); // CraftBukkit
} }
} }
} }

Datei anzeigen

@ -12,7 +12,7 @@
public static void a(IMaterial imaterial, IDispenseBehavior idispensebehavior) { public static void a(IMaterial imaterial, IDispenseBehavior idispensebehavior) {
BlockDispenser.REGISTRY.put(imaterial.getItem(), idispensebehavior); BlockDispenser.REGISTRY.put(imaterial.getItem(), idispensebehavior);
@@ -58,6 +59,7 @@ @@ -53,6 +54,7 @@
IDispenseBehavior idispensebehavior = this.a(itemstack); IDispenseBehavior idispensebehavior = this.a(itemstack);
if (idispensebehavior != IDispenseBehavior.NONE) { if (idispensebehavior != IDispenseBehavior.NONE) {

Datei anzeigen

@ -9,7 +9,7 @@
public class BlockDoor extends Block { public class BlockDoor extends Block {
public static final BlockStateDirection FACING = BlockFacingHorizontal.FACING; public static final BlockStateDirection FACING = BlockFacingHorizontal.FACING;
@@ -171,9 +173,24 @@ @@ -155,9 +157,24 @@
@Override @Override
public void doPhysics(IBlockData iblockdata, World world, BlockPosition blockposition, Block block, BlockPosition blockposition1, boolean flag) { public void doPhysics(IBlockData iblockdata, World world, BlockPosition blockposition, Block block, BlockPosition blockposition1, boolean flag) {

Datei anzeigen

@ -11,21 +11,19 @@
public class BlockEnderPortal extends BlockTileEntity { public class BlockEnderPortal extends BlockTileEntity {
protected static final VoxelShape a = Block.a(0.0D, 0.0D, 0.0D, 16.0D, 12.0D, 16.0D); protected static final VoxelShape a = Block.a(0.0D, 0.0D, 0.0D, 16.0D, 12.0D, 16.0D);
@@ -21,7 +26,16 @@ @@ -28,6 +33,15 @@
@Override return;
public void a(IBlockData iblockdata, World world, BlockPosition blockposition, Entity entity) { }
if (!world.isClientSide && !entity.isPassenger() && !entity.isVehicle() && entity.canPortal() && VoxelShapes.c(VoxelShapes.a(entity.getBoundingBox().d((double) (-blockposition.getX()), (double) (-blockposition.getY()), (double) (-blockposition.getZ()))), iblockdata.getShape(world, blockposition), OperatorBoolean.AND)) {
- entity.a(world.worldProvider.getDimensionManager() == DimensionManager.THE_END ? DimensionManager.OVERWORLD : DimensionManager.THE_END);
+ // CraftBukkit start - Entity in portal + // CraftBukkit start - Entity in portal
+ EntityPortalEnterEvent event = new EntityPortalEnterEvent(entity.getBukkitEntity(), new org.bukkit.Location(world.getWorld(), blockposition.getX(), blockposition.getY(), blockposition.getZ())); + EntityPortalEnterEvent event = new EntityPortalEnterEvent(entity.getBukkitEntity(), new org.bukkit.Location(world.getWorld(), blockposition.getX(), blockposition.getY(), blockposition.getZ()));
+ world.getServer().getPluginManager().callEvent(event); + world.getServer().getPluginManager().callEvent(event);
+ +
+ if (entity instanceof EntityPlayer) { + if (entity instanceof EntityPlayer) {
+ ((EntityPlayer) entity).a(world.worldProvider.getDimensionManager().getType() == DimensionManager.THE_END ? DimensionManager.OVERWORLD : DimensionManager.THE_END, PlayerTeleportEvent.TeleportCause.END_PORTAL); + ((EntityPlayer) entity).a(worldserver, PlayerTeleportEvent.TeleportCause.END_PORTAL);
+ return; + return;
+ } + }
+ entity.a(world.worldProvider.getDimensionManager().getType() == DimensionManager.THE_END ? DimensionManager.OVERWORLD : DimensionManager.THE_END);
+ // CraftBukkit end + // CraftBukkit end
entity.a(worldserver);
} }
}

Datei anzeigen

@ -1,28 +1,26 @@
--- a/net/minecraft/server/BlockFire.java --- a/net/minecraft/server/BlockFire.java
+++ b/net/minecraft/server/BlockFire.java +++ b/net/minecraft/server/BlockFire.java
@@ -7,6 +7,15 @@ @@ -5,6 +5,13 @@
import java.util.Map.Entry; import java.util.Map;
import javax.annotation.Nullable; import java.util.Random;
+// CraftBukkit start +// CraftBukkit start
+import org.bukkit.Bukkit;
+import org.bukkit.craftbukkit.block.CraftBlockState; +import org.bukkit.craftbukkit.block.CraftBlockState;
+import org.bukkit.craftbukkit.event.CraftEventFactory; +import org.bukkit.craftbukkit.event.CraftEventFactory;
+import org.bukkit.event.block.BlockBurnEvent; +import org.bukkit.event.block.BlockBurnEvent;
+import org.bukkit.event.block.BlockFadeEvent; +import org.bukkit.event.block.BlockFadeEvent;
+import org.bukkit.event.block.BlockSpreadEvent;
+// CraftBukkit end +// CraftBukkit end
+ +
public class BlockFire extends Block { public class BlockFire extends BlockFireAbstract {
public static final BlockStateInteger AGE = BlockProperties.ad; public static final BlockStateInteger AGE = BlockProperties.aj;
@@ -33,7 +42,20 @@ @@ -26,7 +33,20 @@
@Override @Override
public IBlockData updateState(IBlockData iblockdata, EnumDirection enumdirection, IBlockData iblockdata1, GeneratorAccess generatoraccess, BlockPosition blockposition, BlockPosition blockposition1) { public IBlockData updateState(IBlockData iblockdata, EnumDirection enumdirection, IBlockData iblockdata1, GeneratorAccess generatoraccess, BlockPosition blockposition, BlockPosition blockposition1) {
- return this.canPlace(iblockdata, generatoraccess, blockposition) ? (IBlockData) this.a((IBlockAccess) generatoraccess, blockposition).set(BlockFire.AGE, iblockdata.get(BlockFire.AGE)) : Blocks.AIR.getBlockData(); - return this.canPlace(iblockdata, generatoraccess, blockposition) ? this.a(generatoraccess, blockposition, (Integer) iblockdata.get(BlockFire.AGE)) : Blocks.AIR.getBlockData();
+ // CraftBukkit start + // CraftBukkit start
+ if (!iblockdata.canPlace(generatoraccess, blockposition)) { + if (!this.canPlace(iblockdata, generatoraccess, blockposition)) {
+ CraftBlockState blockState = CraftBlockState.getBlockState(generatoraccess, blockposition); + CraftBlockState blockState = CraftBlockState.getBlockState(generatoraccess, blockposition);
+ blockState.setData(Blocks.AIR.getBlockData()); + blockState.setData(Blocks.AIR.getBlockData());
+ +
@ -33,21 +31,21 @@
+ return blockState.getHandle(); + return blockState.getHandle();
+ } + }
+ } + }
+ return this.a((IBlockAccess) generatoraccess, blockposition).set(BlockFire.AGE, iblockdata.get(BlockFire.AGE)); + return this.a(generatoraccess, blockposition, (Integer) iblockdata.get(BlockFire.AGE));
+ // CraftBukkit end + // CraftBukkit end
} }
@Nullable @Override
@@ -82,7 +104,7 @@ @@ -97,7 +117,7 @@
public void tick(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, Random random) { worldserver.getBlockTickList().a(blockposition, this, a(worldserver.random));
if (worldserver.getGameRules().getBoolean(GameRules.DO_FIRE_TICK)) { if (worldserver.getGameRules().getBoolean(GameRules.DO_FIRE_TICK)) {
if (!iblockdata.canPlace(worldserver, blockposition)) { if (!iblockdata.canPlace(worldserver, blockposition)) {
- worldserver.a(blockposition, false); - worldserver.a(blockposition, false);
+ fireExtinguished(worldserver, blockposition); // CraftBukkit - invalid place location + fireExtinguished(worldserver, blockposition); // CraftBukkit - invalid place location
} }
Block block = worldserver.getType(blockposition.down()).getBlock(); IBlockData iblockdata1 = worldserver.getType(blockposition.down());
@@ -90,7 +112,7 @@ @@ -105,7 +125,7 @@
int i = (Integer) iblockdata.get(BlockFire.AGE); int i = (Integer) iblockdata.get(BlockFire.AGE);
if (!flag && worldserver.isRaining() && this.a((World) worldserver, blockposition) && random.nextFloat() < 0.2F + (float) i * 0.03F) { if (!flag && worldserver.isRaining() && this.a((World) worldserver, blockposition) && random.nextFloat() < 0.2F + (float) i * 0.03F) {
@ -56,7 +54,7 @@
} else { } else {
int j = Math.min(15, i + random.nextInt(3) / 2); int j = Math.min(15, i + random.nextInt(3) / 2);
@@ -105,14 +127,14 @@ @@ -119,14 +139,14 @@
BlockPosition blockposition1 = blockposition.down(); BlockPosition blockposition1 = blockposition.down();
if (!worldserver.getType(blockposition1).d(worldserver, blockposition1, EnumDirection.UP) || i > 3) { if (!worldserver.getType(blockposition1).d(worldserver, blockposition1, EnumDirection.UP) || i > 3) {
@ -67,57 +65,57 @@
return; return;
} }
if (i == 15 && random.nextInt(4) == 0 && !this.h(worldserver.getType(blockposition.down()))) { if (i == 15 && random.nextInt(4) == 0 && !this.e(worldserver.getType(blockposition.down()))) {
- worldserver.a(blockposition, false); - worldserver.a(blockposition, false);
+ fireExtinguished(worldserver, blockposition); // CraftBukkit + fireExtinguished(worldserver, blockposition); // CraftBukkit
return; return;
} }
} }
@@ -120,12 +142,14 @@ @@ -134,12 +154,14 @@
boolean flag1 = worldserver.s(blockposition); boolean flag1 = worldserver.u(blockposition);
int k = flag1 ? -50 : 0; int k = flag1 ? -50 : 0;
- this.a(worldserver, blockposition.east(), 300 + k, random, i); - this.trySpread(worldserver, blockposition.east(), 300 + k, random, i);
- this.a(worldserver, blockposition.west(), 300 + k, random, i); - this.trySpread(worldserver, blockposition.west(), 300 + k, random, i);
- this.a(worldserver, blockposition.down(), 250 + k, random, i); - this.trySpread(worldserver, blockposition.down(), 250 + k, random, i);
- this.a(worldserver, blockposition.up(), 250 + k, random, i); - this.trySpread(worldserver, blockposition.up(), 250 + k, random, i);
- this.a(worldserver, blockposition.north(), 300 + k, random, i); - this.trySpread(worldserver, blockposition.north(), 300 + k, random, i);
- this.a(worldserver, blockposition.south(), 300 + k, random, i); - this.trySpread(worldserver, blockposition.south(), 300 + k, random, i);
+ // CraftBukkit start - add source blockposition to burn calls + // CraftBukkit start - add source blockposition to burn calls
+ this.a(worldserver, blockposition.east(), 300 + k, random, i, blockposition); + this.trySpread(worldserver, blockposition.east(), 300 + k, random, i, blockposition);
+ this.a(worldserver, blockposition.west(), 300 + k, random, i, blockposition); + this.trySpread(worldserver, blockposition.west(), 300 + k, random, i, blockposition);
+ this.a(worldserver, blockposition.down(), 250 + k, random, i, blockposition); + this.trySpread(worldserver, blockposition.down(), 250 + k, random, i, blockposition);
+ this.a(worldserver, blockposition.up(), 250 + k, random, i, blockposition); + this.trySpread(worldserver, blockposition.up(), 250 + k, random, i, blockposition);
+ this.a(worldserver, blockposition.north(), 300 + k, random, i, blockposition); + this.trySpread(worldserver, blockposition.north(), 300 + k, random, i, blockposition);
+ this.a(worldserver, blockposition.south(), 300 + k, random, i, blockposition); + this.trySpread(worldserver, blockposition.south(), 300 + k, random, i, blockposition);
+ // CraftBukkit end + // CraftBukkit end
BlockPosition.MutableBlockPosition blockposition_mutableblockposition = new BlockPosition.MutableBlockPosition(); BlockPosition.MutableBlockPosition blockposition_mutableblockposition = new BlockPosition.MutableBlockPosition();
for (int l = -1; l <= 1; ++l) { for (int l = -1; l <= 1; ++l) {
@@ -151,7 +175,15 @@ @@ -165,7 +187,15 @@
if (i2 > 0 && random.nextInt(k1) <= i2 && (!worldserver.isRaining() || !this.a((World) worldserver, (BlockPosition) blockposition_mutableblockposition))) { if (i2 > 0 && random.nextInt(k1) <= i2 && (!worldserver.isRaining() || !this.a((World) worldserver, (BlockPosition) blockposition_mutableblockposition))) {
int j2 = Math.min(15, i + random.nextInt(5) / 4); int j2 = Math.min(15, i + random.nextInt(5) / 4);
- worldserver.setTypeAndData(blockposition_mutableblockposition, (IBlockData) this.a((IBlockAccess) worldserver, (BlockPosition) blockposition_mutableblockposition).set(BlockFire.AGE, j2), 3); - worldserver.setTypeAndData(blockposition_mutableblockposition, this.a(worldserver, blockposition_mutableblockposition, j2), 3);
+ // CraftBukkit start - Call to stop spread of fire + // CraftBukkit start - Call to stop spread of fire
+ if (worldserver.getType(blockposition_mutableblockposition).getBlock() != Blocks.FIRE) { + if (worldserver.getType(blockposition_mutableblockposition).getBlock() != Blocks.FIRE) {
+ if (CraftEventFactory.callBlockIgniteEvent(worldserver, blockposition_mutableblockposition, blockposition).isCancelled()) { + if (CraftEventFactory.callBlockIgniteEvent(worldserver, blockposition_mutableblockposition, blockposition).isCancelled()) {
+ continue; + continue;
+ } + }
+ +
+ CraftEventFactory.handleBlockSpreadEvent(worldserver, blockposition, blockposition_mutableblockposition, (IBlockData) this.a((IBlockAccess) worldserver, (BlockPosition) blockposition_mutableblockposition).set(BlockFire.AGE, j2), 3); // CraftBukkit + CraftEventFactory.handleBlockSpreadEvent(worldserver, blockposition, blockposition_mutableblockposition, this.a(worldserver, blockposition_mutableblockposition, j2), 3); // CraftBukkit
+ } + }
+ // CraftBukkit end + // CraftBukkit end
} }
} }
} }
@@ -175,12 +207,24 @@ @@ -189,12 +219,24 @@
return iblockdata.b((IBlockState) BlockProperties.C) && (Boolean) iblockdata.get(BlockProperties.C) ? 0 : this.flameChances.getInt(iblockdata.getBlock()); return iblockdata.b(BlockProperties.C) && (Boolean) iblockdata.get(BlockProperties.C) ? 0 : this.flameChances.getInt(iblockdata.getBlock());
} }
- private void a(World world, BlockPosition blockposition, int i, Random random, int j) { - private void trySpread(World world, BlockPosition blockposition, int i, Random random, int j) {
+ private void a(World world, BlockPosition blockposition, int i, Random random, int j, BlockPosition sourceposition) { // CraftBukkit add sourceposition + private void trySpread(World world, BlockPosition blockposition, int i, Random random, int j, BlockPosition sourceposition) { // CraftBukkit add sourceposition
int k = this.i(world.getType(blockposition)); int k = this.getBurnChance(world.getType(blockposition));
if (random.nextInt(i) < k) { if (random.nextInt(i) < k) {
IBlockData iblockdata = world.getType(blockposition); IBlockData iblockdata = world.getType(blockposition);
@ -137,29 +135,3 @@
if (random.nextInt(j + 10) < 5 && !world.isRainingAt(blockposition)) { if (random.nextInt(j + 10) < 5 && !world.isRainingAt(blockposition)) {
int l = Math.min(j + random.nextInt(5) / 4, 15); int l = Math.min(j + random.nextInt(5) / 4, 15);
@@ -241,9 +285,10 @@
@Override
public void onPlace(IBlockData iblockdata, World world, BlockPosition blockposition, IBlockData iblockdata1, boolean flag) {
if (iblockdata1.getBlock() != iblockdata.getBlock()) {
- if (world.worldProvider.getDimensionManager() != DimensionManager.OVERWORLD && world.worldProvider.getDimensionManager() != DimensionManager.NETHER || !((BlockPortal) Blocks.NETHER_PORTAL).a((GeneratorAccess) world, blockposition)) {
+ // CraftBukkit - getType()
+ if (world.worldProvider.getDimensionManager().getType() != DimensionManager.OVERWORLD && world.worldProvider.getDimensionManager().getType() != DimensionManager.NETHER || !((BlockPortal) Blocks.NETHER_PORTAL).a((GeneratorAccess) world, blockposition)) {
if (!iblockdata.canPlace(world, blockposition)) {
- world.a(blockposition, false);
+ fireExtinguished(world, blockposition); // CraftBukkit - fuel block broke
} else {
world.getBlockTickList().a(blockposition, this, this.a((IWorldReader) world) + world.random.nextInt(10));
}
@@ -392,4 +437,12 @@
blockfire.a(Blocks.BEEHIVE, 5, 20);
blockfire.a(Blocks.BEE_NEST, 30, 20);
}
+
+ // CraftBukkit start
+ private void fireExtinguished(GeneratorAccess world, BlockPosition position) {
+ if (!CraftEventFactory.callBlockFadeEvent(world, position, Blocks.AIR.getBlockData()).isCancelled()) {
+ world.a(position, false);
+ }
+ }
+ // CraftBukkit end
}

Datei anzeigen

@ -0,0 +1,44 @@
--- a/net/minecraft/server/BlockFireAbstract.java
+++ b/net/minecraft/server/BlockFireAbstract.java
@@ -41,7 +41,14 @@
if (!entity.isFireProof()) {
entity.setFireTicks(entity.getFireTicks() + 1);
if (entity.getFireTicks() == 0) {
- entity.setOnFire(8);
+ // CraftBukkit start
+ org.bukkit.event.entity.EntityCombustEvent event = new org.bukkit.event.entity.EntityCombustByBlockEvent(org.bukkit.craftbukkit.block.CraftBlock.at(world, blockposition), entity.getBukkitEntity(), 8);
+ world.getServer().getPluginManager().callEvent(event);
+
+ if (!event.isCancelled()) {
+ entity.setOnFire(event.getDuration(), false);
+ }
+ // CraftBukkit end
}
entity.damageEntity(DamageSource.FIRE, this.g);
@@ -53,9 +60,10 @@
@Override
public void onPlace(IBlockData iblockdata, World world, BlockPosition blockposition, IBlockData iblockdata1, boolean flag) {
if (!iblockdata1.a(iblockdata.getBlock())) {
- if (world.getDimensionKey() != World.OVERWORLD && world.getDimensionKey() != World.THE_NETHER || !BlockPortal.a((GeneratorAccess) world, blockposition)) {
+ // CraftBukkit - getTypeKey()
+ if (world.getTypeKey()!= DimensionManager.OVERWORLD && world.getTypeKey()!= DimensionManager.THE_NETHER || !BlockPortal.a((GeneratorAccess) world, blockposition)) {
if (!iblockdata.canPlace(world, blockposition)) {
- world.a(blockposition, false);
+ fireExtinguished(world, blockposition); // CraftBukkit - fuel block broke
}
}
@@ -92,4 +100,12 @@
return true;
}
+
+ // CraftBukkit start
+ protected void fireExtinguished(GeneratorAccess world, BlockPosition position) {
+ if (!org.bukkit.craftbukkit.event.CraftEventFactory.callBlockFadeEvent(world, position, Blocks.AIR.getBlockData()).isCancelled()) {
+ world.a(position, false);
+ }
+ }
+ // CraftBukkit end
}

Datei anzeigen

@ -1,27 +1,27 @@
--- a/net/minecraft/server/BlockFluids.java --- a/net/minecraft/server/BlockFluids.java
+++ b/net/minecraft/server/BlockFluids.java +++ b/net/minecraft/server/BlockFluids.java
@@ -111,14 +111,20 @@ @@ -113,14 +113,20 @@
Fluid fluid = world.getFluid(blockposition); if (world.getFluid(blockposition1).a((Tag) TagsFluid.WATER)) {
Block block = world.getFluid(blockposition).isSource() ? Blocks.OBSIDIAN : Blocks.COBBLESTONE;
if (fluid.isSource()) { - world.setTypeUpdate(blockposition, block.getBlockData());
- world.setTypeUpdate(blockposition, Blocks.OBSIDIAN.getBlockData()); - this.fizz(world, blockposition);
- this.fizz(world, blockposition); + // CraftBukkit start
+ // CraftBukkit start + if (org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockFormEvent(world, blockposition, block.getBlockData())) {
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockFormEvent(world, blockposition, Blocks.OBSIDIAN.getBlockData())) { + this.fizz(world, blockposition);
+ this.fizz(world, blockposition); + }
+ } + // CraftBukkit end
+ // CraftBukkit end return false;
return false; }
}
if (fluid.getHeight(world, blockposition) >= 0.44444445F) { if (flag && world.getType(blockposition1).a(Blocks.BLUE_ICE)) {
- world.setTypeUpdate(blockposition, Blocks.COBBLESTONE.getBlockData()); - world.setTypeUpdate(blockposition, Blocks.BASALT.getBlockData());
- this.fizz(world, blockposition); - this.fizz(world, blockposition);
+ // CraftBukkit start + // CraftBukkit start
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockFormEvent(world, blockposition, Blocks.COBBLESTONE.getBlockData())) { + if (org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockFormEvent(world, blockposition, Blocks.BASALT.getBlockData())) {
+ this.fizz(world, blockposition); + this.fizz(world, blockposition);
+ } + }
+ // CraftBukkit end + // CraftBukkit end
return false; return false;
}
} }
}

Datei anzeigen

@ -0,0 +1,11 @@
--- a/net/minecraft/server/BlockGrowingTop.java
+++ b/net/minecraft/server/BlockGrowingTop.java
@@ -36,7 +36,7 @@
BlockPosition blockposition1 = blockposition.shift(this.a);
if (this.h(worldserver.getType(blockposition1))) {
- worldserver.setTypeUpdate(blockposition1, (IBlockData) iblockdata.a((IBlockState) BlockGrowingTop.d));
+ org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockSpreadEvent(worldserver, blockposition, blockposition1, (IBlockData) iblockdata.a((IBlockState) BlockGrowingTop.d)); // CraftBukkit
}
}

Datei anzeigen

@ -5,10 +5,10 @@
protected void melt(IBlockData iblockdata, World world, BlockPosition blockposition) { protected void melt(IBlockData iblockdata, World world, BlockPosition blockposition) {
+ // CraftBukkit start + // CraftBukkit start
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callBlockFadeEvent(world, blockposition, world.worldProvider.isNether() ? Blocks.AIR.getBlockData() : Blocks.WATER.getBlockData()).isCancelled()) { + if (org.bukkit.craftbukkit.event.CraftEventFactory.callBlockFadeEvent(world, blockposition, world.getDimensionManager().isNether() ? Blocks.AIR.getBlockData() : Blocks.WATER.getBlockData()).isCancelled()) {
+ return; + return;
+ } + }
+ // CraftBukkit end + // CraftBukkit end
if (world.worldProvider.isNether()) { if (world.getDimensionManager().isNether()) {
world.a(blockposition, false); world.a(blockposition, false);
} else { } else {

Datei anzeigen

@ -1,6 +1,6 @@
--- a/net/minecraft/server/BlockJukeBox.java --- a/net/minecraft/server/BlockJukeBox.java
+++ b/net/minecraft/server/BlockJukeBox.java +++ b/net/minecraft/server/BlockJukeBox.java
@@ -25,7 +25,13 @@ @@ -42,7 +42,13 @@
TileEntity tileentity = generatoraccess.getTileEntity(blockposition); TileEntity tileentity = generatoraccess.getTileEntity(blockposition);
if (tileentity instanceof TileEntityJukeBox) { if (tileentity instanceof TileEntityJukeBox) {

Datei anzeigen

@ -1,11 +0,0 @@
--- a/net/minecraft/server/BlockKelp.java
+++ b/net/minecraft/server/BlockKelp.java
@@ -44,7 +44,7 @@
IBlockData iblockdata1 = worldserver.getType(blockposition1);
if (iblockdata1.getBlock() == Blocks.WATER && (Integer) iblockdata.get(BlockKelp.a) < 25 && random.nextDouble() < 0.14D) {
- worldserver.setTypeUpdate(blockposition1, (IBlockData) iblockdata.a((IBlockState) BlockKelp.a));
+ org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockSpreadEvent(worldserver, blockposition, blockposition1, (IBlockData) iblockdata.a((IBlockState) BlockKelp.a)); // CraftBukkit
}
}

Datei anzeigen

@ -8,10 +8,10 @@
+ +
public class BlockLeaves extends Block { public class BlockLeaves extends Block {
public static final BlockStateInteger DISTANCE = BlockProperties.ah; public static final BlockStateInteger DISTANCE = BlockProperties.an;
@@ -20,6 +22,14 @@ @@ -25,6 +27,14 @@
@Override @Override
public void b(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, Random random) { public void tick(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, Random random) {
if (!(Boolean) iblockdata.get(BlockLeaves.PERSISTENT) && (Integer) iblockdata.get(BlockLeaves.DISTANCE) == 7) { if (!(Boolean) iblockdata.get(BlockLeaves.PERSISTENT) && (Integer) iblockdata.get(BlockLeaves.DISTANCE) == 7) {
+ // CraftBukkit start + // CraftBukkit start
+ LeavesDecayEvent event = new LeavesDecayEvent(worldserver.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ())); + LeavesDecayEvent event = new LeavesDecayEvent(worldserver.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ()));

Datei anzeigen

@ -1,6 +1,6 @@
--- a/net/minecraft/server/BlockLectern.java --- a/net/minecraft/server/BlockLectern.java
+++ b/net/minecraft/server/BlockLectern.java +++ b/net/minecraft/server/BlockLectern.java
@@ -151,12 +151,13 @@ @@ -165,12 +165,13 @@
} }
private void d(IBlockData iblockdata, World world, BlockPosition blockposition) { private void d(IBlockData iblockdata, World world, BlockPosition blockposition) {

Datei anzeigen

@ -8,8 +8,8 @@
+ +
public class BlockMinecartDetector extends BlockMinecartTrackAbstract { public class BlockMinecartDetector extends BlockMinecartTrackAbstract {
public static final BlockStateEnum<BlockPropertyTrackPosition> SHAPE = BlockProperties.X; public static final BlockStateEnum<BlockPropertyTrackPosition> SHAPE = BlockProperties.ad;
@@ -62,6 +64,16 @@ @@ -57,6 +59,16 @@
} }
IBlockData iblockdata1; IBlockData iblockdata1;

Datei anzeigen

@ -9,12 +9,12 @@
public class BlockMonsterEggs extends Block { public class BlockMonsterEggs extends Block {
private final Block a; private final Block a;
@@ -29,7 +31,7 @@ @@ -26,7 +28,7 @@
EntitySilverfish entitysilverfish = (EntitySilverfish) EntityTypes.SILVERFISH.a(world); EntitySilverfish entitysilverfish = (EntitySilverfish) EntityTypes.SILVERFISH.a(world);
entitysilverfish.setPositionRotation((double) blockposition.getX() + 0.5D, (double) blockposition.getY(), (double) blockposition.getZ() + 0.5D, 0.0F, 0.0F); entitysilverfish.setPositionRotation((double) blockposition.getX() + 0.5D, (double) blockposition.getY(), (double) blockposition.getZ() + 0.5D, 0.0F, 0.0F);
- world.addEntity(entitysilverfish); - world.addEntity(entitysilverfish);
+ world.addEntity(entitysilverfish, SpawnReason.SILVERFISH_BLOCK); // CraftBukkit - add SpawnReason + world.addEntity(entitysilverfish, SpawnReason.SILVERFISH_BLOCK); // CraftBukkit - add SpawnReason
entitysilverfish.doSpawnEffect(); entitysilverfish.doSpawnEffect();
} }

Datei anzeigen

@ -20,7 +20,7 @@
} }
} }
@@ -70,14 +74,16 @@ @@ -69,14 +73,16 @@
WorldGenFeatureConfigured worldgenfeatureconfigured; WorldGenFeatureConfigured worldgenfeatureconfigured;
if (this == Blocks.BROWN_MUSHROOM) { if (this == Blocks.BROWN_MUSHROOM) {
@ -38,4 +38,4 @@
+ worldgenfeatureconfigured = WorldGenerator.HUGE_RED_MUSHROOM.b(BiomeDecoratorGroups.HUGE_RED_MUSHROOM); // CraftBukkit - decompile error + worldgenfeatureconfigured = WorldGenerator.HUGE_RED_MUSHROOM.b(BiomeDecoratorGroups.HUGE_RED_MUSHROOM); // CraftBukkit - decompile error
} }
if (worldgenfeatureconfigured.a(worldserver, worldserver.getChunkProvider().getChunkGenerator(), random, blockposition)) { if (worldgenfeatureconfigured.a(worldserver, worldserver.getStructureManager(), worldserver.getChunkProvider().getChunkGenerator(), random, blockposition)) {

Datei anzeigen

@ -1,6 +1,6 @@
--- a/net/minecraft/server/BlockNetherWart.java --- a/net/minecraft/server/BlockNetherWart.java
+++ b/net/minecraft/server/BlockNetherWart.java +++ b/net/minecraft/server/BlockNetherWart.java
@@ -28,7 +28,7 @@ @@ -33,7 +33,7 @@
if (i < 3 && random.nextInt(10) == 0) { if (i < 3 && random.nextInt(10) == 0) {
iblockdata = (IBlockData) iblockdata.set(BlockNetherWart.AGE, i + 1); iblockdata = (IBlockData) iblockdata.set(BlockNetherWart.AGE, i + 1);
@ -8,4 +8,4 @@
+ org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockGrowEvent(worldserver, blockposition, iblockdata, 2); // CraftBukkit + org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockGrowEvent(worldserver, blockposition, iblockdata, 2); // CraftBukkit
} }
super.tick(iblockdata, worldserver, blockposition, random); }

Datei anzeigen

@ -34,7 +34,7 @@
- this.play(world, blockposition); - this.play(world, blockposition);
+ this.play(world, blockposition, iblockdata); // CraftBukkit + this.play(world, blockposition, iblockdata); // CraftBukkit
entityhuman.a(StatisticList.TUNE_NOTEBLOCK); entityhuman.a(StatisticList.TUNE_NOTEBLOCK);
return EnumInteractionResult.SUCCESS; return EnumInteractionResult.CONSUME;
} }
@@ -58,7 +64,7 @@ @@ -58,7 +64,7 @@
@Override @Override

Datei anzeigen

@ -11,7 +11,7 @@
public static final BlockStateBoolean b = BlockProperties.w; public static final BlockStateBoolean b = BlockProperties.w;
@@ -29,8 +31,18 @@ @@ -29,8 +31,18 @@
@Override @Override
public void tick(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, Random random) { public void tickAlways(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, Random random) {
if ((Boolean) iblockdata.get(BlockObserver.b)) { if ((Boolean) iblockdata.get(BlockObserver.b)) {
+ // CraftBukkit start + // CraftBukkit start
+ if (CraftEventFactory.callRedstoneChange(worldserver, blockposition, 15, 0).getNewCurrent() != 0) { + if (CraftEventFactory.callRedstoneChange(worldserver, blockposition, 15, 0).getNewCurrent() != 0) {

Datei anzeigen

@ -15,7 +15,7 @@
public class BlockPiston extends BlockDirectional { public class BlockPiston extends BlockDirectional {
public static final BlockStateBoolean EXTENDED = BlockProperties.g; public static final BlockStateBoolean EXTENDED = BlockProperties.g;
@@ -113,6 +121,18 @@ @@ -103,6 +111,18 @@
} }
} }
@ -31,13 +31,13 @@
+ } + }
+ // PAIL: checkME - what happened to setTypeAndData? + // PAIL: checkME - what happened to setTypeAndData?
+ // CraftBukkit end + // CraftBukkit end
world.playBlockAction(blockposition, this, b0, enumdirection.b()); world.playBlockAction(blockposition, this, b0, enumdirection.c());
} }
@@ -284,6 +304,48 @@ @@ -277,6 +297,48 @@
int j = list.size() + list2.size(); IBlockData[] aiblockdata = new IBlockData[list.size() + list2.size()];
IBlockData[] aiblockdata = new IBlockData[j];
EnumDirection enumdirection1 = flag ? enumdirection : enumdirection.opposite(); EnumDirection enumdirection1 = flag ? enumdirection : enumdirection.opposite();
int j = 0;
+ // CraftBukkit start + // CraftBukkit start
+ final org.bukkit.block.Block bblock = world.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ()); + final org.bukkit.block.Block bblock = world.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ());
+ +

Datei anzeigen

@ -1,6 +1,6 @@
--- a/net/minecraft/server/BlockPlant.java --- a/net/minecraft/server/BlockPlant.java
+++ b/net/minecraft/server/BlockPlant.java +++ b/net/minecraft/server/BlockPlant.java
@@ -14,7 +14,14 @@ @@ -12,7 +12,14 @@
@Override @Override
public IBlockData updateState(IBlockData iblockdata, EnumDirection enumdirection, IBlockData iblockdata1, GeneratorAccess generatoraccess, BlockPosition blockposition, BlockPosition blockposition1) { public IBlockData updateState(IBlockData iblockdata, EnumDirection enumdirection, IBlockData iblockdata1, GeneratorAccess generatoraccess, BlockPosition blockposition, BlockPosition blockposition1) {

Datei anzeigen

@ -13,19 +13,19 @@
+ +
public class BlockPortal extends Block { public class BlockPortal extends Block {
public static final BlockStateEnum<EnumDirection.EnumAxis> AXIS = BlockProperties.D; public static final BlockStateEnum<EnumDirection.EnumAxis> AXIS = BlockProperties.E;
@@ -34,7 +41,8 @@ @@ -34,7 +41,8 @@
} }
if (worldserver.getType(blockposition).a((IBlockAccess) worldserver, blockposition, EntityTypes.ZOMBIE_PIGMAN)) { if (worldserver.getType(blockposition).a((IBlockAccess) worldserver, blockposition, EntityTypes.ZOMBIFIED_PIGLIN)) {
- Entity entity = EntityTypes.ZOMBIE_PIGMAN.spawnCreature(worldserver, (NBTTagCompound) null, (IChatBaseComponent) null, (EntityHuman) null, blockposition.up(), EnumMobSpawn.STRUCTURE, false, false); - Entity entity = EntityTypes.ZOMBIFIED_PIGLIN.spawnCreature(worldserver, (NBTTagCompound) null, (IChatBaseComponent) null, (EntityHuman) null, blockposition.up(), EnumMobSpawn.STRUCTURE, false, false);
+ // CraftBukkit - set spawn reason to NETHER_PORTAL + // CraftBukkit - set spawn reason to NETHER_PORTAL
+ Entity entity = EntityTypes.ZOMBIE_PIGMAN.spawnCreature(worldserver, (NBTTagCompound) null, (IChatBaseComponent) null, (EntityHuman) null, blockposition.up(), EnumMobSpawn.STRUCTURE, false, false, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.NETHER_PORTAL); + Entity entity = EntityTypes.ZOMBIFIED_PIGLIN.spawnCreature(worldserver, (NBTTagCompound) null, (IChatBaseComponent) null, (EntityHuman) null, blockposition.up(), EnumMobSpawn.STRUCTURE, false, false, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.NETHER_PORTAL);
if (entity != null) { if (entity != null) {
entity.portalCooldown = entity.ba(); entity.portalCooldown = entity.getDefaultPortalCooldown();
@@ -48,8 +56,10 @@ @@ -48,8 +56,10 @@
BlockPortal.Shape blockportal_shape = this.b(generatoraccess, blockposition); BlockPortal.Shape blockportal_shape = b(generatoraccess, blockposition);
if (blockportal_shape != null) { if (blockportal_shape != null) {
- blockportal_shape.createPortal(); - blockportal_shape.createPortal();
@ -45,7 +45,7 @@
+ EntityPortalEnterEvent event = new EntityPortalEnterEvent(entity.getBukkitEntity(), new org.bukkit.Location(world.getWorld(), blockposition.getX(), blockposition.getY(), blockposition.getZ())); + EntityPortalEnterEvent event = new EntityPortalEnterEvent(entity.getBukkitEntity(), new org.bukkit.Location(world.getWorld(), blockposition.getX(), blockposition.getY(), blockposition.getZ()));
+ world.getServer().getPluginManager().callEvent(event); + world.getServer().getPluginManager().callEvent(event);
+ // CraftBukkit end + // CraftBukkit end
entity.c(blockposition); entity.d(blockposition);
} }
@@ -172,6 +186,7 @@ @@ -172,6 +186,7 @@
@ -56,7 +56,7 @@
public Shape(GeneratorAccess generatoraccess, BlockPosition blockposition, EnumDirection.EnumAxis enumdirection_enumaxis) { public Shape(GeneratorAccess generatoraccess, BlockPosition blockposition, EnumDirection.EnumAxis enumdirection_enumaxis) {
this.a = generatoraccess; this.a = generatoraccess;
@@ -230,6 +245,9 @@ @@ -228,6 +243,9 @@
} }
protected int c() { protected int c() {
@ -66,9 +66,9 @@
int i; int i;
label56: label56:
@@ -252,11 +270,21 @@ @@ -247,9 +265,19 @@
block = this.a.getType(blockposition.shift(this.d)).getBlock(); if (i == 0) {
if (block != Blocks.OBSIDIAN) { if (!this.a.getType(blockposition.shift(this.d)).a(Blocks.OBSIDIAN)) {
break label56; break label56;
+ // CraftBukkit start - add the block to our list + // CraftBukkit start - add the block to our list
+ } else { + } else {
@ -76,20 +76,18 @@
+ blocks.add(CraftBlock.at(this.a, pos).getState()); + blocks.add(CraftBlock.at(this.a, pos).getState());
+ // CraftBukkit end + // CraftBukkit end
} }
} else if (i == this.width - 1) { } else if (i == this.width - 1 && !this.a.getType(blockposition.shift(this.c)).a(Blocks.OBSIDIAN)) {
block = this.a.getType(blockposition.shift(this.c)).getBlock(); break label56;
if (block != Blocks.OBSIDIAN) { + // CraftBukkit start - add the block to our list
break label56; + } else {
+ // CraftBukkit start - add the block to our list + BlockPosition pos = blockposition.shift(this.c);
+ } else { + blocks.add(CraftBlock.at(this.a, pos).getState());
+ BlockPosition pos = blockposition.shift(this.c); + // CraftBukkit end
+ blocks.add(CraftBlock.at(this.a, pos).getState());
+ // CraftBukkit end
}
} }
} }
@@ -266,6 +294,11 @@ }
if (this.a.getType(this.position.shift(this.c, i).up(this.height)).getBlock() != Blocks.OBSIDIAN) { @@ -258,6 +286,11 @@
if (!this.a.getType(this.position.shift(this.c, i).up(this.height)).a(Blocks.OBSIDIAN)) {
this.height = 0; this.height = 0;
break; break;
+ // CraftBukkit start - add the block to our list + // CraftBukkit start - add the block to our list
@ -100,7 +98,7 @@
} }
} }
@@ -289,7 +322,29 @@ @@ -279,7 +312,29 @@
return this.position != null && this.width >= 2 && this.width <= 21 && this.height >= 3 && this.height <= 21; return this.position != null && this.width >= 2 && this.width <= 21 && this.height >= 3 && this.height <= 21;
} }
@ -131,7 +129,7 @@
for (int i = 0; i < this.width; ++i) { for (int i = 0; i < this.width; ++i) {
BlockPosition blockposition = this.position.shift(this.c, i); BlockPosition blockposition = this.position.shift(this.c, i);
@@ -298,6 +353,7 @@ @@ -288,6 +343,7 @@
} }
} }

Datei anzeigen

@ -7,7 +7,7 @@
+ +
public class BlockPoweredRail extends BlockMinecartTrackAbstract { public class BlockPoweredRail extends BlockMinecartTrackAbstract {
public static final BlockStateEnum<BlockPropertyTrackPosition> SHAPE = BlockProperties.X; public static final BlockStateEnum<BlockPropertyTrackPosition> SHAPE = BlockProperties.ad;
@@ -102,6 +104,13 @@ @@ -102,6 +104,13 @@
boolean flag1 = world.isBlockIndirectlyPowered(blockposition) || this.a(world, blockposition, iblockdata, true, 0) || this.a(world, blockposition, iblockdata, false, 0); boolean flag1 = world.isBlockIndirectlyPowered(blockposition) || this.a(world, blockposition, iblockdata, true, 0) || this.a(world, blockposition, iblockdata, false, 0);
@ -21,4 +21,4 @@
+ // CraftBukkit end + // CraftBukkit end
world.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockPoweredRail.POWERED, flag1), 3); world.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockPoweredRail.POWERED, flag1), 3);
world.applyPhysics(blockposition.down(), this); world.applyPhysics(blockposition.down(), this);
if (((BlockPropertyTrackPosition) iblockdata.get(BlockPoweredRail.SHAPE)).b()) { if (((BlockPropertyTrackPosition) iblockdata.get(BlockPoweredRail.SHAPE)).c()) {

Datei anzeigen

@ -9,7 +9,7 @@
public abstract class BlockPressurePlateAbstract extends Block { public abstract class BlockPressurePlateAbstract extends Block {
protected static final VoxelShape a = Block.a(1.0D, 0.0D, 1.0D, 15.0D, 0.5D, 15.0D); protected static final VoxelShape a = Block.a(1.0D, 0.0D, 1.0D, 15.0D, 0.5D, 15.0D);
@@ -66,6 +68,19 @@ @@ -65,6 +67,19 @@
boolean flag = i > 0; boolean flag = i > 0;
boolean flag1 = j > 0; boolean flag1 = j > 0;

Datei anzeigen

@ -7,7 +7,7 @@
+ +
public class BlockPressurePlateWeighted extends BlockPressurePlateAbstract { public class BlockPressurePlateWeighted extends BlockPressurePlateAbstract {
public static final BlockStateInteger POWER = BlockProperties.at; public static final BlockStateInteger POWER = BlockProperties.az;
@@ -13,7 +15,31 @@ @@ -13,7 +15,31 @@
@Override @Override

Datei anzeigen

@ -10,7 +10,7 @@
+import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason; +import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason;
+// CraftBukkit end +// CraftBukkit end
+ +
public class BlockPumpkinCarved extends BlockFacingHorizontal { public class BlockPumpkinCarved extends BlockFacingHorizontal implements ItemWearable {
public static final BlockStateDirection a = BlockFacingHorizontal.FACING; public static final BlockStateDirection a = BlockFacingHorizontal.FACING;
@@ -42,19 +48,28 @@ @@ -42,19 +48,28 @@

Datei anzeigen

@ -8,8 +8,8 @@
+ +
public class BlockRedstoneComparator extends BlockDiodeAbstract implements ITileEntity { public class BlockRedstoneComparator extends BlockDiodeAbstract implements ITileEntity {
public static final BlockStateEnum<BlockPropertyComparatorMode> MODE = BlockProperties.az; public static final BlockStateEnum<BlockPropertyComparatorMode> MODE = BlockProperties.aG;
@@ -70,7 +72,8 @@ @@ -67,7 +69,8 @@
@Nullable @Nullable
private EntityItemFrame a(World world, EnumDirection enumdirection, BlockPosition blockposition) { private EntityItemFrame a(World world, EnumDirection enumdirection, BlockPosition blockposition) {
@ -19,7 +19,7 @@
return entityitemframe != null && entityitemframe.getDirection() == enumdirection; return entityitemframe != null && entityitemframe.getDirection() == enumdirection;
}); });
@@ -125,8 +128,18 @@ @@ -122,8 +125,18 @@
boolean flag1 = (Boolean) iblockdata.get(BlockRedstoneComparator.c); boolean flag1 = (Boolean) iblockdata.get(BlockRedstoneComparator.c);
if (flag1 && !flag) { if (flag1 && !flag) {

Datei anzeigen

@ -9,7 +9,7 @@
public class BlockRedstoneLamp extends Block { public class BlockRedstoneLamp extends Block {
public static final BlockStateBoolean a = BlockRedstoneTorch.LIT; public static final BlockStateBoolean a = BlockRedstoneTorch.LIT;
@@ -37,6 +39,11 @@ @@ -27,6 +29,11 @@
if (flag1) { if (flag1) {
world.getBlockTickList().a(blockposition, this, 4); world.getBlockTickList().a(blockposition, this, 4);
} else { } else {
@ -21,9 +21,9 @@
world.setTypeAndData(blockposition, (IBlockData) iblockdata.a((IBlockState) BlockRedstoneLamp.a), 2); world.setTypeAndData(blockposition, (IBlockData) iblockdata.a((IBlockState) BlockRedstoneLamp.a), 2);
} }
} }
@@ -47,6 +54,11 @@ @@ -37,6 +44,11 @@
@Override @Override
public void tick(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, Random random) { public void tickAlways(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, Random random) {
if ((Boolean) iblockdata.get(BlockRedstoneLamp.a) && !worldserver.isBlockIndirectlyPowered(blockposition)) { if ((Boolean) iblockdata.get(BlockRedstoneLamp.a) && !worldserver.isBlockIndirectlyPowered(blockposition)) {
+ // CraftBukkit start + // CraftBukkit start
+ if (CraftEventFactory.callRedstoneChange(worldserver, blockposition, 15, 0).getNewCurrent() != 0) { + if (CraftEventFactory.callRedstoneChange(worldserver, blockposition, 15, 0).getNewCurrent() != 0) {

Datei anzeigen

@ -12,7 +12,7 @@
public class BlockRedstoneOre extends Block { public class BlockRedstoneOre extends Block {
public static final BlockStateBoolean a = BlockRedstoneTorch.LIT; public static final BlockStateBoolean a = BlockRedstoneTorch.LIT;
@@ -18,14 +23,30 @@ @@ -13,14 +18,30 @@
@Override @Override
public void attack(IBlockData iblockdata, World world, BlockPosition blockposition, EntityHuman entityhuman) { public void attack(IBlockData iblockdata, World world, BlockPosition blockposition, EntityHuman entityhuman) {
@ -46,14 +46,17 @@
} }
@Override @Override
@@ -34,14 +55,19 @@ @@ -28,7 +49,7 @@
if (world.isClientSide) {
playEffect(world, blockposition); playEffect(world, blockposition);
return EnumInteractionResult.SUCCESS;
} else { } else {
- interact(iblockdata, world, blockposition); - interact(iblockdata, world, blockposition);
+ interact(iblockdata, world, blockposition, entityhuman); // CraftBukkit - add entityhuman + interact(iblockdata, world, blockposition, entityhuman); // CraftBukkit - add entityhuman
return EnumInteractionResult.PASS;
} }
ItemStack itemstack = entityhuman.b(enumhand);
@@ -36,9 +57,14 @@
return itemstack.getItem() instanceof ItemBlock && (new BlockActionContext(entityhuman, enumhand, itemstack, movingobjectpositionblock)).b() ? EnumInteractionResult.PASS : EnumInteractionResult.SUCCESS;
} }
- private static void interact(IBlockData iblockdata, World world, BlockPosition blockposition) { - private static void interact(IBlockData iblockdata, World world, BlockPosition blockposition) {
@ -68,7 +71,7 @@
world.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockRedstoneOre.a, true), 3); world.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockRedstoneOre.a, true), 3);
} }
@@ -50,6 +76,11 @@ @@ -52,6 +78,11 @@
@Override @Override
public void tick(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, Random random) { public void tick(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, Random random) {
if ((Boolean) iblockdata.get(BlockRedstoneOre.a)) { if ((Boolean) iblockdata.get(BlockRedstoneOre.a)) {
@ -80,7 +83,7 @@
worldserver.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockRedstoneOre.a, false), 3); worldserver.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockRedstoneOre.a, false), 3);
} }
@@ -58,12 +89,25 @@ @@ -60,12 +91,25 @@
@Override @Override
public void dropNaturally(IBlockData iblockdata, World world, BlockPosition blockposition, ItemStack itemstack) { public void dropNaturally(IBlockData iblockdata, World world, BlockPosition blockposition, ItemStack itemstack) {
super.dropNaturally(iblockdata, world, blockposition, itemstack); super.dropNaturally(iblockdata, world, blockposition, itemstack);

Datei anzeigen

@ -9,13 +9,13 @@
public class BlockRedstoneTorch extends BlockTorch { public class BlockRedstoneTorch extends BlockTorch {
public static final BlockStateBoolean LIT = BlockProperties.r; public static final BlockStateBoolean LIT = BlockProperties.r;
@@ -70,8 +72,24 @@ @@ -62,8 +64,24 @@
list.remove(0); list.remove(0);
} }
+ // CraftBukkit start + // CraftBukkit start
+ org.bukkit.plugin.PluginManager manager = world.getServer().getPluginManager(); + org.bukkit.plugin.PluginManager manager = worldserver.getServer().getPluginManager();
+ org.bukkit.block.Block block = world.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ()); + org.bukkit.block.Block block = worldserver.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ());
+ int oldCurrent = ((Boolean) iblockdata.get(BlockRedstoneTorch.LIT)).booleanValue() ? 15 : 0; + int oldCurrent = ((Boolean) iblockdata.get(BlockRedstoneTorch.LIT)).booleanValue() ? 15 : 0;
+ +
+ BlockRedstoneEvent event = new BlockRedstoneEvent(block, oldCurrent, oldCurrent); + BlockRedstoneEvent event = new BlockRedstoneEvent(block, oldCurrent, oldCurrent);
@ -31,13 +31,13 @@
+ } + }
+ } + }
+ // CraftBukkit end + // CraftBukkit end
world.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockRedstoneTorch.LIT, false), 3); worldserver.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockRedstoneTorch.LIT, false), 3);
if (a(world, blockposition, true)) { if (a(worldserver, blockposition, true)) {
world.triggerEffect(1502, blockposition, 0); worldserver.triggerEffect(1502, blockposition, 0);
@@ -79,6 +97,15 @@ @@ -71,6 +89,15 @@
} }
} }
} else if (!flag && !a(world, blockposition, false)) { } else if (!flag && !a(worldserver, blockposition, false)) {
+ // CraftBukkit start + // CraftBukkit start
+ if (oldCurrent != 15) { + if (oldCurrent != 15) {
+ event.setNewCurrent(15); + event.setNewCurrent(15);
@ -47,6 +47,6 @@
+ } + }
+ } + }
+ // CraftBukkit end + // CraftBukkit end
world.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockRedstoneTorch.LIT, true), 3); worldserver.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockRedstoneTorch.LIT, true), 3);
} }

Datei anzeigen

@ -1,6 +1,6 @@
--- a/net/minecraft/server/BlockRedstoneWire.java --- a/net/minecraft/server/BlockRedstoneWire.java
+++ b/net/minecraft/server/BlockRedstoneWire.java +++ b/net/minecraft/server/BlockRedstoneWire.java
@@ -11,6 +11,8 @@ @@ -9,6 +9,8 @@
import java.util.Set; import java.util.Set;
import javax.annotation.Nullable; import javax.annotation.Nullable;
@ -8,20 +8,20 @@
+ +
public class BlockRedstoneWire extends Block { public class BlockRedstoneWire extends Block {
public static final BlockStateEnum<BlockPropertyRedstoneSide> NORTH = BlockProperties.R; public static final BlockStateEnum<BlockPropertyRedstoneSide> NORTH = BlockProperties.X;
@@ -206,6 +208,15 @@ @@ -213,7 +215,14 @@
l = j; private void a(World world, BlockPosition blockposition, IBlockData iblockdata) {
} int i = this.a(world, blockposition);
- if ((Integer) iblockdata.get(BlockRedstoneWire.POWER) != i) {
+ // CraftBukkit start + // CraftBukkit start
+ if (i != l) { + int oldPower = (Integer) iblockdata.get(BlockRedstoneWire.POWER);
+ BlockRedstoneEvent event = new BlockRedstoneEvent(world.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ()), i, l); + if (oldPower != i) {
+ BlockRedstoneEvent event = new BlockRedstoneEvent(world.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ()), oldPower, i);
+ world.getServer().getPluginManager().callEvent(event); + world.getServer().getPluginManager().callEvent(event);
+ +
+ l = event.getNewCurrent(); + i = event.getNewCurrent();
+ } + // CraftBukkit end
+ // CraftBukkit end if (world.getType(blockposition) == iblockdata) {
+ world.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockRedstoneWire.POWER, i), 2);
if (i != l) { }
iblockdata = (IBlockData) iblockdata.set(BlockRedstoneWire.POWER, l);
if (world.getType(blockposition) == iblockdata1) {

Datei anzeigen

@ -1,6 +1,6 @@
--- a/net/minecraft/server/BlockReed.java --- a/net/minecraft/server/BlockReed.java
+++ b/net/minecraft/server/BlockReed.java +++ b/net/minecraft/server/BlockReed.java
@@ -33,7 +33,7 @@ @@ -39,7 +39,7 @@
int j = (Integer) iblockdata.get(BlockReed.AGE); int j = (Integer) iblockdata.get(BlockReed.AGE);
if (j == 15) { if (j == 15) {

Datei anzeigen

@ -13,16 +13,16 @@
+ +
public class BlockSapling extends BlockPlant implements IBlockFragilePlantElement { public class BlockSapling extends BlockPlant implements IBlockFragilePlantElement {
public static final BlockStateInteger STAGE = BlockProperties.au; public static final BlockStateInteger STAGE = BlockProperties.aA;
protected static final VoxelShape b = Block.a(2.0D, 0.0D, 2.0D, 14.0D, 12.0D, 14.0D); protected static final VoxelShape b = Block.a(2.0D, 0.0D, 2.0D, 14.0D, 12.0D, 14.0D);
private final WorldGenTreeProvider c; private final WorldGenTreeProvider c;
+ public static TreeType treeType; // CraftBukkit + public static TreeType treeType; // CraftBukkit
protected BlockSapling(WorldGenTreeProvider worldgentreeprovider, Block.Info block_info) { protected BlockSapling(WorldGenTreeProvider worldgentreeprovider, BlockBase.Info blockbase_info) {
super(block_info); super(blockbase_info);
@@ -23,7 +31,30 @@ @@ -22,7 +30,30 @@
@Override
public void tick(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, Random random) { public void tick(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, Random random) {
super.tick(iblockdata, worldserver, blockposition, random);
if (worldserver.getLightLevel(blockposition.up()) >= 9 && random.nextInt(7) == 0) { if (worldserver.getLightLevel(blockposition.up()) >= 9 && random.nextInt(7) == 0) {
+ // CraftBukkit start + // CraftBukkit start
+ worldserver.captureTreeGeneration = true; + worldserver.captureTreeGeneration = true;

Datei anzeigen

@ -1,6 +1,6 @@
--- a/net/minecraft/server/BlockSnow.java --- a/net/minecraft/server/BlockSnow.java
+++ b/net/minecraft/server/BlockSnow.java +++ b/net/minecraft/server/BlockSnow.java
@@ -58,6 +58,11 @@ @@ -67,6 +67,11 @@
@Override @Override
public void tick(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, Random random) { public void tick(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, Random random) {
if (worldserver.getBrightness(EnumSkyBlock.BLOCK, blockposition) > 11) { if (worldserver.getBrightness(EnumSkyBlock.BLOCK, blockposition) > 11) {

Datei anzeigen

@ -11,23 +11,22 @@
+ +
public class BlockSoil extends Block { public class BlockSoil extends Block {
public static final BlockStateInteger MOISTURE = BlockProperties.aq; public static final BlockStateInteger MOISTURE = BlockProperties.aw;
@@ -53,12 +58,12 @@ @@ -58,26 +63,49 @@
if (!a((IWorldReader) worldserver, blockposition) && !worldserver.isRainingAt(blockposition.up())) { if (!a((IWorldReader) worldserver, blockposition) && !worldserver.isRainingAt(blockposition.up())) {
if (i > 0) { if (i > 0) {
- worldserver.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockSoil.MOISTURE, i - 1), 2); - worldserver.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockSoil.MOISTURE, i - 1), 2);
+ org.bukkit.craftbukkit.event.CraftEventFactory.handleMoistureChangeEvent(worldserver, blockposition, (IBlockData) iblockdata.set(BlockSoil.MOISTURE, i - 1), 2); // CraftBukkit + org.bukkit.craftbukkit.event.CraftEventFactory.handleMoistureChangeEvent(worldserver, blockposition, (IBlockData) iblockdata.set(BlockSoil.MOISTURE, i - 1), 2); // CraftBukkit
} else if (!a((IBlockAccess) worldserver, blockposition)) { } else if (!a((IBlockAccess) worldserver, blockposition)) {
fade(iblockdata, worldserver, blockposition); fade(iblockdata, worldserver, blockposition);
}
} else if (i < 7) {
- worldserver.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockSoil.MOISTURE, 7), 2);
+ org.bukkit.craftbukkit.event.CraftEventFactory.handleMoistureChangeEvent(worldserver, blockposition, (IBlockData) iblockdata.set(BlockSoil.MOISTURE, 7), 2); // CraftBukkit
} }
} else if (i < 7) {
- worldserver.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockSoil.MOISTURE, 7), 2);
+ org.bukkit.craftbukkit.event.CraftEventFactory.handleMoistureChangeEvent(worldserver, blockposition, (IBlockData) iblockdata.set(BlockSoil.MOISTURE, 7), 2); // CraftBukkit
} }
@@ -66,14 +71,37 @@
}
@Override @Override
public void fallOn(World world, BlockPosition blockposition, Entity entity, float f) { public void fallOn(World world, BlockPosition blockposition, Entity entity, float f) {

Datei anzeigen

@ -33,7 +33,7 @@
+ // CraftBukkit end + // CraftBukkit end
Material material = iblockdata.getMaterial(); Material material = iblockdata.getMaterial();
if (fluid.a(TagsFluid.WATER)) { if (fluid.a((Tag) TagsFluid.WATER)) {
- if (iblockdata.getBlock() instanceof IFluidSource && ((IFluidSource) iblockdata.getBlock()).removeFluid(world, blockposition2, iblockdata) != FluidTypes.EMPTY) { - if (iblockdata.getBlock() instanceof IFluidSource && ((IFluidSource) iblockdata.getBlock()).removeFluid(world, blockposition2, iblockdata) != FluidTypes.EMPTY) {
+ if (iblockdata.getBlock() instanceof IFluidSource && ((IFluidSource) iblockdata.getBlock()).removeFluid(blockList, blockposition2, iblockdata) != FluidTypes.EMPTY) { // CraftBukkit + if (iblockdata.getBlock() instanceof IFluidSource && ((IFluidSource) iblockdata.getBlock()).removeFluid(blockList, blockposition2, iblockdata) != FluidTypes.EMPTY) { // CraftBukkit
++i; ++i;

Datei anzeigen

@ -1,7 +1,7 @@
--- a/net/minecraft/server/BlockStateInteger.java --- a/net/minecraft/server/BlockStateInteger.java
+++ b/net/minecraft/server/BlockStateInteger.java +++ b/net/minecraft/server/BlockStateInteger.java
@@ -9,9 +9,15 @@ @@ -9,9 +9,15 @@
public class BlockStateInteger extends BlockState<Integer> { public class BlockStateInteger extends IBlockState<Integer> {
private final ImmutableSet<Integer> a; private final ImmutableSet<Integer> a;
+ // CraftBukkit start + // CraftBukkit start

Datei anzeigen

@ -8,8 +8,8 @@
+ +
public class BlockStem extends BlockPlant implements IBlockFragilePlantElement { public class BlockStem extends BlockPlant implements IBlockFragilePlantElement {
public static final BlockStateInteger AGE = BlockProperties.ac; public static final BlockStateInteger AGE = BlockProperties.ai;
@@ -35,14 +37,18 @@ @@ -34,14 +36,18 @@
if (i < 7) { if (i < 7) {
iblockdata = (IBlockData) iblockdata.set(BlockStem.AGE, i + 1); iblockdata = (IBlockData) iblockdata.set(BlockStem.AGE, i + 1);
@ -18,9 +18,9 @@
} else { } else {
EnumDirection enumdirection = EnumDirection.EnumDirectionLimit.HORIZONTAL.a(random); EnumDirection enumdirection = EnumDirection.EnumDirectionLimit.HORIZONTAL.a(random);
BlockPosition blockposition1 = blockposition.shift(enumdirection); BlockPosition blockposition1 = blockposition.shift(enumdirection);
Block block = worldserver.getType(blockposition1.down()).getBlock(); IBlockData iblockdata1 = worldserver.getType(blockposition1.down());
if (worldserver.getType(blockposition1).isAir() && (block == Blocks.FARMLAND || block == Blocks.DIRT || block == Blocks.COARSE_DIRT || block == Blocks.PODZOL || block == Blocks.GRASS_BLOCK)) { if (worldserver.getType(blockposition1).isAir() && (iblockdata1.a(Blocks.FARMLAND) || iblockdata1.a(Blocks.DIRT) || iblockdata1.a(Blocks.COARSE_DIRT) || iblockdata1.a(Blocks.PODZOL) || iblockdata1.a(Blocks.GRASS_BLOCK))) {
- worldserver.setTypeUpdate(blockposition1, this.blockFruit.getBlockData()); - worldserver.setTypeUpdate(blockposition1, this.blockFruit.getBlockData());
+ // CraftBukkit start + // CraftBukkit start
+ if (!CraftEventFactory.handleBlockGrowEvent(worldserver, blockposition1, this.blockFruit.getBlockData())) { + if (!CraftEventFactory.handleBlockGrowEvent(worldserver, blockposition1, this.blockFruit.getBlockData())) {
@ -30,12 +30,12 @@
worldserver.setTypeUpdate(blockposition, (IBlockData) this.blockFruit.d().getBlockData().set(BlockFacingHorizontal.FACING, enumdirection)); worldserver.setTypeUpdate(blockposition, (IBlockData) this.blockFruit.d().getBlockData().set(BlockFacingHorizontal.FACING, enumdirection));
} }
} }
@@ -66,7 +72,7 @@ @@ -65,7 +71,7 @@
int i = Math.min(7, (Integer) iblockdata.get(BlockStem.AGE) + MathHelper.nextInt(worldserver.random, 2, 5)); int i = Math.min(7, (Integer) iblockdata.get(BlockStem.AGE) + MathHelper.nextInt(worldserver.random, 2, 5));
IBlockData iblockdata1 = (IBlockData) iblockdata.set(BlockStem.AGE, i); IBlockData iblockdata1 = (IBlockData) iblockdata.set(BlockStem.AGE, i);
- worldserver.setTypeAndData(blockposition, iblockdata1, 2); - worldserver.setTypeAndData(blockposition, iblockdata1, 2);
+ CraftEventFactory.handleBlockGrowEvent(worldserver, blockposition, iblockdata1, 2); // CraftBukkit + CraftEventFactory.handleBlockGrowEvent(worldserver, blockposition, iblockdata1, 2); // CraftBukkit
if (i == 7) { if (i == 7) {
iblockdata1.a(worldserver, blockposition, worldserver.random); iblockdata1.b(worldserver, blockposition, worldserver.random);
} }

Datei anzeigen

@ -11,7 +11,7 @@
public class BlockSweetBerryBush extends BlockPlant implements IBlockFragilePlantElement { public class BlockSweetBerryBush extends BlockPlant implements IBlockFragilePlantElement {
@@ -24,7 +28,7 @@ @@ -28,7 +32,7 @@
int i = (Integer) iblockdata.get(BlockSweetBerryBush.a); int i = (Integer) iblockdata.get(BlockSweetBerryBush.a);
if (i < 3 && random.nextInt(5) == 0 && worldserver.getLightLevel(blockposition.up(), 0) >= 9) { if (i < 3 && random.nextInt(5) == 0 && worldserver.getLightLevel(blockposition.up(), 0) >= 9) {
@ -20,8 +20,8 @@
} }
} }
@@ -38,7 +42,9 @@ @@ -42,7 +46,9 @@
double d1 = Math.abs(entity.locZ() - entity.G); double d1 = Math.abs(entity.locZ() - entity.F);
if (d0 >= 0.003000000026077032D || d1 >= 0.003000000026077032D) { if (d0 >= 0.003000000026077032D || d1 >= 0.003000000026077032D) {
+ CraftEventFactory.blockDamage = CraftBlock.at(world, blockposition); // CraftBukkit + CraftEventFactory.blockDamage = CraftBlock.at(world, blockposition); // CraftBukkit

Datei anzeigen

@ -1,14 +1,14 @@
--- a/net/minecraft/server/BlockTNT.java --- a/net/minecraft/server/BlockTNT.java
+++ b/net/minecraft/server/BlockTNT.java +++ b/net/minecraft/server/BlockTNT.java
@@ -95,6 +95,11 @@ @@ -94,6 +94,11 @@
if (entityarrow.isBurning()) { if (iprojectile.isBurning()) {
BlockPosition blockposition = movingobjectpositionblock.getBlockPosition(); BlockPosition blockposition = movingobjectpositionblock.getBlockPosition();
+ // CraftBukkit start + // CraftBukkit start
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(entityarrow, blockposition, Blocks.AIR.getBlockData()).isCancelled()) { + if (org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(iprojectile, blockposition, Blocks.AIR.getBlockData()).isCancelled()) {
+ return; + return;
+ } + }
+ // CraftBukkit end + // CraftBukkit end
a(world, blockposition, entity1 instanceof EntityLiving ? (EntityLiving) entity1 : null); a(world, blockposition, entity instanceof EntityLiving ? (EntityLiving) entity : null);
world.a(blockposition, false); world.a(blockposition, false);

Datei anzeigen

@ -1,14 +1,14 @@
--- a/net/minecraft/server/BlockTallPlant.java --- a/net/minecraft/server/BlockTallPlant.java
+++ b/net/minecraft/server/BlockTallPlant.java +++ b/net/minecraft/server/BlockTallPlant.java
@@ -54,6 +54,11 @@ @@ -66,6 +66,11 @@
}
@Override protected static void b(World world, BlockPosition blockposition, IBlockData iblockdata, EntityHuman entityhuman) {
public void a(World world, BlockPosition blockposition, IBlockData iblockdata, EntityHuman entityhuman) {
+ // CraftBukkit start + // CraftBukkit start
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callBlockPhysicsEvent(world, blockposition).isCancelled()) { + if (org.bukkit.craftbukkit.event.CraftEventFactory.callBlockPhysicsEvent(world, blockposition).isCancelled()) {
+ return; + return;
+ } + }
+ // CraftBukkit end + // CraftBukkit end
BlockPropertyDoubleBlockHalf blockpropertydoubleblockhalf = (BlockPropertyDoubleBlockHalf) iblockdata.get(BlockTallPlant.HALF); BlockPropertyDoubleBlockHalf blockpropertydoubleblockhalf = (BlockPropertyDoubleBlockHalf) iblockdata.get(BlockTallPlant.HALF);
BlockPosition blockposition1 = blockpropertydoubleblockhalf == BlockPropertyDoubleBlockHalf.LOWER ? blockposition.up() : blockposition.down();
IBlockData iblockdata1 = world.getType(blockposition1); if (blockpropertydoubleblockhalf == BlockPropertyDoubleBlockHalf.UPPER) {

Datei anzeigen

@ -13,27 +13,27 @@
public class BlockTurtleEgg extends Block { public class BlockTurtleEgg extends Block {
@@ -35,6 +41,19 @@ @@ -36,6 +42,19 @@
super.stepOn(world, blockposition, entity); IBlockData iblockdata = world.getType(blockposition);
} else {
if (!world.isClientSide && world.random.nextInt(i) == 0) {
+ // CraftBukkit start - Step on eggs
+ org.bukkit.event.Cancellable cancellable;
+ if (entity instanceof EntityHuman) {
+ cancellable = CraftEventFactory.callPlayerInteractEvent((EntityHuman) entity, org.bukkit.event.block.Action.PHYSICAL, blockposition, null, null, null);
+ } else {
+ cancellable = new EntityInteractEvent(entity.getBukkitEntity(), CraftBlock.at(world, blockposition));
+ world.getServer().getPluginManager().callEvent((EntityInteractEvent) cancellable);
+ }
+
+ if (cancellable.isCancelled()) {
+ return;
+ }
+ // CraftBukkit end
this.a(world, blockposition, world.getType(blockposition));
}
@@ -60,9 +79,19 @@ if (iblockdata.a(Blocks.TURTLE_EGG)) {
+ // CraftBukkit start - Step on eggs
+ org.bukkit.event.Cancellable cancellable;
+ if (entity instanceof EntityHuman) {
+ cancellable = CraftEventFactory.callPlayerInteractEvent((EntityHuman) entity, org.bukkit.event.block.Action.PHYSICAL, blockposition, null, null, null);
+ } else {
+ cancellable = new EntityInteractEvent(entity.getBukkitEntity(), CraftBlock.at(world, blockposition));
+ world.getServer().getPluginManager().callEvent((EntityInteractEvent) cancellable);
+ }
+
+ if (cancellable.isCancelled()) {
+ return;
+ }
+ // CraftBukkit end
this.a(world, blockposition, iblockdata);
}
}
@@ -62,9 +81,19 @@
int i = (Integer) iblockdata.get(BlockTurtleEgg.a); int i = (Integer) iblockdata.get(BlockTurtleEgg.a);
if (i < 2) { if (i < 2) {
@ -54,9 +54,9 @@
worldserver.playSound((EntityHuman) null, blockposition, SoundEffects.ENTITY_TURTLE_EGG_HATCH, SoundCategory.BLOCKS, 0.7F, 0.9F + random.nextFloat() * 0.2F); worldserver.playSound((EntityHuman) null, blockposition, SoundEffects.ENTITY_TURTLE_EGG_HATCH, SoundCategory.BLOCKS, 0.7F, 0.9F + random.nextFloat() * 0.2F);
worldserver.a(blockposition, false); worldserver.a(blockposition, false);
@@ -73,7 +102,7 @@ @@ -75,7 +104,7 @@
entityturtle.setAgeRaw(-24000); entityturtle.setAgeRaw(-24000);
entityturtle.g(blockposition); entityturtle.setHomePos(blockposition);
entityturtle.setPositionRotation((double) blockposition.getX() + 0.3D + (double) j * 0.2D, (double) blockposition.getY(), (double) blockposition.getZ() + 0.3D, 0.0F, 0.0F); entityturtle.setPositionRotation((double) blockposition.getX() + 0.3D + (double) j * 0.2D, (double) blockposition.getY(), (double) blockposition.getZ() + 0.3D, 0.0F, 0.0F);
- worldserver.addEntity(entityturtle); - worldserver.addEntity(entityturtle);
+ worldserver.addEntity(entityturtle, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.EGG); // CraftBukkit + worldserver.addEntity(entityturtle, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.EGG); // CraftBukkit

Datei anzeigen

@ -1,7 +1,7 @@
--- a/net/minecraft/server/BlockVine.java --- a/net/minecraft/server/BlockVine.java
+++ b/net/minecraft/server/BlockVine.java +++ b/net/minecraft/server/BlockVine.java
@@ -6,6 +6,8 @@ @@ -5,6 +5,8 @@
import java.util.Map.Entry; import java.util.Random;
import javax.annotation.Nullable; import javax.annotation.Nullable;
+import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit +import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit
@ -9,7 +9,7 @@
public class BlockVine extends Block { public class BlockVine extends Block {
public static final BlockStateBoolean UP = BlockSprawling.e; public static final BlockStateBoolean UP = BlockSprawling.e;
@@ -177,20 +179,24 @@ @@ -166,20 +168,24 @@
BlockPosition blockposition3 = blockposition2.shift(enumdirection1); BlockPosition blockposition3 = blockposition2.shift(enumdirection1);
BlockPosition blockposition4 = blockposition2.shift(enumdirection2); BlockPosition blockposition4 = blockposition2.shift(enumdirection2);
@ -39,21 +39,21 @@
} }
} else if (a((IBlockAccess) worldserver, blockposition2, enumdirection)) { } else if (a((IBlockAccess) worldserver, blockposition2, enumdirection)) {
worldserver.setTypeAndData(blockposition, (IBlockData) iblockdata.set(getDirection(enumdirection), true), 2); worldserver.setTypeAndData(blockposition, (IBlockData) iblockdata.set(getDirection(enumdirection), true), 2);
@@ -220,7 +226,7 @@ @@ -209,7 +215,7 @@
} }
if (this.canSpread(iblockdata3)) { if (this.canSpread(iblockdata2)) {
- worldserver.setTypeAndData(blockposition1, iblockdata3, 2); - worldserver.setTypeAndData(blockposition1, iblockdata2, 2);
+ CraftEventFactory.handleBlockSpreadEvent(worldserver, blockposition, blockposition1, iblockdata3, 2); // CraftBukkit + CraftEventFactory.handleBlockSpreadEvent(worldserver, blockposition, blockposition1, iblockdata2, 2); // CraftBukkit
} }
return; return;
@@ -235,7 +241,7 @@ @@ -224,7 +230,7 @@
IBlockData iblockdata5 = this.a(iblockdata, iblockdata4, random); IBlockData iblockdata4 = this.a(iblockdata, iblockdata3, random);
if (iblockdata4 != iblockdata5 && this.canSpread(iblockdata5)) { if (iblockdata3 != iblockdata4 && this.canSpread(iblockdata4)) {
- worldserver.setTypeAndData(blockposition2, iblockdata5, 2); - worldserver.setTypeAndData(blockposition2, iblockdata4, 2);
+ CraftEventFactory.handleBlockSpreadEvent(worldserver, blockposition, blockposition2, iblockdata5, 2); // CraftBukkit + CraftEventFactory.handleBlockSpreadEvent(worldserver, blockposition, blockposition2, iblockdata4, 2); // CraftBukkit
} }
} }
} }

Datei anzeigen

@ -1,6 +1,6 @@
--- a/net/minecraft/server/BlockWitherRose.java --- a/net/minecraft/server/BlockWitherRose.java
+++ b/net/minecraft/server/BlockWitherRose.java +++ b/net/minecraft/server/BlockWitherRose.java
@@ -20,7 +20,7 @@ @@ -18,7 +18,7 @@
EntityLiving entityliving = (EntityLiving) entity; EntityLiving entityliving = (EntityLiving) entity;
if (!entityliving.isInvulnerable(DamageSource.WITHER)) { if (!entityliving.isInvulnerable(DamageSource.WITHER)) {

Datei anzeigen

@ -18,8 +18,8 @@
public static void a(World world, BlockPosition blockposition, TileEntitySkull tileentityskull) { public static void a(World world, BlockPosition blockposition, TileEntitySkull tileentityskull) {
+ if (world.captureBlockStates) return; // CraftBukkit + if (world.captureBlockStates) return; // CraftBukkit
if (!world.isClientSide) { if (!world.isClientSide) {
Block block = tileentityskull.getBlock().getBlock(); IBlockData iblockdata = tileentityskull.getBlock();
boolean flag = block == Blocks.WITHER_SKELETON_SKULL || block == Blocks.WITHER_SKELETON_WALL_SKULL; boolean flag = iblockdata.a(Blocks.WITHER_SKELETON_SKULL) || iblockdata.a(Blocks.WITHER_SKELETON_WALL_SKULL);
@@ -35,12 +41,14 @@ @@ -35,12 +41,14 @@
ShapeDetector.ShapeDetectorCollection shapedetector_shapedetectorcollection = shapedetector.a(world, blockposition); ShapeDetector.ShapeDetectorCollection shapedetector_shapedetectorcollection = shapedetector.a(world, blockposition);
@ -38,9 +38,9 @@
} }
@@ -50,6 +58,15 @@ @@ -50,6 +58,15 @@
entitywither.setPositionRotation((double) blockposition1.getX() + 0.5D, (double) blockposition1.getY() + 0.55D, (double) blockposition1.getZ() + 0.5D, shapedetector_shapedetectorcollection.getFacing().m() == EnumDirection.EnumAxis.X ? 0.0F : 90.0F, 0.0F); entitywither.setPositionRotation((double) blockposition1.getX() + 0.5D, (double) blockposition1.getY() + 0.55D, (double) blockposition1.getZ() + 0.5D, shapedetector_shapedetectorcollection.getFacing().n() == EnumDirection.EnumAxis.X ? 0.0F : 90.0F, 0.0F);
entitywither.aI = shapedetector_shapedetectorcollection.getFacing().m() == EnumDirection.EnumAxis.X ? 0.0F : 90.0F; entitywither.aH = shapedetector_shapedetectorcollection.getFacing().n() == EnumDirection.EnumAxis.X ? 0.0F : 90.0F;
entitywither.l(); entitywither.beginSpawnSequence();
+ // CraftBukkit start + // CraftBukkit start
+ if (!world.addEntity(entitywither, SpawnReason.BUILD_WITHER)) { + if (!world.addEntity(entitywither, SpawnReason.BUILD_WITHER)) {
+ return; + return;

Datei anzeigen

@ -0,0 +1,35 @@
--- a/net/minecraft/server/ChatHexColor.java
+++ b/net/minecraft/server/ChatHexColor.java
@@ -10,7 +10,7 @@
public final class ChatHexColor {
private static final Map<EnumChatFormat, ChatHexColor> a = (Map) Stream.of(EnumChatFormat.values()).filter(EnumChatFormat::d).collect(ImmutableMap.toImmutableMap(Function.identity(), (enumchatformat) -> {
- return new ChatHexColor(enumchatformat.e(), enumchatformat.f());
+ return new ChatHexColor(enumchatformat.e(), enumchatformat.f(), enumchatformat); // CraftBukkit
}));
private static final Map<String, ChatHexColor> b = (Map) ChatHexColor.a.values().stream().collect(ImmutableMap.toImmutableMap((chathexcolor) -> {
return chathexcolor.name;
@@ -18,16 +18,22 @@
private final int rgb;
@Nullable
public final String name;
+ // CraftBukkit start
+ @Nullable
+ public final EnumChatFormat format;
- private ChatHexColor(int i, String s) {
+ private ChatHexColor(int i, String s, EnumChatFormat format) {
this.rgb = i;
this.name = s;
+ this.format = format;
}
private ChatHexColor(int i) {
this.rgb = i;
this.name = null;
+ this.format = null;
}
+ // CraftBukkit end
public String b() {
return this.name != null ? this.name : this.c();

Datei anzeigen

@ -0,0 +1,23 @@
--- a/net/minecraft/server/ChatModifier.java
+++ b/net/minecraft/server/ChatModifier.java
@@ -114,6 +114,20 @@
return new ChatModifier(this.color, this.bold, obool, this.underlined, this.strikethrough, this.obfuscated, this.clickEvent, this.hoverEvent, this.insertion, this.font);
}
+ // CraftBukkit start
+ public ChatModifier setStrikethrough(@Nullable Boolean obool) {
+ return new ChatModifier(this.color, this.bold, this.italic, this.underlined, obool, this.obfuscated, this.clickEvent, this.hoverEvent, this.insertion, this.font);
+ }
+
+ public ChatModifier setUnderline(@Nullable Boolean obool) {
+ return new ChatModifier(this.color, this.bold, this.italic, obool, this.strikethrough, this.obfuscated, this.clickEvent, this.hoverEvent, this.insertion, this.font);
+ }
+
+ public ChatModifier setRandom(@Nullable Boolean obool) {
+ return new ChatModifier(this.color, this.bold, this.italic, this.underlined, this.strikethrough, obool, this.clickEvent, this.hoverEvent, this.insertion, this.font);
+ }
+ // CraftBukkit end
+
public ChatModifier setChatClickable(@Nullable ChatClickable chatclickable) {
return new ChatModifier(this.color, this.bold, this.italic, this.underlined, this.strikethrough, this.obfuscated, chatclickable, this.hoverEvent, this.insertion, this.font);
}

Datei anzeigen

@ -1,6 +1,24 @@
--- a/net/minecraft/server/Chunk.java --- a/net/minecraft/server/Chunk.java
+++ b/net/minecraft/server/Chunk.java +++ b/net/minecraft/server/Chunk.java
@@ -95,8 +95,19 @@ @@ -31,7 +31,7 @@
private BiomeStorage d;
private final Map<BlockPosition, NBTTagCompound> e;
public boolean loaded;
- public final World world;
+ public final WorldServer world; // CraftBukkit - type
public final Map<HeightMap.Type, HeightMap> heightMap;
private final ChunkConverter i;
public final Map<BlockPosition, TileEntity> tileEntities;
@@ -65,7 +65,7 @@
this.m = Maps.newHashMap();
this.n = new ShortList[16];
this.entitySlices = (EntitySlice[]) (new EntitySlice[16]);
- this.world = world;
+ this.world = (WorldServer) world; // CraftBukkit - type
this.loc = chunkcoordintpair;
this.i = chunkconverter;
HeightMap.Type[] aheightmap_type = HeightMap.Type.values();
@@ -96,8 +96,19 @@
} }
} }
@ -20,7 +38,7 @@
public Chunk(World world, ProtoChunk protochunk) { public Chunk(World world, ProtoChunk protochunk) {
this(world, protochunk.getPos(), protochunk.getBiomeIndex(), protochunk.p(), protochunk.n(), protochunk.o(), protochunk.getInhabitedTime(), protochunk.getSections(), (Consumer) null); this(world, protochunk.getPos(), protochunk.getBiomeIndex(), protochunk.p(), protochunk.n(), protochunk.o(), protochunk.getInhabitedTime(), protochunk.getSections(), (Consumer) null);
Iterator iterator = protochunk.y().iterator(); Iterator iterator = protochunk.y().iterator();
@@ -138,6 +149,7 @@ @@ -139,6 +150,7 @@
this.b(protochunk.r()); this.b(protochunk.r());
this.s = true; this.s = true;
@ -28,7 +46,7 @@
} }
@Override @Override
@@ -228,9 +240,16 @@ @@ -229,9 +241,16 @@
} }
} }
@ -45,7 +63,7 @@
int i = blockposition.getX() & 15; int i = blockposition.getX() & 15;
int j = blockposition.getY(); int j = blockposition.getY();
int k = blockposition.getZ() & 15; int k = blockposition.getZ() & 15;
@@ -282,7 +301,8 @@ @@ -283,7 +302,8 @@
} }
} }
@ -55,7 +73,7 @@
iblockdata.onPlace(this.world, blockposition, iblockdata1, flag); iblockdata.onPlace(this.world, blockposition, iblockdata1, flag);
} }
@@ -377,7 +397,12 @@ @@ -378,7 +398,12 @@
@Nullable @Nullable
public TileEntity a(BlockPosition blockposition, Chunk.EnumTileEntityState chunk_enumtileentitystate) { public TileEntity a(BlockPosition blockposition, Chunk.EnumTileEntityState chunk_enumtileentitystate) {
@ -69,8 +87,8 @@
if (tileentity == null) { if (tileentity == null) {
NBTTagCompound nbttagcompound = (NBTTagCompound) this.e.remove(blockposition); NBTTagCompound nbttagcompound = (NBTTagCompound) this.e.remove(blockposition);
@@ -423,6 +448,13 @@ @@ -424,6 +449,13 @@
tileentity1.ab_(); tileentity1.an_();
} }
+ // CraftBukkit start + // CraftBukkit start
@ -83,7 +101,7 @@
} }
} }
@@ -472,6 +504,50 @@ @@ -473,6 +505,50 @@
} }
@ -134,7 +152,7 @@
public void markDirty() { public void markDirty() {
this.s = true; this.s = true;
} }
@@ -525,7 +601,7 @@ @@ -526,7 +602,7 @@
Iterator iterator = this.entitySlices[k].a(Entity.class).iterator(); Iterator iterator = this.entitySlices[k].a(Entity.class).iterator();
while (iterator.hasNext()) { while (iterator.hasNext()) {
@ -143,7 +161,7 @@
if ((entitytypes == null || entity.getEntityType() == entitytypes) && entity.getBoundingBox().c(axisalignedbb) && predicate.test(entity)) { if ((entitytypes == null || entity.getEntityType() == entitytypes) && entity.getBoundingBox().c(axisalignedbb) && predicate.test(entity)) {
list.add(entity); list.add(entity);
@@ -546,7 +622,7 @@ @@ -547,7 +623,7 @@
Iterator iterator = this.entitySlices[k].a(oclass).iterator(); Iterator iterator = this.entitySlices[k].a(oclass).iterator();
while (iterator.hasNext()) { while (iterator.hasNext()) {
@ -152,7 +170,7 @@
if (t0.getBoundingBox().c(axisalignedbb) && (predicate == null || predicate.test(t0))) { if (t0.getBoundingBox().c(axisalignedbb) && (predicate == null || predicate.test(t0))) {
list.add(t0); list.add(t0);
@@ -620,7 +696,7 @@ @@ -621,7 +697,7 @@
@Override @Override
public boolean isNeedsSaving() { public boolean isNeedsSaving() {
@ -161,7 +179,7 @@
} }
public void d(boolean flag) { public void d(boolean flag) {
@@ -761,7 +837,7 @@ @@ -763,7 +839,7 @@
public void B() { public void B() {
if (this.o instanceof ProtoChunkTickList) { if (this.o instanceof ProtoChunkTickList) {
@ -170,7 +188,7 @@
return this.getType(blockposition).getBlock(); return this.getType(blockposition).getBlock();
}); });
this.o = TickListEmpty.b(); this.o = TickListEmpty.b();
@@ -771,7 +847,7 @@ @@ -773,7 +849,7 @@
} }
if (this.p instanceof ProtoChunkTickList) { if (this.p instanceof ProtoChunkTickList) {
@ -179,18 +197,18 @@
return this.getFluid(blockposition).getType(); return this.getFluid(blockposition).getType();
}); });
this.p = TickListEmpty.b(); this.p = TickListEmpty.b();
@@ -783,12 +859,12 @@ @@ -785,12 +861,12 @@
} }
public void a(WorldServer worldserver) { public void a(WorldServer worldserver) {
- if (this.o == TickListEmpty.b()) { - if (this.o == TickListEmpty.b()) {
+ if (this.o == TickListEmpty.<Block>b()) { // CraftBukkit - decompile error + if (this.o == TickListEmpty.<Block>b()) { // CraftBukkit - decompile error
this.o = new TickListChunk<>(IRegistry.BLOCK::getKey, worldserver.getBlockTickList().a(this.loc, true, false)); this.o = new TickListChunk<>(IRegistry.BLOCK::getKey, worldserver.getBlockTickList().a(this.loc, true, false), worldserver.getTime());
this.setNeedsSaving(true); this.setNeedsSaving(true);
} }
- if (this.p == TickListEmpty.b()) { - if (this.p == TickListEmpty.b()) {
+ if (this.p == TickListEmpty.<FluidType>b()) { // CraftBukkit - decompile error + if (this.p == TickListEmpty.<FluidType>b()) { // CraftBukkit - decompile error
this.p = new TickListChunk<>(IRegistry.FLUID::getKey, worldserver.getFluidTickList().a(this.loc, true, false)); this.p = new TickListChunk<>(IRegistry.FLUID::getKey, worldserver.getFluidTickList().a(this.loc, true, false), worldserver.getTime());
this.setNeedsSaving(true); this.setNeedsSaving(true);
} }

Datei anzeigen

@ -1,21 +1,31 @@
--- a/net/minecraft/server/ChunkGenerator.java --- a/net/minecraft/server/ChunkGenerator.java
+++ b/net/minecraft/server/ChunkGenerator.java +++ b/net/minecraft/server/ChunkGenerator.java
@@ -147,6 +147,18 @@ @@ -214,6 +214,13 @@
StructureStart structurestart1 = StructureStart.a; while (iterator.hasNext()) {
BiomeBase biomebase = biomemanager.a(new BlockPosition(chunkcoordintpair.d() + 9, 0, chunkcoordintpair.e() + 9)); StructureFeature<?, ?> structurefeature = (StructureFeature) iterator.next();
+ // CraftBukkit start + // CraftBukkit start
+ if (structuregenerator == WorldGenerator.STRONGHOLD) { + if (structurefeature.b == StructureGenerator.STRONGHOLD) {
+ synchronized (structuregenerator) { + synchronized (structurefeature) {
+ if (structuregenerator.a(biomemanager, chunkgenerator, seededrandom, chunkcoordintpair.x, chunkcoordintpair.z, biomebase)) { + this.a(structurefeature, structuremanager, ichunkaccess, definedstructuremanager, i, chunkcoordintpair, biomebase);
+ StructureStart structurestart2 = structuregenerator.a().create(structuregenerator, chunkcoordintpair.x, chunkcoordintpair.z, StructureBoundingBox.a(), i, chunkgenerator.getSeed()); + }
+ + } else
+ structurestart2.a(this, definedstructuremanager, chunkcoordintpair.x, chunkcoordintpair.z, biomebase); + // CraftBukkit end
+ structurestart1 = structurestart2.e() ? structurestart2 : StructureStart.a; this.a(structurefeature, structuremanager, ichunkaccess, definedstructuremanager, i, chunkcoordintpair, biomebase);
+ } }
+ }
+ } else
+ // CraftBukkit end
if (structuregenerator.a(biomemanager, chunkgenerator, seededrandom, chunkcoordintpair.x, chunkcoordintpair.z, biomebase)) {
StructureStart structurestart2 = structuregenerator.a().create(structuregenerator, chunkcoordintpair.x, chunkcoordintpair.z, StructureBoundingBox.a(), i, chunkgenerator.getSeed());
@@ -293,9 +300,11 @@
}
static {
- IRegistry.a(IRegistry.CHUNK_GENERATOR, "noise", (Object) ChunkGeneratorAbstract.d);
- IRegistry.a(IRegistry.CHUNK_GENERATOR, "flat", (Object) ChunkProviderFlat.d);
- IRegistry.a(IRegistry.CHUNK_GENERATOR, "debug", (Object) ChunkProviderDebug.e);
+ // CraftBukkit start - decompile errors
+ IRegistry.a(IRegistry.CHUNK_GENERATOR, "noise", ChunkGeneratorAbstract.d);
+ IRegistry.a(IRegistry.CHUNK_GENERATOR, "flat", ChunkProviderFlat.d);
+ IRegistry.a(IRegistry.CHUNK_GENERATOR, "debug", ChunkProviderDebug.e);
+ // CraftBukkit end
a = IRegistry.CHUNK_GENERATOR.dispatchStable(ChunkGenerator::a, Function.identity());
}
}

Datei anzeigen

@ -0,0 +1,32 @@
--- a/net/minecraft/server/ChunkGeneratorAbstract.java
+++ b/net/minecraft/server/ChunkGeneratorAbstract.java
@@ -23,7 +23,7 @@
return chunkgeneratorabstract.h;
})).apply(instance, instance.stable(ChunkGeneratorAbstract::new));
});
- private static final float[] i = (float[]) SystemUtils.a((Object) (new float[13824]), (afloat) -> {
+ private static final float[] i = (float[]) SystemUtils.a((new float[13824]), (afloat) -> { // CraftBukkit - decompile error
for (int i = 0; i < 24; ++i) {
for (int j = 0; j < 24; ++j) {
for (int k = 0; k < 24; ++k) {
@@ -33,7 +33,7 @@
}
});
- private static final float[] j = (float[]) SystemUtils.a((Object) (new float[25]), (afloat) -> {
+ private static final float[] j = (float[]) SystemUtils.a((new float[25]), (afloat) -> { // CraftBukkit - decompile error
for (int i = -2; i <= 2; ++i) {
for (int j = -2; j <= 2; ++j) {
float f = 10.0F / MathHelper.c((float) (i * i + j * j) + 0.2F);
@@ -190,6 +190,11 @@
f6 = f4;
f7 = f5;
}
+ // CraftBukkit start - fix MC-54738
+ if (f6 < -1.8F) {
+ f6 = -1.8F;
+ }
+ // CraftBukkit end
float f8 = f4 > f3 ? 0.5F : 1.0F;
float f9 = f8 * ChunkGeneratorAbstract.j[l + 2 + (i1 + 2) * 5] / (f6 + 2.0F);

Datei anzeigen

@ -8,7 +8,7 @@
+ if ((entry.getValue()).removeIf((ticket) -> { // CraftBukkit - decompile error + if ((entry.getValue()).removeIf((ticket) -> { // CraftBukkit - decompile error
return ticket.b(this.currentTick); return ticket.b(this.currentTick);
})) { })) {
this.e.b(entry.getLongKey(), a((ArraySetSorted) entry.getValue()), false); this.ticketLevelTracker.update(entry.getLongKey(), getLowestTicketLevel((ArraySetSorted) entry.getValue()), false);
@@ -95,10 +95,25 @@ @@ -95,10 +95,25 @@
} }
@ -38,15 +38,6 @@
return true; return true;
} else { } else {
if (!this.l.isEmpty()) { if (!this.l.isEmpty()) {
@@ -120,7 +135,7 @@
completablefuture.thenAccept((either) -> {
this.m.execute(() -> {
- this.k.a((Object) ChunkTaskQueueSorter.a(() -> {
+ this.k.a(ChunkTaskQueueSorter.a(() -> { // CraftBukkit - decompile error
}, j, false));
});
});
@@ -134,23 +149,25 @@ @@ -134,23 +149,25 @@
} }
} }
@ -54,13 +45,13 @@
- private void addTicket(long i, Ticket<?> ticket) { - private void addTicket(long i, Ticket<?> ticket) {
+ private boolean addTicket(long i, Ticket<?> ticket) { // CraftBukkit - void -> boolean + private boolean addTicket(long i, Ticket<?> ticket) { // CraftBukkit - void -> boolean
ArraySetSorted<Ticket<?>> arraysetsorted = this.e(i); ArraySetSorted<Ticket<?>> arraysetsorted = this.e(i);
int j = a(arraysetsorted); int j = getLowestTicketLevel(arraysetsorted);
- Ticket<?> ticket1 = (Ticket) arraysetsorted.a((Object) ticket); - Ticket<?> ticket1 = (Ticket) arraysetsorted.a((Object) ticket);
+ Ticket<?> ticket1 = (Ticket) arraysetsorted.a(ticket); // CraftBukkit - decompile error + Ticket<?> ticket1 = (Ticket) arraysetsorted.a(ticket); // CraftBukkit - decompile error
ticket1.a(this.currentTick); ticket1.a(this.currentTick);
if (ticket.b() < j) { if (ticket.b() < j) {
this.e.b(i, ticket.b(), true); this.ticketLevelTracker.update(i, ticket.b(), true);
} }
+ return ticket == ticket1; // CraftBukkit + return ticket == ticket1; // CraftBukkit
@ -80,7 +71,7 @@
@@ -158,16 +175,29 @@ @@ -158,16 +175,29 @@
} }
this.e.b(i, a(arraysetsorted), false); this.ticketLevelTracker.update(i, getLowestTicketLevel(arraysetsorted), false);
+ return removed; // CraftBukkit + return removed; // CraftBukkit
} }
@ -123,7 +114,7 @@
+ ArraySetSorted<Ticket<?>> tickets = entry.getValue(); + ArraySetSorted<Ticket<?>> tickets = entry.getValue();
+ if (tickets.remove(target)) { + if (tickets.remove(target)) {
+ // copied from removeTicket + // copied from removeTicket
+ this.e.b(entry.getLongKey(), a(tickets), false); // PAIL ticketLevelTracker // PAIL update // PAIL getLowestTicketLevel + this.ticketLevelTracker.update(entry.getLongKey(), getLowestTicketLevel(tickets), false);
+ +
+ // can't use entry after it's removed + // can't use entry after it's removed
+ if (tickets.isEmpty()) { + if (tickets.isEmpty()) {
@ -137,28 +128,3 @@
class a extends ChunkMap { class a extends ChunkMap {
public a() { public a() {
@@ -331,13 +381,13 @@
Ticket<?> ticket = new Ticket<>(TicketType.PLAYER, ChunkMapDistance.b, new ChunkCoordIntPair(i));
if (flag1) {
- ChunkMapDistance.this.j.a((Object) ChunkTaskQueueSorter.a(() -> {
+ ChunkMapDistance.this.j.a(ChunkTaskQueueSorter.a(() -> { // CraftBukkit - decompile error
ChunkMapDistance.this.m.execute(() -> {
if (this.c(this.c(i))) {
ChunkMapDistance.this.addTicket(i, ticket);
ChunkMapDistance.this.l.add(i);
} else {
- ChunkMapDistance.this.k.a((Object) ChunkTaskQueueSorter.a(() -> {
+ ChunkMapDistance.this.k.a(ChunkTaskQueueSorter.a(() -> { // CraftBukkit - decompile error
}, i, false));
}
@@ -346,7 +396,7 @@
return j;
}));
} else {
- ChunkMapDistance.this.k.a((Object) ChunkTaskQueueSorter.a(() -> {
+ ChunkMapDistance.this.k.a(ChunkTaskQueueSorter.a(() -> { // CraftBukkit - decompile error
ChunkMapDistance.this.m.execute(() -> {
ChunkMapDistance.this.removeTicket(i, ticket);
});

Datei anzeigen

@ -1,23 +0,0 @@
--- a/net/minecraft/server/ChunkProviderGenerate.java
+++ b/net/minecraft/server/ChunkProviderGenerate.java
@@ -4,7 +4,7 @@
public class ChunkProviderGenerate extends ChunkGeneratorAbstract<GeneratorSettingsOverworld> {
- private static final float[] h = (float[]) SystemUtils.a((Object) (new float[25]), (afloat) -> {
+ private static final float[] h = (float[]) SystemUtils.a((new float[25]), (afloat) -> { // CraftBukkit - decompile error
for (int i = -2; i <= 2; ++i) {
for (int j = -2; j <= 2; ++j) {
float f = 10.0F / MathHelper.c((float) (i * i + j * j) + 0.2F);
@@ -83,6 +83,11 @@
f4 = 1.0F + f4 * 2.0F;
f5 = 1.0F + f5 * 4.0F;
}
+ // CraftBukkit start - fix MC-54738
+ if (f4 < -1.8F) {
+ f4 = -1.8F;
+ }
+ // CraftBukkit end
float f6 = ChunkProviderGenerate.h[l + 2 + (i1 + 2) * 5] / (f4 + 2.0F);

Datei anzeigen

@ -1,6 +1,6 @@
--- a/net/minecraft/server/ChunkProviderServer.java --- a/net/minecraft/server/ChunkProviderServer.java
+++ b/net/minecraft/server/ChunkProviderServer.java +++ b/net/minecraft/server/ChunkProviderServer.java
@@ -51,6 +51,16 @@ @@ -54,6 +54,16 @@
this.clearCache(); this.clearCache();
} }
@ -17,7 +17,7 @@
@Override @Override
public LightEngineThreaded getLightEngine() { public LightEngineThreaded getLightEngine() {
return this.lightEngine; return this.lightEngine;
@@ -95,7 +105,7 @@ @@ -98,7 +108,7 @@
for (int l = 0; l < 4; ++l) { for (int l = 0; l < 4; ++l) {
if (k == this.cachePos[l] && chunkstatus == this.cacheStatus[l]) { if (k == this.cachePos[l] && chunkstatus == this.cacheStatus[l]) {
ichunkaccess = this.cacheChunk[l]; ichunkaccess = this.cacheChunk[l];
@ -26,7 +26,7 @@
return ichunkaccess; return ichunkaccess;
} }
} }
@@ -141,12 +151,12 @@ @@ -144,12 +154,12 @@
if (playerchunk == null) { if (playerchunk == null) {
return null; return null;
} else { } else {
@ -41,7 +41,7 @@
if (ichunkaccess1 != null) { if (ichunkaccess1 != null) {
this.a(k, ichunkaccess1, ChunkStatus.FULL); this.a(k, ichunkaccess1, ChunkStatus.FULL);
@@ -173,7 +183,15 @@ @@ -176,7 +186,15 @@
int l = 33 + ChunkStatus.a(chunkstatus); int l = 33 + ChunkStatus.a(chunkstatus);
PlayerChunk playerchunk = this.getChunk(k); PlayerChunk playerchunk = this.getChunk(k);
@ -58,7 +58,7 @@
this.chunkMapDistance.a(TicketType.UNKNOWN, chunkcoordintpair, l, chunkcoordintpair); this.chunkMapDistance.a(TicketType.UNKNOWN, chunkcoordintpair, l, chunkcoordintpair);
if (this.a(playerchunk, l)) { if (this.a(playerchunk, l)) {
GameProfilerFiller gameprofilerfiller = this.world.getMethodProfiler(); GameProfilerFiller gameprofilerfiller = this.world.getMethodProfiler();
@@ -192,7 +210,7 @@ @@ -195,7 +213,7 @@
} }
private boolean a(@Nullable PlayerChunk playerchunk, int i) { private boolean a(@Nullable PlayerChunk playerchunk, int i) {
@ -67,7 +67,30 @@
} }
public boolean isLoaded(int i, int j) { public boolean isLoaded(int i, int j) {
@@ -294,11 +312,31 @@ @@ -257,19 +275,19 @@
public boolean a(Entity entity) {
long i = ChunkCoordIntPair.pair(MathHelper.floor(entity.locX()) >> 4, MathHelper.floor(entity.locZ()) >> 4);
- return this.a(i, PlayerChunk::b);
+ return this.a(i, (Function<PlayerChunk, CompletableFuture<Either<Chunk, PlayerChunk.Failure>>>) PlayerChunk::b); // CraftBukkit - decompile error
}
@Override
public boolean a(ChunkCoordIntPair chunkcoordintpair) {
- return this.a(chunkcoordintpair.pair(), PlayerChunk::b);
+ return this.a(chunkcoordintpair.pair(), (Function<PlayerChunk, CompletableFuture<Either<Chunk, PlayerChunk.Failure>>>) PlayerChunk::b); // CraftBukkit - decompile error
}
@Override
public boolean a(BlockPosition blockposition) {
long i = ChunkCoordIntPair.pair(blockposition.getX() >> 4, blockposition.getZ() >> 4);
- return this.a(i, PlayerChunk::a);
+ return this.a(i, (Function<PlayerChunk, CompletableFuture<Either<Chunk, PlayerChunk.Failure>>>) PlayerChunk::a); // CraftBukkit - decompile error
}
private boolean a(long i, Function<PlayerChunk, CompletableFuture<Either<Chunk, PlayerChunk.Failure>>> function) {
@@ -291,11 +309,31 @@
@Override @Override
public void close() throws IOException { public void close() throws IOException {
@ -100,66 +123,22 @@
public void tick(BooleanSupplier booleansupplier) { public void tick(BooleanSupplier booleansupplier) {
this.world.getMethodProfiler().enter("purge"); this.world.getMethodProfiler().enter("purge");
this.chunkMapDistance.purgeTickets(); this.chunkMapDistance.purgeTickets();
@@ -318,13 +356,19 @@ @@ -315,12 +353,12 @@
this.lastTickTime = i; this.lastTickTime = i;
WorldData worlddata = this.world.getWorldData(); WorldData worlddata = this.world.getWorldData();
boolean flag = worlddata.getType() == WorldType.DEBUG_ALL_BLOCK_STATES; boolean flag = this.world.isDebugWorld();
- boolean flag1 = this.world.getGameRules().getBoolean(GameRules.DO_MOB_SPAWNING); - boolean flag1 = this.world.getGameRules().getBoolean(GameRules.DO_MOB_SPAWNING);
+ boolean flag1 = this.world.getGameRules().getBoolean(GameRules.DO_MOB_SPAWNING) && !world.getPlayers().isEmpty(); // CraftBukkit + boolean flag1 = this.world.getGameRules().getBoolean(GameRules.DO_MOB_SPAWNING) && !world.getPlayers().isEmpty(); // CraftBukkit
if (!flag) { if (!flag) {
this.world.getMethodProfiler().enter("pollingChunks"); this.world.getMethodProfiler().enter("pollingChunks");
int k = this.world.getGameRules().getInt(GameRules.RANDOM_TICK_SPEED); int k = this.world.getGameRules().getInt(GameRules.RANDOM_TICK_SPEED);
BlockPosition blockposition = this.world.getSpawn();
- boolean flag2 = worlddata.getTime() % 400L == 0L; - boolean flag2 = worlddata.getTime() % 400L == 0L;
+ // CraftBukkit start - Other mob type spawn tick rate + boolean flag2 = world.ticksPerAnimalSpawns != 0L && worlddata.getTime() % world.ticksPerAnimalSpawns == 0L; // CraftBukkit
+ boolean spawnAnimalThisTick = world.ticksPerAnimalSpawns != 0L && worlddata.getTime() % world.ticksPerAnimalSpawns == 0L;
+ boolean spawnMonsterThisTick = world.ticksPerMonsterSpawns != 0L && worlddata.getTime() % world.ticksPerMonsterSpawns == 0L;
+ boolean spawnWaterThisTick = world.ticksPerWaterSpawns != 0L && worlddata.getTime() % world.ticksPerWaterSpawns == 0L;
+ boolean spawnAmbientThisTick = world.ticksPerAmbientSpawns != 0L && worlddata.getTime() % world.ticksPerAmbientSpawns == 0L;
+ boolean flag2 = spawnAnimalThisTick;
+ // CraftBukkit end
this.world.getMethodProfiler().enter("naturalSpawnCount"); this.world.getMethodProfiler().enter("naturalSpawnCount");
int l = this.chunkMapDistance.b(); int l = this.chunkMapDistance.b();
@@ -353,8 +397,35 @@ @@ -507,12 +545,18 @@
for (int j1 = 0; j1 < i1; ++j1) {
EnumCreatureType enumcreaturetype = aenumcreaturetype1[j1];
+ // CraftBukkit start - Use per-world spawn limits
+ boolean spawnThisTick = true;
+ int limit = enumcreaturetype.b();
+ switch (enumcreaturetype) {
+ case MONSTER:
+ spawnThisTick = spawnMonsterThisTick;
+ limit = world.getWorld().getMonsterSpawnLimit();
+ break;
+ case CREATURE:
+ spawnThisTick = spawnAnimalThisTick;
+ limit = world.getWorld().getAnimalSpawnLimit();
+ break;
+ case WATER_CREATURE:
+ spawnThisTick = spawnWaterThisTick;
+ limit = world.getWorld().getWaterAnimalSpawnLimit();
+ break;
+ case AMBIENT:
+ spawnThisTick = spawnAmbientThisTick;
+ limit = world.getWorld().getAmbientSpawnLimit();
+ break;
+ }
+
+ if (!spawnThisTick || limit == 0) {
+ continue;
+ }
+ // CraftBukkit end
+
if (enumcreaturetype != EnumCreatureType.MISC && (!enumcreaturetype.c() || this.allowAnimals) && (enumcreaturetype.c() || this.allowMonsters) && (!enumcreaturetype.d() || flag2)) {
- int k1 = enumcreaturetype.b() * l / ChunkProviderServer.b;
+ int k1 = limit * l / ChunkProviderServer.b; // CraftBukkit - use per-world limits
if (object2intmap.getInt(enumcreaturetype) <= k1) {
SpawnerCreature.a(enumcreaturetype, this.world, chunk, blockposition);
@@ -507,12 +578,18 @@
@Override @Override
protected boolean executeNext() { protected boolean executeNext() {

Datei anzeigen

@ -1,14 +1,14 @@
--- a/net/minecraft/server/CommandBlockListenerAbstract.java --- a/net/minecraft/server/CommandBlockListenerAbstract.java
+++ b/net/minecraft/server/CommandBlockListenerAbstract.java +++ b/net/minecraft/server/CommandBlockListenerAbstract.java
@@ -4,6 +4,7 @@ @@ -4,6 +4,7 @@
import java.text.SimpleDateFormat;
import java.util.Date; import java.util.Date;
import java.util.UUID;
import javax.annotation.Nullable; import javax.annotation.Nullable;
+import org.bukkit.command.CommandSender; +import org.bukkit.command.CommandSender;
public abstract class CommandBlockListenerAbstract implements ICommandListener { public abstract class CommandBlockListenerAbstract implements ICommandListener {
@@ -16,6 +17,10 @@ @@ -17,6 +18,10 @@
private IChatBaseComponent lastOutput; private IChatBaseComponent lastOutput;
private String command = ""; private String command = "";
private IChatBaseComponent customName; private IChatBaseComponent customName;
@ -19,7 +19,7 @@
public CommandBlockListenerAbstract() { public CommandBlockListenerAbstract() {
this.customName = CommandBlockListenerAbstract.c; this.customName = CommandBlockListenerAbstract.c;
@@ -112,7 +117,7 @@ @@ -113,7 +118,7 @@
}); });

Datei anzeigen

@ -1,13 +1,13 @@
--- a/net/minecraft/server/CommandDispatcher.java --- a/net/minecraft/server/CommandDispatcher.java
+++ b/net/minecraft/server/CommandDispatcher.java +++ b/net/minecraft/server/CommandDispatcher.java
@@ -19,12 +19,21 @@ @@ -17,12 +17,21 @@
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
+// CraftBukkit start +// CraftBukkit start
+import com.google.common.base.Joiner; +import com.google.common.base.Joiner;
+import java.util.Collection;
+import java.util.LinkedHashSet; +import java.util.LinkedHashSet;
+import org.bukkit.craftbukkit.command.VanillaCommandWrapper;
+import org.bukkit.event.player.PlayerCommandSendEvent; +import org.bukkit.event.player.PlayerCommandSendEvent;
+import org.bukkit.event.server.ServerCommandEvent; +import org.bukkit.event.server.ServerCommandEvent;
+// CraftBukkit end +// CraftBukkit end
@ -17,30 +17,29 @@
private static final Logger LOGGER = LogManager.getLogger(); private static final Logger LOGGER = LogManager.getLogger();
private final com.mojang.brigadier.CommandDispatcher<CommandListenerWrapper> b = new com.mojang.brigadier.CommandDispatcher(); private final com.mojang.brigadier.CommandDispatcher<CommandListenerWrapper> b = new com.mojang.brigadier.CommandDispatcher();
- public CommandDispatcher(boolean flag) { public CommandDispatcher(CommandDispatcher.ServerType commanddispatcher_servertype) {
+ // CraftBukkit start + this(); // CraftBukkit
+ public final CommandDispatcher init(boolean flag) {
CommandAdvancement.a(this.b); CommandAdvancement.a(this.b);
CommandAttribute.a(this.b);
CommandExecute.a(this.b); CommandExecute.a(this.b);
CommandBossBar.a(this.b); @@ -103,14 +112,57 @@
@@ -100,14 +109,59 @@
} }
this.b.findAmbiguities((commandnode, commandnode1, commandnode2, collection) -> { this.b.findAmbiguities((commandnode, commandnode1, commandnode2, collection) -> {
- CommandDispatcher.LOGGER.warn("Ambiguity between arguments {} and {} with inputs: {}", this.b.getPath(commandnode1), this.b.getPath(commandnode2), collection); - CommandDispatcher.LOGGER.warn("Ambiguity between arguments {} and {} with inputs: {}", this.b.getPath(commandnode1), this.b.getPath(commandnode2), collection);
+ // CommandDispatcher.LOGGER.warn("Ambiguity between arguments {} and {} with inputs: {}", this.b.getPath(commandnode1), this.b.getPath(commandnode2), collection); // CraftBukkit + // CommandDispatcher.LOGGER.warn("Ambiguity between arguments {} and {} with inputs: {}", this.b.getPath(commandnode1), this.b.getPath(commandnode2), collection); // CraftBukkit
}); });
+ return this; - this.b.setConsumer((commandcontext, flag, i) -> {
- ((CommandListenerWrapper) commandcontext.getSource()).a(commandcontext, flag, i);
+ } + }
+ +
+ // CraftBukkit start
+ public CommandDispatcher() { + public CommandDispatcher() {
+ // CraftBukkit end + this.b.setConsumer((commandcontext, flag1, i) -> {
this.b.setConsumer((commandcontext, flag1, i) -> { + ((CommandListenerWrapper) commandcontext.getSource()).a(commandcontext, flag1, i);
((CommandListenerWrapper) commandcontext.getSource()).a(commandcontext, flag1, i);
}); });
} }
+ // CraftBukkit start
+ public int dispatchServerCommand(CommandListenerWrapper sender, String command) { + public int dispatchServerCommand(CommandListenerWrapper sender, String command) {
+ Joiner joiner = Joiner.on(" "); + Joiner joiner = Joiner.on(" ");
+ if (command.startsWith("/")) { + if (command.startsWith("/")) {
@ -84,16 +83,16 @@
StringReader stringreader = new StringReader(s); StringReader stringreader = new StringReader(s);
if (stringreader.canRead() && stringreader.peek() == '/') { if (stringreader.canRead() && stringreader.peek() == '/') {
@@ -134,7 +188,7 @@ @@ -137,7 +189,7 @@
if (commandsyntaxexception.getInput() != null && commandsyntaxexception.getCursor() >= 0) { if (commandsyntaxexception.getInput() != null && commandsyntaxexception.getCursor() >= 0) {
int j = Math.min(commandsyntaxexception.getInput().length(), commandsyntaxexception.getCursor()); int j = Math.min(commandsyntaxexception.getInput().length(), commandsyntaxexception.getCursor());
IChatBaseComponent ichatbasecomponent = (new ChatComponentText("")).a(EnumChatFormat.GRAY).a((chatmodifier) -> { IChatMutableComponent ichatmutablecomponent = (new ChatComponentText("")).a(EnumChatFormat.GRAY).format((chatmodifier) -> {
- chatmodifier.setChatClickable(new ChatClickable(ChatClickable.EnumClickAction.SUGGEST_COMMAND, s)); - return chatmodifier.setChatClickable(new ChatClickable(ChatClickable.EnumClickAction.SUGGEST_COMMAND, s));
+ chatmodifier.setChatClickable(new ChatClickable(ChatClickable.EnumClickAction.SUGGEST_COMMAND, label)); // CraftBukkit + return chatmodifier.setChatClickable(new ChatClickable(ChatClickable.EnumClickAction.SUGGEST_COMMAND, label)); // CraftBukkit
}); });
if (j > 10) { if (j > 10) {
@@ -184,11 +238,36 @@ @@ -187,11 +239,36 @@
} }
public void a(EntityPlayer entityplayer) { public void a(EntityPlayer entityplayer) {
@ -131,7 +130,7 @@
entityplayer.playerConnection.sendPacket(new PacketPlayOutCommands(rootcommandnode)); entityplayer.playerConnection.sendPacket(new PacketPlayOutCommands(rootcommandnode));
} }
@@ -199,7 +278,7 @@ @@ -202,7 +279,7 @@
CommandNode<CommandListenerWrapper> commandnode2 = (CommandNode) iterator.next(); CommandNode<CommandListenerWrapper> commandnode2 = (CommandNode) iterator.next();
if (commandnode2.canUse(commandlistenerwrapper)) { if (commandnode2.canUse(commandlistenerwrapper)) {
@ -140,7 +139,7 @@
argumentbuilder.requires((icompletionprovider) -> { argumentbuilder.requires((icompletionprovider) -> {
return true; return true;
@@ -222,7 +301,7 @@ @@ -225,7 +302,7 @@
argumentbuilder.redirect((CommandNode) map.get(argumentbuilder.getRedirect())); argumentbuilder.redirect((CommandNode) map.get(argumentbuilder.getRedirect()));
} }

Datei anzeigen

@ -1,6 +1,6 @@
--- a/net/minecraft/server/CommandEffect.java --- a/net/minecraft/server/CommandEffect.java
+++ b/net/minecraft/server/CommandEffect.java +++ b/net/minecraft/server/CommandEffect.java
@@ -63,7 +63,7 @@ @@ -62,7 +62,7 @@
if (entity instanceof EntityLiving) { if (entity instanceof EntityLiving) {
MobEffect mobeffect = new MobEffect(mobeffectlist, k, i, false, flag); MobEffect mobeffect = new MobEffect(mobeffectlist, k, i, false, flag);
@ -9,7 +9,7 @@
++j; ++j;
} }
} }
@@ -89,7 +89,7 @@ @@ -88,7 +88,7 @@
while (iterator.hasNext()) { while (iterator.hasNext()) {
Entity entity = (Entity) iterator.next(); Entity entity = (Entity) iterator.next();
@ -18,7 +18,7 @@
++i; ++i;
} }
} }
@@ -114,7 +114,7 @@ @@ -113,7 +113,7 @@
while (iterator.hasNext()) { while (iterator.hasNext()) {
Entity entity = (Entity) iterator.next(); Entity entity = (Entity) iterator.next();

Datei anzeigen

@ -7,8 +7,8 @@
+import com.mojang.brigadier.tree.CommandNode; +import com.mojang.brigadier.tree.CommandNode;
import java.util.Collection; import java.util.Collection;
import java.util.Iterator; import java.util.Iterator;
import java.util.concurrent.CompletableFuture; import java.util.Set;
@@ -31,6 +32,7 @@ @@ -32,6 +33,7 @@
private final ResultConsumer<CommandListenerWrapper> l; private final ResultConsumer<CommandListenerWrapper> l;
private final ArgumentAnchor.Anchor m; private final ArgumentAnchor.Anchor m;
private final Vec2F n; private final Vec2F n;
@ -16,7 +16,7 @@
public CommandListenerWrapper(ICommandListener icommandlistener, Vec3D vec3d, Vec2F vec2f, WorldServer worldserver, int i, String s, IChatBaseComponent ichatbasecomponent, MinecraftServer minecraftserver, @Nullable Entity entity) { public CommandListenerWrapper(ICommandListener icommandlistener, Vec3D vec3d, Vec2F vec2f, WorldServer worldserver, int i, String s, IChatBaseComponent ichatbasecomponent, MinecraftServer minecraftserver, @Nullable Entity entity) {
this(icommandlistener, vec3d, vec2f, worldserver, i, s, ichatbasecomponent, minecraftserver, entity, false, (commandcontext, flag, j) -> { this(icommandlistener, vec3d, vec2f, worldserver, i, s, ichatbasecomponent, minecraftserver, entity, false, (commandcontext, flag, j) -> {
@@ -120,9 +122,22 @@ @@ -121,9 +123,22 @@
@Override @Override
public boolean hasPermission(int i) { public boolean hasPermission(int i) {
@ -39,18 +39,18 @@
public Vec3D getPosition() { public Vec3D getPosition() {
return this.d; return this.d;
} }
@@ -184,7 +199,7 @@ @@ -185,7 +200,7 @@
while (iterator.hasNext()) { while (iterator.hasNext()) {
EntityPlayer entityplayer = (EntityPlayer) iterator.next(); EntityPlayer entityplayer = (EntityPlayer) iterator.next();
- if (entityplayer != this.base && this.i.getPlayerList().isOp(entityplayer.getProfile())) { - if (entityplayer != this.base && this.i.getPlayerList().isOp(entityplayer.getProfile())) {
+ if (entityplayer != this.base && entityplayer.getBukkitEntity().hasPermission("minecraft.admin.command_feedback")) { // CraftBukkit + if (entityplayer != this.base && entityplayer.getBukkitEntity().hasPermission("minecraft.admin.command_feedback")) { // CraftBukkit
entityplayer.sendMessage(ichatbasecomponent1); entityplayer.sendMessage(ichatmutablecomponent, SystemUtils.b);
} }
} }
@@ -234,4 +249,10 @@ @@ -240,4 +255,10 @@
public CompletableFuture<Suggestions> a(CommandContext<ICompletionProvider> commandcontext, SuggestionsBuilder suggestionsbuilder) { public Set<ResourceKey<World>> p() {
return null; return this.i.E();
} }
+ +
+ // CraftBukkit start + // CraftBukkit start

Datei anzeigen

@ -0,0 +1,19 @@
--- a/net/minecraft/server/CommandReload.java
+++ b/net/minecraft/server/CommandReload.java
@@ -36,6 +36,16 @@
return collection1;
}
+ // CraftBukkit start
+ public static void reload(MinecraftServer minecraftserver) {
+ ResourcePackRepository<?> resourcepackrepository = minecraftserver.getResourcePackRepository();
+ SaveData savedata = minecraftserver.getSaveData();
+ Collection<String> collection = resourcepackrepository.d();
+ Collection<String> collection1 = a(resourcepackrepository, savedata, collection);
+ minecraftserver.a(collection1);
+ }
+ // CraftBukkit end
+
public static void a(com.mojang.brigadier.CommandDispatcher<CommandListenerWrapper> com_mojang_brigadier_commanddispatcher) {
com_mojang_brigadier_commanddispatcher.register((LiteralArgumentBuilder) ((LiteralArgumentBuilder) CommandDispatcher.a("reload").requires((commandlistenerwrapper) -> {
return commandlistenerwrapper.hasPermission(2);

Datei anzeigen

@ -1,6 +1,6 @@
--- a/net/minecraft/server/CommandSpreadPlayers.java --- a/net/minecraft/server/CommandSpreadPlayers.java
+++ b/net/minecraft/server/CommandSpreadPlayers.java +++ b/net/minecraft/server/CommandSpreadPlayers.java
@@ -58,7 +58,7 @@ @@ -61,7 +61,7 @@
if (entity instanceof EntityHuman) { if (entity instanceof EntityHuman) {
set.add(entity.getScoreboardTeam()); set.add(entity.getScoreboardTeam());
} else { } else {
@ -9,32 +9,32 @@
} }
} }
@@ -266,7 +266,7 @@ @@ -270,7 +270,7 @@
for (boolean flag2 = iblockaccess.getType(blockposition_mutableblockposition).isAir(); blockposition_mutableblockposition.getY() > 0; flag2 = flag1) {
blockposition_mutableblockposition.c(EnumDirection.DOWN);
- flag1 = iblockaccess.getType(blockposition_mutableblockposition).isAir();
+ flag1 = getType(iblockaccess, blockposition_mutableblockposition).isAir(); // CraftBukkit
if (!flag1 && flag2 && flag) {
return blockposition_mutableblockposition.getY() + 1;
} }
@@ -283,7 +283,7 @@
blockposition = blockposition.down(); public boolean b(IBlockAccess iblockaccess, int i) {
- } while (iblockaccess.getType(blockposition).isAir()); BlockPosition blockposition = new BlockPosition(this.a, (double) (this.a(iblockaccess, i) - 1), this.b);
+ } while (getType(iblockaccess, blockposition).isAir()); // CraftBukkit - IBlockData iblockdata = iblockaccess.getType(blockposition);
+ IBlockData iblockdata = getType(iblockaccess, blockposition); // CraftBukkit
return blockposition.getY() + 1;
}
@@ -282,7 +282,7 @@
}
blockposition = blockposition.down();
- iblockdata = iblockaccess.getType(blockposition);
+ iblockdata = getType(iblockaccess, blockposition); // CraftBukkit
} while (iblockdata.isAir());
Material material = iblockdata.getMaterial(); Material material = iblockdata.getMaterial();
@@ -294,5 +294,12 @@
return blockposition.getY() < i && !material.isLiquid() && material != Material.FIRE;
@@ -293,5 +293,12 @@
this.a = MathHelper.a(random, d0, d2); this.a = MathHelper.a(random, d0, d2);
this.b = MathHelper.a(random, d1, d3); this.b = MathHelper.a(random, d1, d3);
} }
+ +
+ // CraftBukkit start - add a version of getType which force loads chunks + // CraftBukkit start - add a version of getType which force loads chunks
+ private static IBlockData getType(IBlockAccess iblockaccess, BlockPosition position) { + private static IBlockData getType(IBlockAccess iblockaccess, BlockPosition position) {
+ ((ChunkProviderServer) ((World) iblockaccess).chunkProvider).getChunkAt(position.getX() >> 4, position.getZ() >> 4, true); + ((WorldServer) iblockaccess).getChunkProvider().getChunkAt(position.getX() >> 4, position.getZ() >> 4, true);
+ return iblockaccess.getType(position); + return iblockaccess.getType(position);
+ } + }
+ // CraftBukkit end + // CraftBukkit end

Datei anzeigen

@ -1,11 +0,0 @@
--- a/net/minecraft/server/CommandSummon.java
+++ b/net/minecraft/server/CommandSummon.java
@@ -30,7 +30,7 @@
if (EntityTypes.getName(EntityTypes.LIGHTNING_BOLT).equals(minecraftkey)) {
EntityLightning entitylightning = new EntityLightning(commandlistenerwrapper.getWorld(), vec3d.x, vec3d.y, vec3d.z, false);
- commandlistenerwrapper.getWorld().strikeLightning(entitylightning);
+ commandlistenerwrapper.getWorld().strikeLightning(entitylightning, org.bukkit.event.weather.LightningStrikeEvent.Cause.COMMAND); // CraftBukkit
commandlistenerwrapper.sendMessage(new ChatMessage("commands.summon.success", new Object[]{entitylightning.getScoreboardDisplayName()}), true);
return 1;
} else {

Datei anzeigen

@ -12,37 +12,37 @@
public class CommandTeleport { public class CommandTeleport {
@@ -121,9 +126,9 @@ @@ -128,9 +133,9 @@
} }
if (worldserver == entity.world) { if (worldserver == entity.world) {
- ((EntityPlayer) entity).playerConnection.a(d0, d1, d2, f, f1, set); - ((EntityPlayer) entity).playerConnection.a(d0, d1, d2, f, f1, set);
+ ((EntityPlayer) entity).playerConnection.a(d0, d1, d2, f, f1, set, org.bukkit.event.player.PlayerTeleportEvent.TeleportCause.COMMAND); // CraftBukkit + ((EntityPlayer) entity).playerConnection.a(d0, d1, d2, f, f1, set, org.bukkit.event.player.PlayerTeleportEvent.TeleportCause.COMMAND); // CraftBukkit
} else { } else {
- ((EntityPlayer) entity).a(worldserver, d0, d1, d2, f, f1); - ((EntityPlayer) entity).a(worldserver, d0, d1, d2, f, f1);
+ ((EntityPlayer) entity).a(worldserver, d0, d1, d2, f, f1, org.bukkit.event.player.PlayerTeleportEvent.TeleportCause.COMMAND); // CraftBukkit + ((EntityPlayer) entity).a(worldserver, d0, d1, d2, f, f1, org.bukkit.event.player.PlayerTeleportEvent.TeleportCause.COMMAND); // CraftBukkit
} }
entity.setHeadRotation(f); entity.setHeadRotation(f);
@@ -132,6 +137,21 @@ @@ -139,6 +144,21 @@
float f3 = MathHelper.g(f1); float f3 = MathHelper.g(f1);
f3 = MathHelper.a(f3, -90.0F, 90.0F); f3 = MathHelper.a(f3, -90.0F, 90.0F);
+ // CraftBukkit start - Teleport event + // CraftBukkit start - Teleport event
+ Location to = new Location(worldserver.getWorld(), d0, d1, d2, f2, f3); + Location to = new Location(worldserver.getWorld(), d0, d1, d2, f2, f3);
+ EntityTeleportEvent event = new EntityTeleportEvent(entity.getBukkitEntity(), entity.getBukkitEntity().getLocation(), to); + EntityTeleportEvent event = new EntityTeleportEvent(entity.getBukkitEntity(), entity.getBukkitEntity().getLocation(), to);
+ worldserver.getServer().getPluginManager().callEvent(event); + worldserver.getServer().getPluginManager().callEvent(event);
+ if (event.isCancelled()) { + if (event.isCancelled()) {
+ return; + return;
+ } + }
+ +
+ d0 = to.getX(); + d0 = to.getX();
+ d1 = to.getY(); + d1 = to.getY();
+ d2 = to.getZ(); + d2 = to.getZ();
+ f2 = to.getYaw(); + f2 = to.getYaw();
+ f3 = to.getPitch(); + f3 = to.getPitch();
+ worldserver = ((CraftWorld) to.getWorld()).getHandle(); + worldserver = ((CraftWorld) to.getWorld()).getHandle();
+ // CraftBukkit end + // CraftBukkit end
if (worldserver == entity.world) { if (worldserver == entity.world) {
entity.setPositionRotation(d0, d1, d2, f2, f3); entity.setPositionRotation(d0, d1, d2, f2, f3);
entity.setHeadRotation(f2); entity.setHeadRotation(f2);

Datei anzeigen

@ -1,18 +1,17 @@
--- a/net/minecraft/server/CommandTime.java --- a/net/minecraft/server/CommandTime.java
+++ b/net/minecraft/server/CommandTime.java +++ b/net/minecraft/server/CommandTime.java
@@ -4,6 +4,11 @@ @@ -4,6 +4,10 @@
import com.mojang.brigadier.arguments.IntegerArgumentType; import com.mojang.brigadier.arguments.IntegerArgumentType;
import com.mojang.brigadier.builder.LiteralArgumentBuilder; import com.mojang.brigadier.builder.LiteralArgumentBuilder;
import com.mojang.brigadier.context.CommandContext; import java.util.Iterator;
+// CraftBukkit start +// CraftBukkit start
+import org.bukkit.Bukkit; +import org.bukkit.Bukkit;
+import org.bukkit.event.world.TimeSkipEvent; +import org.bukkit.event.world.TimeSkipEvent;
+// CrafBukkit end +// CrafBukkit end
+
import java.util.Iterator;
public class CommandTime { public class CommandTime {
@@ -47,7 +52,13 @@
@@ -46,7 +50,13 @@
while (iterator.hasNext()) { while (iterator.hasNext()) {
WorldServer worldserver = (WorldServer) iterator.next(); WorldServer worldserver = (WorldServer) iterator.next();
@ -27,7 +26,7 @@
} }
commandlistenerwrapper.sendMessage(new ChatMessage("commands.time.set", new Object[]{i}), true); commandlistenerwrapper.sendMessage(new ChatMessage("commands.time.set", new Object[]{i}), true);
@@ -60,7 +71,13 @@ @@ -59,7 +69,13 @@
while (iterator.hasNext()) { while (iterator.hasNext()) {
WorldServer worldserver = (WorldServer) iterator.next(); WorldServer worldserver = (WorldServer) iterator.next();

Datei anzeigen

@ -47,7 +47,7 @@
protected Container(@Nullable Containers<?> containers, int i) { protected Container(@Nullable Containers<?> containers, int i) {
this.e = containers; this.e = containers;
this.windowId = i; this.windowId = i;
@@ -180,6 +213,7 @@ @@ -202,6 +235,7 @@
k = playerinventory.getCarried().getCount(); k = playerinventory.getCarried().getCount();
Iterator iterator = this.i.iterator(); Iterator iterator = this.i.iterator();
@ -55,7 +55,7 @@
while (iterator.hasNext()) { while (iterator.hasNext()) {
Slot slot1 = (Slot) iterator.next(); Slot slot1 = (Slot) iterator.next();
ItemStack itemstack3 = playerinventory.getCarried(); ItemStack itemstack3 = playerinventory.getCarried();
@@ -195,12 +229,48 @@ @@ -217,12 +251,48 @@
} }
k -= itemstack4.getCount() - j1; k -= itemstack4.getCount() - j1;
@ -107,20 +107,20 @@
} }
this.d(); this.d();
@@ -217,8 +287,11 @@ @@ -239,8 +309,11 @@
if (i == -999) { if (i == -999) {
if (!playerinventory.getCarried().isEmpty()) { if (!playerinventory.getCarried().isEmpty()) {
if (j == 0) { if (j == 0) {
- entityhuman.drop(playerinventory.getCarried(), true); - entityhuman.drop(playerinventory.getCarried(), true);
+ // CraftBukkit start + // CraftBukkit start
+ ItemStack carried = playerinventory.getCarried(); + ItemStack carried = playerinventory.getCarried();
playerinventory.setCarried(ItemStack.a); playerinventory.setCarried(ItemStack.b);
+ entityhuman.drop(carried, true); + entityhuman.drop(carried, true);
+ // CraftBukkit start + // CraftBukkit start
} }
if (j == 1) { if (j == 1) {
@@ -306,6 +379,15 @@ @@ -328,6 +401,15 @@
} }
slot2.d(); slot2.d();
@ -135,15 +135,15 @@
+ // CraftBukkit end + // CraftBukkit end
} }
} }
} else if (inventoryclicktype == InventoryClickType.SWAP && j >= 0 && j < 9) { } else if (inventoryclicktype == InventoryClickType.SWAP) {
@@ -408,8 +490,11 @@ @@ -430,8 +512,11 @@
PlayerInventory playerinventory = entityhuman.inventory; PlayerInventory playerinventory = entityhuman.inventory;
if (!playerinventory.getCarried().isEmpty()) { if (!playerinventory.getCarried().isEmpty()) {
- entityhuman.drop(playerinventory.getCarried(), false); - entityhuman.drop(playerinventory.getCarried(), false);
+ // CraftBukkit start - SPIGOT-4556 + // CraftBukkit start - SPIGOT-4556
+ ItemStack carried = playerinventory.getCarried(); + ItemStack carried = playerinventory.getCarried();
playerinventory.setCarried(ItemStack.a); playerinventory.setCarried(ItemStack.b);
+ entityhuman.drop(carried, false); + entityhuman.drop(carried, false);
+ // CraftBukkit end + // CraftBukkit end
} }

Datei anzeigen

@ -1,6 +1,6 @@
--- a/net/minecraft/server/ContainerAnvil.java --- a/net/minecraft/server/ContainerAnvil.java
+++ b/net/minecraft/server/ContainerAnvil.java +++ b/net/minecraft/server/ContainerAnvil.java
@@ -6,6 +6,10 @@ @@ -6,12 +6,20 @@
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
@ -8,68 +8,57 @@
+import org.bukkit.craftbukkit.inventory.CraftInventoryView; +import org.bukkit.craftbukkit.inventory.CraftInventoryView;
+// CraftBukkit end +// CraftBukkit end
+ +
public class ContainerAnvil extends Container { public class ContainerAnvil extends ContainerAnvilAbstract {
private static final Logger LOGGER = LogManager.getLogger(); private static final Logger LOGGER = LogManager.getLogger();
@@ -16,6 +20,12 @@
private int h; private int h;
public String renameText; public String renameText;
private final EntityHuman player; public final ContainerProperty levelCost;
+ // CraftBukkit start + // CraftBukkit start
+ public int maximumRepairCost = 40; + public int maximumRepairCost = 40;
+ private int lastLevelCost;
+ private CraftInventoryView bukkitEntity; + private CraftInventoryView bukkitEntity;
+ private PlayerInventory playerInventory;
+ // CraftBukkit end + // CraftBukkit end
public ContainerAnvil(int i, PlayerInventory playerinventory) { public ContainerAnvil(int i, PlayerInventory playerinventory) {
this(i, playerinventory, ContainerAccess.a); this(i, playerinventory, ContainerAccess.a);
@@ -23,6 +33,7 @@ @@ -85,7 +93,7 @@
public ContainerAnvil(int i, PlayerInventory playerinventory, final ContainerAccess containeraccess) {
super(Containers.ANVIL, i);
+ this.playerInventory = playerinventory; // CraftBukkit
this.resultInventory = new InventoryCraftResult();
this.repairInventory = new InventorySubcontainer(2) {
@Override
@@ -123,7 +134,7 @@
byte b1 = 0; byte b1 = 0;
if (itemstack.isEmpty()) { if (itemstack.isEmpty()) {
- this.resultInventory.setItem(0, ItemStack.a); - this.resultInventory.setItem(0, ItemStack.b);
+ org.bukkit.craftbukkit.event.CraftEventFactory.callPrepareAnvilEvent(getBukkitView(), ItemStack.a); // CraftBukkit + org.bukkit.craftbukkit.event.CraftEventFactory.callPrepareAnvilEvent(getBukkitView(), ItemStack.b); // CraftBukkit
this.levelCost.set(0); this.levelCost.set(0);
} else { } else {
ItemStack itemstack1 = itemstack.cloneItemStack(); ItemStack itemstack1 = itemstack.cloneItemStack();
@@ -141,7 +152,7 @@ @@ -103,7 +111,7 @@
if (itemstack1.e() && itemstack1.getItem().a(itemstack, itemstack2)) { if (itemstack1.e() && itemstack1.getItem().a(itemstack, itemstack2)) {
k = Math.min(itemstack1.getDamage(), itemstack1.h() / 4); k = Math.min(itemstack1.getDamage(), itemstack1.h() / 4);
if (k <= 0) { if (k <= 0) {
- this.resultInventory.setItem(0, ItemStack.a); - this.resultInventory.setItem(0, ItemStack.b);
+ org.bukkit.craftbukkit.event.CraftEventFactory.callPrepareAnvilEvent(getBukkitView(), ItemStack.a); // CraftBukkit + org.bukkit.craftbukkit.event.CraftEventFactory.callPrepareAnvilEvent(getBukkitView(), ItemStack.b); // CraftBukkit
this.levelCost.set(0); this.levelCost.set(0);
return; return;
} }
@@ -156,7 +167,7 @@ @@ -118,7 +126,7 @@
this.h = i1; this.h = i1;
} else { } else {
if (!flag && (itemstack1.getItem() != itemstack2.getItem() || !itemstack1.e())) { if (!flag && (itemstack1.getItem() != itemstack2.getItem() || !itemstack1.e())) {
- this.resultInventory.setItem(0, ItemStack.a); - this.resultInventory.setItem(0, ItemStack.b);
+ org.bukkit.craftbukkit.event.CraftEventFactory.callPrepareAnvilEvent(getBukkitView(), ItemStack.a); // CraftBukkit + org.bukkit.craftbukkit.event.CraftEventFactory.callPrepareAnvilEvent(getBukkitView(), ItemStack.b); // CraftBukkit
this.levelCost.set(0); this.levelCost.set(0);
return; return;
} }
@@ -246,7 +257,7 @@ @@ -208,7 +216,7 @@
} }
if (flag2 && !flag1) { if (flag2 && !flag1) {
- this.resultInventory.setItem(0, ItemStack.a); - this.resultInventory.setItem(0, ItemStack.b);
+ org.bukkit.craftbukkit.event.CraftEventFactory.callPrepareAnvilEvent(getBukkitView(), ItemStack.a); // CraftBukkit + org.bukkit.craftbukkit.event.CraftEventFactory.callPrepareAnvilEvent(getBukkitView(), ItemStack.b); // CraftBukkit
this.levelCost.set(0); this.levelCost.set(0);
return; return;
} }
@@ -270,11 +281,11 @@ @@ -232,11 +240,11 @@
itemstack1 = ItemStack.a; itemstack1 = ItemStack.b;
} }
- if (b1 == i && b1 > 0 && this.levelCost.get() >= 40) { - if (b1 == i && b1 > 0 && this.levelCost.get() >= 40) {
@ -80,10 +69,10 @@
- if (this.levelCost.get() >= 40 && !this.player.abilities.canInstantlyBuild) { - if (this.levelCost.get() >= 40 && !this.player.abilities.canInstantlyBuild) {
+ if (this.levelCost.get() >= maximumRepairCost && !this.player.abilities.canInstantlyBuild) { // CraftBukkit + if (this.levelCost.get() >= maximumRepairCost && !this.player.abilities.canInstantlyBuild) { // CraftBukkit
itemstack1 = ItemStack.a; itemstack1 = ItemStack.b;
} }
@@ -293,7 +304,7 @@ @@ -255,7 +263,7 @@
EnchantmentManager.a(map, itemstack1); EnchantmentManager.a(map, itemstack1);
} }
@ -92,15 +81,7 @@
this.c(); this.c();
} }
} }
@@ -312,6 +323,7 @@ @@ -278,4 +286,18 @@
@Override
public boolean canUse(EntityHuman entityhuman) {
+ if (!this.checkReachable) return true; // CraftBukkit
return (Boolean) this.containerAccess.a((world, blockposition) -> {
return !world.getType(blockposition).a(TagsBlock.ANVIL) ? false : entityhuman.g((double) blockposition.getX() + 0.5D, (double) blockposition.getY() + 0.5D, (double) blockposition.getZ() + 0.5D) <= 64.0D;
}, true);
@@ -370,4 +382,18 @@
this.e(); this.e();
} }

Datei anzeigen

@ -0,0 +1,10 @@
--- a/net/minecraft/server/ContainerAnvilAbstract.java
+++ b/net/minecraft/server/ContainerAnvilAbstract.java
@@ -79,6 +79,7 @@
@Override
public boolean canUse(EntityHuman entityhuman) {
+ if (!this.checkReachable) return true; // CraftBukkit
return (Boolean) this.containerAccess.a((world, blockposition) -> {
return !this.a(world.getType(blockposition)) ? false : entityhuman.g((double) blockposition.getX() + 0.5D, (double) blockposition.getY() + 0.5D, (double) blockposition.getZ() + 0.5D) <= 64.0D;
}, true);

Datei anzeigen

@ -34,7 +34,7 @@
return a(this.containerAccess, entityhuman, Blocks.BEACON); return a(this.containerAccess, entityhuman, Blocks.BEACON);
} }
@@ -145,4 +153,17 @@ @@ -143,4 +151,17 @@
return 1; return 1;
} }
} }

Datei anzeigen

@ -115,7 +115,7 @@
this.c(); this.c();
}); });
} else { } else {
@@ -167,25 +231,53 @@ @@ -167,9 +231,24 @@
ItemStack itemstack2 = itemstack; ItemStack itemstack2 = itemstack;
List<WeightedRandomEnchant> list = this.a(itemstack, i, this.costs[i]); List<WeightedRandomEnchant> list = this.a(itemstack, i, this.costs[i]);
@ -142,6 +142,7 @@
if (flag) { if (flag) {
itemstack2 = new ItemStack(Items.ENCHANTED_BOOK); itemstack2 = new ItemStack(Items.ENCHANTED_BOOK);
@@ -182,16 +261,29 @@
this.enchantSlots.setItem(0, itemstack2); this.enchantSlots.setItem(0, itemstack2);
} }
@ -177,7 +178,7 @@
if (!entityhuman.abilities.canInstantlyBuild) { if (!entityhuman.abilities.canInstantlyBuild) {
itemstack1.subtract(j); itemstack1.subtract(j);
if (itemstack1.isEmpty()) { if (itemstack1.isEmpty()) {
@@ -232,6 +324,7 @@ @@ -238,6 +330,7 @@
@Override @Override
public boolean canUse(EntityHuman entityhuman) { public boolean canUse(EntityHuman entityhuman) {
@ -185,7 +186,7 @@
return a(this.containerAccess, entityhuman, Blocks.ENCHANTING_TABLE); return a(this.containerAccess, entityhuman, Blocks.ENCHANTING_TABLE);
} }
@@ -285,4 +378,17 @@ @@ -289,4 +382,17 @@
return itemstack; return itemstack;
} }

Datei anzeigen

@ -51,9 +51,9 @@
} }
@Override @Override
@@ -188,4 +206,17 @@ @@ -192,4 +210,17 @@
public int h() { public InventoryCrafting j() {
return this.craftInventory.f(); return this.craftInventory;
} }
+ +
+ // CraftBukkit start + // CraftBukkit start

Datei anzeigen

@ -0,0 +1,39 @@
--- a/net/minecraft/server/ContainerSmithing.java
+++ b/net/minecraft/server/ContainerSmithing.java
@@ -3,12 +3,17 @@
import java.util.List;
import javax.annotation.Nullable;
+import org.bukkit.craftbukkit.inventory.CraftInventoryView; // CraftBukkit
+
public class ContainerSmithing extends ContainerAnvilAbstract {
private final World g;
@Nullable
private RecipeSmithing h;
private final List<RecipeSmithing> i;
+ // CraftBukkit start
+ private CraftInventoryView bukkitEntity;
+ // CraftBukkit end
public ContainerSmithing(int i, PlayerInventory playerinventory) {
this(i, playerinventory, ContainerAccess.a);
@@ -68,4 +73,18 @@
return recipesmithing.a(itemstack);
});
}
+
+ // CraftBukkit start
+ @Override
+ public CraftInventoryView getBukkitView() {
+ if (bukkitEntity != null) {
+ return bukkitEntity;
+ }
+
+ org.bukkit.craftbukkit.inventory.CraftInventory inventory = new org.bukkit.craftbukkit.inventory.CraftInventorySmithing(
+ this.repairInventory, this.resultInventory);
+ bukkitEntity = new CraftInventoryView(this.player.getBukkitEntity(), inventory, this);
+ return bukkitEntity;
+ }
+ // CraftBukkit end
}

Datei anzeigen

@ -44,7 +44,7 @@
+ protected static void a(int i, World world, EntityHuman entityhuman, InventoryCrafting inventorycrafting, InventoryCraftResult inventorycraftresult, Container container) { // CraftBukkit + protected static void a(int i, World world, EntityHuman entityhuman, InventoryCrafting inventorycrafting, InventoryCraftResult inventorycraftresult, Container container) { // CraftBukkit
if (!world.isClientSide) { if (!world.isClientSide) {
EntityPlayer entityplayer = (EntityPlayer) entityhuman; EntityPlayer entityplayer = (EntityPlayer) entityhuman;
ItemStack itemstack = ItemStack.a; ItemStack itemstack = ItemStack.b;
@@ -55,6 +67,7 @@ @@ -55,6 +67,7 @@
itemstack = recipecrafting.a(inventorycrafting); itemstack = recipecrafting.a(inventorycrafting);
} }

Datei anzeigen

@ -9,8 +9,8 @@
}); });
public static final Containers<ContainerLoom> LOOM = a("loom", ContainerLoom::new); public static final Containers<ContainerLoom> LOOM = a("loom", ContainerLoom::new);
public static final Containers<ContainerMerchant> MERCHANT = a("merchant", ContainerMerchant::new); public static final Containers<ContainerMerchant> MERCHANT = a("merchant", ContainerMerchant::new);
@@ -30,12 +30,17 @@ @@ -31,12 +31,17 @@
private final Containers.Supplier<T> x; private final Containers.Supplier<T> y;
private static <T extends Container> Containers<T> a(String s, Containers.Supplier<T> containers_supplier) { private static <T extends Container> Containers<T> a(String s, Containers.Supplier<T> containers_supplier) {
- return (Containers) IRegistry.a(IRegistry.MENU, s, (Object) (new Containers<>(containers_supplier))); - return (Containers) IRegistry.a(IRegistry.MENU, s, (Object) (new Containers<>(containers_supplier)));
@ -18,7 +18,7 @@
} }
private Containers(Containers.Supplier<T> containers_supplier) { private Containers(Containers.Supplier<T> containers_supplier) {
this.x = containers_supplier; this.y = containers_supplier;
} }
- interface Supplier<T extends Container> {} - interface Supplier<T extends Container> {}

Datei anzeigen

@ -0,0 +1,54 @@
--- a/net/minecraft/server/Convertable.java
+++ b/net/minecraft/server/Convertable.java
@@ -175,8 +175,10 @@
};
}
- public Convertable.ConversionSession c(String s) throws IOException {
- return new Convertable.ConversionSession(s);
+ // CraftBukkit start
+ public Convertable.ConversionSession c(String s, ResourceKey<WorldDimension> dimensionType) throws IOException {
+ return new Convertable.ConversionSession(s, dimensionType);
+ // CraftBukkit end
}
public class ConversionSession implements AutoCloseable {
@@ -185,8 +187,12 @@
public final java.nio.file.Path folder;
private final String levelName;
private final Map<SavedFile, java.nio.file.Path> e = Maps.newHashMap();
+ // CraftBukkit start
+ private final ResourceKey<WorldDimension> dimensionType;
- public ConversionSession(String s) throws IOException {
+ public ConversionSession(String s, ResourceKey<WorldDimension> dimensionType) throws IOException {
+ this.dimensionType = dimensionType;
+ // CraftBukkit end
this.levelName = s;
this.folder = Convertable.this.universe.resolve(s);
this.lock = SessionLock.a(this.folder);
@@ -203,9 +209,23 @@
}
public File a(ResourceKey<World> resourcekey) {
- return DimensionManager.a(resourcekey, this.folder.toFile());
+ // CraftBukkit start
+ return this.getFolder(this.folder.toFile());
}
+ private File getFolder(File file) {
+ if (dimensionType == WorldDimension.OVERWORLD) {
+ return file;
+ } else if (dimensionType == WorldDimension.THE_NETHER) {
+ return new File(file, "DIM-1");
+ } else if (dimensionType == WorldDimension.THE_END) {
+ return new File(file, "DIM1");
+ } else {
+ throw new IllegalArgumentException("Unknwon dimension " + this.dimensionType);
+ }
+ }
+ // CraftBukkit end
+
private void checkSession() {
if (!this.lock.a()) {
throw new IllegalStateException("Lock is no longer valid");

Einige Dateien werden nicht angezeigt, da zu viele Dateien in diesem Diff geändert wurden Mehr anzeigen