mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-27 11:27:35 +01:00
it compiles?
This commit is contained in:
parent
9bb6731cc4
commit
4cc2be301d
@ -1,6 +1,6 @@
|
|||||||
--- /dev/null
|
--- /dev/null
|
||||||
+++ b/io/papermc/paper/FeatureHooks.java
|
+++ b/io/papermc/paper/FeatureHooks.java
|
||||||
@@ -1,0 +_,72 @@
|
@@ -1,0 +_,77 @@
|
||||||
+package io.papermc.paper;
|
+package io.papermc.paper;
|
||||||
+
|
+
|
||||||
+import io.papermc.paper.command.PaperSubcommand;
|
+import io.papermc.paper.command.PaperSubcommand;
|
||||||
@ -16,6 +16,7 @@
|
|||||||
+import net.minecraft.core.Registry;
|
+import net.minecraft.core.Registry;
|
||||||
+import net.minecraft.network.protocol.game.ClientboundLevelChunkWithLightPacket;
|
+import net.minecraft.network.protocol.game.ClientboundLevelChunkWithLightPacket;
|
||||||
+import net.minecraft.server.level.ServerPlayer;
|
+import net.minecraft.server.level.ServerPlayer;
|
||||||
|
+import net.minecraft.world.entity.monster.Spider;
|
||||||
+import net.minecraft.world.level.ChunkPos;
|
+import net.minecraft.world.level.ChunkPos;
|
||||||
+import net.minecraft.world.level.Level;
|
+import net.minecraft.world.level.Level;
|
||||||
+import net.minecraft.world.level.biome.Biome;
|
+import net.minecraft.world.level.biome.Biome;
|
||||||
@ -72,4 +73,8 @@
|
|||||||
+ public static boolean isChunkSent(final ServerPlayer player, final long chunkKey) {
|
+ public static boolean isChunkSent(final ServerPlayer player, final long chunkKey) {
|
||||||
+ return player.getChunkTrackingView().contains(new ChunkPos(chunkKey));
|
+ return player.getChunkTrackingView().contains(new ChunkPos(chunkKey));
|
||||||
+ }
|
+ }
|
||||||
|
+
|
||||||
|
+ public static boolean isSpiderCollidingWithWorldBorder(final Spider spider) {
|
||||||
|
+ return true; // ca.spottedleaf.moonrise.patches.collisions.CollisionUtil.isCollidingWithBorder(spider.level().getWorldBorder(), spider.getBoundingBox().inflate(ca.spottedleaf.moonrise.patches.collisions.CollisionUtil.COLLISION_EPSILON))
|
||||||
|
+ }
|
||||||
+}
|
+}
|
||||||
|
@ -1,16 +1,43 @@
|
|||||||
--- a/net/minecraft/gametest/framework/GameTestServer.java
|
--- a/net/minecraft/gametest/framework/GameTestServer.java
|
||||||
+++ b/net/minecraft/gametest/framework/GameTestServer.java
|
+++ b/net/minecraft/gametest/framework/GameTestServer.java
|
||||||
@@ -304,6 +_,13 @@
|
@@ -139,6 +_,8 @@
|
||||||
|
BlockPos spawnPos
|
||||||
|
) {
|
||||||
|
super(
|
||||||
|
+ null, // Paper
|
||||||
|
+ null, // Paper
|
||||||
|
serverThread,
|
||||||
|
storageSource,
|
||||||
|
packRepository,
|
||||||
|
@@ -154,8 +_,15 @@
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean initServer() {
|
||||||
|
- this.setPlayerList(new PlayerList(this, this.registries(), this.playerDataStorage, 1) {});
|
||||||
|
- this.loadLevel();
|
||||||
|
+ // Paper start
|
||||||
|
+ this.setPlayerList(new PlayerList(this, this.registries(), this.playerDataStorage, 1) {
|
||||||
|
+ @Override
|
||||||
|
+ public void loadAndSaveFiles() {
|
||||||
|
+ throw new UnsupportedOperationException("Should not be called in a GameTestServer");
|
||||||
|
+ }
|
||||||
|
+ });
|
||||||
|
+ this.loadLevel("blah");
|
||||||
|
+ // Paper end
|
||||||
|
ServerLevel serverLevel = this.overworld();
|
||||||
|
this.testBatches = Lists.newArrayList(GameTestBatchFactory.fromTestFunction(this.testFunctions, serverLevel));
|
||||||
|
serverLevel.setDefaultSpawnPos(this.spawnPos, 0.0F);
|
||||||
|
@@ -303,6 +_,13 @@
|
||||||
|
public boolean shouldInformAdmins() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
+
|
||||||
+ // Paper start
|
+ // Paper start
|
||||||
+ @Override
|
+ @Override
|
||||||
+ public org.bukkit.command.CommandSender getBukkitSender(final net.minecraft.commands.CommandSourceStack wrapper) {
|
+ public org.bukkit.command.CommandSender getBukkitSender(final net.minecraft.commands.CommandSourceStack wrapper) {
|
||||||
+ throw new UnsupportedOperationException("Not supported.");
|
+ throw new UnsupportedOperationException("Not supported.");
|
||||||
+ }
|
+ }
|
||||||
+ // Paper end
|
+ // Paper end
|
||||||
+
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isSingleplayerOwner(GameProfile profile) {
|
public boolean isSingleplayerOwner(GameProfile profile) {
|
||||||
return false;
|
|
||||||
|
@ -65,8 +65,8 @@
|
|||||||
.apply(instance, MutableComponent::new)
|
.apply(instance, MutableComponent::new)
|
||||||
);
|
);
|
||||||
+ // Paper start - adventure; create separate codec for each locale
|
+ // Paper start - adventure; create separate codec for each locale
|
||||||
+ final Codec<Component> origCodec = codec;
|
+ final Codec<Component> origCodec = codec1;
|
||||||
+ codec = new Codec<>() {
|
+ codec1 = new Codec<>() {
|
||||||
+ @Override
|
+ @Override
|
||||||
+ public <T> DataResult<com.mojang.datafixers.util.Pair<Component, T>> decode(final DynamicOps<T> ops, final T input) {
|
+ public <T> DataResult<com.mojang.datafixers.util.Pair<Component, T>> decode(final DynamicOps<T> ops, final T input) {
|
||||||
+ return origCodec.decode(ops, input);
|
+ return origCodec.decode(ops, input);
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
super.tick();
|
super.tick();
|
||||||
if (!this.level().isClientSide) {
|
if (!this.level().isClientSide) {
|
||||||
- this.setClimbing(this.horizontalCollision);
|
- this.setClimbing(this.horizontalCollision);
|
||||||
+ this.setClimbing(this.horizontalCollision && (this.level().paperConfig().entities.behavior.allowSpiderWorldBorderClimbing || !(ca.spottedleaf.moonrise.patches.collisions.CollisionUtil.isCollidingWithBorder(this.level().getWorldBorder(), this.getBoundingBox().inflate(ca.spottedleaf.moonrise.patches.collisions.CollisionUtil.COLLISION_EPSILON)) && this.level().getWorldBorder().isInsideCloseToBorder(this, this.getBoundingBox())))); // Paper - Add config option for spider worldborder climbing (Inflate by +EPSILON as collision will just barely place us outside border)
|
+ this.setClimbing(this.horizontalCollision && (this.level().paperConfig().entities.behavior.allowSpiderWorldBorderClimbing || !(io.papermc.paper.FeatureHooks.isSpiderCollidingWithWorldBorder(this) && this.level().getWorldBorder().isInsideCloseToBorder(this, this.getBoundingBox())))); // Paper - Add config option for spider worldborder climbing (Inflate by +EPSILON as collision will just barely place us outside border)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8,10 +8,25 @@
|
|||||||
import net.minecraft.world.entity.player.Player;
|
import net.minecraft.world.entity.player.Player;
|
||||||
import net.minecraft.world.item.Item;
|
import net.minecraft.world.item.Item;
|
||||||
import net.minecraft.world.item.ItemStack;
|
import net.minecraft.world.item.ItemStack;
|
||||||
@@ -74,6 +_,16 @@
|
@@ -63,16 +_,26 @@
|
||||||
|
protected int inGroundTime;
|
||||||
|
public AbstractArrow.Pickup pickup = AbstractArrow.Pickup.DISALLOWED;
|
||||||
|
public int shakeTime;
|
||||||
|
- private int life;
|
||||||
|
+ public int life; // Paper - private -> public
|
||||||
|
private double baseDamage = 2.0;
|
||||||
|
- private SoundEvent soundEvent = this.getDefaultHitGroundSoundEvent();
|
||||||
|
+ public SoundEvent soundEvent = this.getDefaultHitGroundSoundEvent(); // Paper - private -> public
|
||||||
@Nullable
|
@Nullable
|
||||||
private ItemStack firedFromWeapon = null;
|
private IntOpenHashSet piercingIgnoreEntityIds;
|
||||||
|
@Nullable
|
||||||
|
private List<Entity> piercedAndKilledEntities;
|
||||||
|
- private ItemStack pickupItemStack = this.getDefaultPickupItem();
|
||||||
|
+ public ItemStack pickupItemStack = this.getDefaultPickupItem(); // Paper - private -> public
|
||||||
|
@Nullable
|
||||||
|
- private ItemStack firedFromWeapon = null;
|
||||||
|
+ public ItemStack firedFromWeapon = null; // Paper - private -> public
|
||||||
|
+
|
||||||
+ // Spigot Start
|
+ // Spigot Start
|
||||||
+ @Override
|
+ @Override
|
||||||
+ public void inactiveTick() {
|
+ public void inactiveTick() {
|
||||||
@ -21,10 +36,9 @@
|
|||||||
+ super.inactiveTick();
|
+ super.inactiveTick();
|
||||||
+ }
|
+ }
|
||||||
+ // Spigot End
|
+ // Spigot End
|
||||||
+
|
|
||||||
protected AbstractArrow(EntityType<? extends AbstractArrow> entityType, Level level) {
|
protected AbstractArrow(EntityType<? extends AbstractArrow> entityType, Level level) {
|
||||||
super(entityType, level);
|
super(entityType, level);
|
||||||
}
|
|
||||||
@@ -87,7 +_,13 @@
|
@@ -87,7 +_,13 @@
|
||||||
ItemStack pickupItemStack,
|
ItemStack pickupItemStack,
|
||||||
@Nullable ItemStack firedFromWeapon
|
@Nullable ItemStack firedFromWeapon
|
||||||
@ -231,3 +245,34 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -643,7 +_,7 @@
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
- protected ItemStack getPickupItem() {
|
||||||
|
+ public ItemStack getPickupItem() { // Paper - protected -> public
|
||||||
|
return this.pickupItemStack.copy();
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -675,7 +_,7 @@
|
||||||
|
this.setFlag(1, critArrow);
|
||||||
|
}
|
||||||
|
|
||||||
|
- private void setPierceLevel(byte pierceLevel) {
|
||||||
|
+ public void setPierceLevel(byte pierceLevel) { // Paper - private -> public
|
||||||
|
this.entityData.set(PIERCE_LEVEL, pierceLevel);
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -687,6 +_,12 @@
|
||||||
|
this.entityData.set(ID_FLAGS, (byte)(b & ~id));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
+
|
||||||
|
+ // Paper start
|
||||||
|
+ public void setPickupItemStackPublic(final ItemStack pickupItemStack) {
|
||||||
|
+ this.setPickupItemStack(pickupItemStack);
|
||||||
|
+ }
|
||||||
|
+ // Paper end
|
||||||
|
|
||||||
|
protected void setPickupItemStack(ItemStack pickupItemStack) {
|
||||||
|
if (!pickupItemStack.isEmpty()) {
|
||||||
|
@ -219,11 +219,13 @@
|
|||||||
|
|
||||||
return interactionResult;
|
return interactionResult;
|
||||||
}
|
}
|
||||||
@@ -470,30 +_,69 @@
|
@@ -469,31 +_,70 @@
|
||||||
|
return this.isDamageableItem() && this.getDamageValue() >= this.getMaxDamage() - 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void hurtAndBreak(int damage, ServerLevel level, @Nullable ServerPlayer player, Consumer<Item> onBreak) {
|
- public void hurtAndBreak(int damage, ServerLevel level, @Nullable ServerPlayer player, Consumer<Item> onBreak) {
|
||||||
- int i = this.processDurabilityChange(damage, level, player);
|
- int i = this.processDurabilityChange(damage, level, player);
|
||||||
|
+ public void hurtAndBreak(int damage, ServerLevel level, @Nullable LivingEntity player, Consumer<Item> onBreak) { // Paper - Add EntityDamageItemEvent
|
||||||
+ // Paper start - add force boolean overload
|
+ // Paper start - add force boolean overload
|
||||||
+ this.hurtAndBreak(damage, level, player, onBreak, false);
|
+ this.hurtAndBreak(damage, level, player, onBreak, false);
|
||||||
+ }
|
+ }
|
||||||
|
@ -150,7 +150,7 @@ public class CraftAbstractArrow extends AbstractProjectile implements AbstractAr
|
|||||||
@Override
|
@Override
|
||||||
public void setItemStack(final ItemStack stack) {
|
public void setItemStack(final ItemStack stack) {
|
||||||
Preconditions.checkArgument(stack != null, "ItemStack cannot be null");
|
Preconditions.checkArgument(stack != null, "ItemStack cannot be null");
|
||||||
this.getHandle().setPickupItemStack(CraftItemStack.asNMSCopy(stack));
|
this.getHandle().setPickupItemStackPublic(CraftItemStack.asNMSCopy(stack));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user