mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-29 15:49:00 +01:00
Patches!!! MORE MORE MORE MOOOOORE
This commit is contained in:
parent
0087658702
commit
6f010858de
73 changed files with 58 additions and 60 deletions
|
@ -13,7 +13,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
@Override
|
||||
public BlockState getStateForPlacement(BlockPlaceContext ctx) {
|
||||
+ if (io.papermc.paper.configuration.GlobalConfiguration.get().blockUpdates.disableChorusPlantUpdates) return this.defaultBlockState(); // Paper - add option to disable block updates
|
||||
return this.getStateForPlacement(ctx.getLevel(), ctx.getClickedPos());
|
||||
return getStateWithConnections(ctx.getLevel(), ctx.getClickedPos(), this.defaultBlockState());
|
||||
}
|
||||
|
||||
@@ -0,0 +0,0 @@ public class ChorusPlantBlock extends PipeBlock {
|
||||
|
@ -144,8 +144,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
@@ -0,0 +0,0 @@ public class TripWireBlock extends Block {
|
||||
|
||||
@Override
|
||||
public void playerWillDestroy(Level world, BlockPos pos, BlockState state, Player player) {
|
||||
+ if (io.papermc.paper.configuration.GlobalConfiguration.get().blockUpdates.disableTripwireUpdates) return; // Paper - prevent disarming tripwires
|
||||
public BlockState playerWillDestroy(Level world, BlockPos pos, BlockState state, Player player) {
|
||||
+ if (io.papermc.paper.configuration.GlobalConfiguration.get().blockUpdates.disableTripwireUpdates) return state; // Paper - prevent disarming tripwires
|
||||
if (!world.isClientSide && !player.getMainHandItem().isEmpty() && player.getMainHandItem().is(Items.SHEARS)) {
|
||||
world.setBlock(pos, (BlockState) state.setValue(TripWireBlock.DISARMED, true), 4);
|
||||
world.gameEvent((Entity) player, GameEvent.SHEAR, pos);
|
|
@ -33,13 +33,3 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
slot = (Slot) this.slots.get(slotIndex);
|
||||
itemstack = this.getCarried();
|
||||
if (AbstractContainerMenu.canItemQuickReplace(slot, itemstack, true) && slot.mayPlace(itemstack) && (this.quickcraftType == 2 || itemstack.getCount() > this.quickcraftSlots.size()) && this.canDragTo(slot)) {
|
||||
@@ -0,0 +0,0 @@ public abstract class AbstractContainerMenu {
|
||||
Slot slot2;
|
||||
int j2;
|
||||
|
||||
- if (actionType == ClickType.SWAP) {
|
||||
+ if (actionType == ClickType.SWAP && (button == 40 || button >= 0 && button < 9)) { // Paper
|
||||
+ if (slotIndex < 0 || button < 0) return; // Paper
|
||||
slot2 = (Slot) this.slots.get(slotIndex);
|
||||
itemstack1 = playerinventory.getItem(button);
|
||||
itemstack = slot2.getItem();
|
|
@ -24,17 +24,16 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
@@ -0,0 +0,0 @@ public class ThrownTrident extends AbstractArrow {
|
||||
|
||||
public ThrownTrident(EntityType<? extends ThrownTrident> type, Level world) {
|
||||
super(type, world);
|
||||
super(type, world, ThrownTrident.DEFAULT_ARROW_STACK);
|
||||
+ this.baseDamage = net.minecraft.world.item.TridentItem.BASE_DAMAGE; // Paper
|
||||
this.tridentItem = new ItemStack(Items.TRIDENT);
|
||||
}
|
||||
|
||||
public ThrownTrident(Level world, LivingEntity owner, ItemStack stack) {
|
||||
super(EntityType.TRIDENT, owner, world);
|
||||
super(EntityType.TRIDENT, owner, world, stack);
|
||||
+ this.baseDamage = net.minecraft.world.item.TridentItem.BASE_DAMAGE; // Paper
|
||||
this.tridentItem = new ItemStack(Items.TRIDENT);
|
||||
this.tridentItem = stack.copy();
|
||||
this.entityData.set(ThrownTrident.ID_LOYALTY, (byte) EnchantmentHelper.getLoyalty(stack));
|
||||
this.entityData.set(ThrownTrident.ID_FOIL, stack.hasFoil());
|
||||
}
|
||||
@@ -0,0 +0,0 @@ public class ThrownTrident extends AbstractArrow {
|
||||
@Override
|
||||
protected void onHitEntity(EntityHitResult entityHitResult) {
|
|
@ -8,7 +8,7 @@ diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/jav
|
|||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
||||
}
|
||||
|
||||
protected BlockPos getOnPos(float offset) {
|
|
@ -8,7 +8,7 @@ diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/jav
|
|||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
||||
private UUID originWorld;
|
||||
public boolean freezeLocked = false; // Paper - Freeze Tick Lock API
|
||||
public boolean collidingWithWorldBorder; // Paper
|
||||
|
@ -16,7 +16,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
|
||||
public void setOrigin(@javax.annotation.Nonnull Location location) {
|
||||
this.origin = location.toVector();
|
||||
@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
||||
public void onClientRemoval() {}
|
||||
|
||||
public void setPose(net.minecraft.world.entity.Pose pose) {
|
|
@ -9,8 +9,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
@@ -0,0 +0,0 @@ public class CraftEventFactory {
|
||||
} else if (entity instanceof net.minecraft.world.entity.ExperienceOrb) {
|
||||
net.minecraft.world.entity.ExperienceOrb xp = (net.minecraft.world.entity.ExperienceOrb) entity;
|
||||
// Spigot start - SPIGOT-7523: Merge after spawn event and only merge if the event was not cancelled (gets checked above)
|
||||
if (entity instanceof net.minecraft.world.entity.ExperienceOrb xp) {
|
||||
double radius = world.spigotConfig.expMerge;
|
||||
- if (radius > 0) {
|
||||
+ // Paper start - Call EntitySpawnEvent for ExperienceOrb entities.
|
|
@ -1161,7 +1161,7 @@ diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/jav
|
|||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
||||
public @Nullable Throwable addedToWorldStack; // Paper - entity debug
|
||||
public CraftEntity getBukkitEntity() {
|
||||
if (this.bukkitEntity == null) {
|
||||
|
@ -1186,7 +1186,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
@Override
|
||||
public CommandSender getBukkitSender(CommandSourceStack wrapper) {
|
||||
return this.getBukkitEntity();
|
||||
@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
||||
return;
|
||||
}
|
||||
// Paper end - rewrite chunk system
|
||||
|
@ -1194,7 +1194,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
if (this.removalReason == null) {
|
||||
this.removalReason = reason;
|
||||
}
|
||||
@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
||||
|
||||
if (reason != RemovalReason.UNLOADED_TO_CHUNK) this.getPassengers().forEach(Entity::stopRiding); // Paper - chunk system - don't adjust passenger state when unloading, it's just not safe (and messes with our logic in entity chunk unload)
|
||||
this.levelCallback.onRemove(reason);
|
|
@ -50,7 +50,16 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+ // Paper end
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
from = event.getFrom();
|
||||
this.internalTeleport(from.getX(), from.getY(), from.getZ(), from.getYaw(), from.getPitch(), Collections.emptySet());
|
||||
return;
|
||||
+ }
|
||||
+ // Paper end
|
||||
}
|
||||
// Paper end
|
||||
}
|
||||
@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
boolean flag2 = false;
|
||||
|
|
@ -58,7 +58,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+ }
|
||||
+ // Paper end - per player mob spawning backoff
|
||||
}
|
||||
spawnercreature_d = NaturalSpawner.createState(l, this.level.getAllEntities(), this::getFullChunk, null, true);
|
||||
spawnercreature_d = NaturalSpawner.createState(naturalSpawnChunkCount, this.level.getAllEntities(), this::getFullChunk, null, true);
|
||||
} else {
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
@ -8,7 +8,7 @@ diff --git a/src/main/java/net/minecraft/commands/CommandSourceStack.java b/src/
|
|||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/commands/CommandSourceStack.java
|
||||
+++ b/src/main/java/net/minecraft/commands/CommandSourceStack.java
|
||||
@@ -0,0 +0,0 @@ public class CommandSourceStack implements SharedSuggestionProvider, com.destroy
|
||||
@@ -0,0 +0,0 @@ public class CommandSourceStack implements ExecutionCommandSource<CommandSourceS
|
||||
|
||||
// CraftBukkit start
|
||||
public boolean hasPermission(int i, String bukkitPermission) {
|
|
@ -15,11 +15,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
@@ -0,0 +0,0 @@ public class ServerPlayerGameMode {
|
||||
isCorrectTool = flag1; // Paper
|
||||
|
||||
itemstack.mineBlock(this.level, iblockdata, pos, this.player);
|
||||
itemstack.mineBlock(this.level, iblockdata1, pos, this.player);
|
||||
- if (flag && flag1 && event.isDropItems()) { // CraftBukkit - Check if block should drop items
|
||||
- block.playerDestroy(this.level, this.player, pos, iblockdata, tileentity, itemstack1);
|
||||
+ if (flag && flag1 /* && event.isDropItems() */) { // CraftBukkit - Check if block should drop items // Paper - fix drops not preventing stats/food exhaustion
|
||||
+ block.playerDestroy(this.level, this.player, pos, iblockdata, tileentity, itemstack1, event.isDropItems()); // Paper
|
||||
- block.playerDestroy(this.level, this.player, pos, iblockdata1, tileentity, itemstack1);
|
||||
+ if (flag && flag1 && event.isDropItems()/* && event.isDropItems() */) { // CraftBukkit - Check if block should drop items // Paper - fix drops not preventing stats/food exhaustion
|
||||
+ block.playerDestroy(this.level, this.player, pos, iblockdata1, tileentity, itemstack1, event.isDropItems()); // Paper
|
||||
}
|
||||
|
||||
// return true; // CraftBukkit
|
||||
|
@ -75,7 +75,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+ super.playerDestroy(world, player, pos, Blocks.AIR.defaultBlockState(), blockEntity, tool, includeDrops); // Paper
|
||||
}
|
||||
|
||||
protected static void preventCreativeDropFromBottomPart(Level world, BlockPos pos, BlockState state, Player player) {
|
||||
protected static void preventDropFromBottomPart(Level world, BlockPos pos, BlockState state, Player player) {
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/IceBlock.java b/src/main/java/net/minecraft/world/level/block/IceBlock.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/IceBlock.java
|
Loading…
Reference in a new issue