Skip to content

Commit aa25eb6

Browse files
committed
πŸ„ε˜ζˆδΊ†ε‚ε€©ε€§πŸŒ³
1 parent a67face commit aa25eb6

12 files changed

Lines changed: 125 additions & 9 deletions

File tree

β€Žpatches/net/minecraft/server/level/ServerPlayer.java.patchβ€Ž

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
--- a/net/minecraft/server/level/ServerPlayer.java
22
+++ b/net/minecraft/server/level/ServerPlayer.java
3-
@@ -204,8 +_,9 @@
3+
@@ -202,10 +_,12 @@
4+
import net.minecraft.world.scores.Team;
5+
import net.minecraft.world.scores.TeamColor;
46
import net.minecraft.world.scores.criteria.ObjectiveCriteria;
7+
+import org.bukkit.craftbukkit.entity.CraftPlayer;
58
import org.jspecify.annotations.Nullable;
69
import org.slf4j.Logger;
710
+import org.teneted.neotenet.injection.server.level.ServerPlayerInjection;
@@ -55,7 +58,7 @@
5558
ServerPlayer.this.connection.send(new ClientboundContainerSetDataPacket(container.containerId, id, value));
5659
}
5760

58-
@@ -362,10 +_,17 @@
61+
@@ -362,10 +_,32 @@
5962
public void sendSystemMessage(Component message) {
6063
ServerPlayer.this.sendSystemMessage(message);
6164
}
@@ -70,6 +73,21 @@
7073
public boolean wonGame;
7174
+ // Neo: Used to track partial TIME_SINCE_REST increases for dimensions in which clocks move at different speeds. No need to persist, at most Phantoms will spawn one tick too early for each save/load cycle.
7275
+ private float partialTimeSinceRestTick;
76+
+ // CraftBukkit start
77+
+ public CraftPlayer.TransferCookieConnection transferCookieConnection;
78+
+ public String displayName;
79+
+ public Component listName;
80+
+ public int listOrder = 0;
81+
+ public org.bukkit.Location compassTarget;
82+
+ public int newExp = 0;
83+
+ public int newLevel = 0;
84+
+ public int newTotalExp = 0;
85+
+ public boolean keepLevel = false;
86+
+ public double maxHealthCache;
87+
+ public boolean joining = true;
88+
+ public boolean sentListPacket = false;
89+
+ public String kickLeaveMessage = null; // SPIGOT-3034: Forward leave message to PlayerQuitEvent
90+
+ // CraftBukkit end
7391

7492
public ServerPlayer(MinecraftServer server, ServerLevel level, GameProfile gameProfile, ClientInformation clientInformation) {
7593
super(level, gameProfile);
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
--- a/net/minecraft/world/Container.java
2+
+++ b/net/minecraft/world/Container.java
3+
@@ -17,8 +_,9 @@
4+
import org.jspecify.annotations.Nullable;
5+
6+
import net.neoforged.neoforge.common.extensions.ContainerExtension;
7+
+import org.teneted.neotenet.injection.world.ContainerInjection;
8+
9+
-public interface Container extends Clearable, Iterable<ItemStack>, SlotProvider, ContainerExtension {
10+
+public interface Container extends Clearable, Iterable<ItemStack>, SlotProvider, ContainerExtension, ContainerInjection {
11+
float DEFAULT_DISTANCE_BUFFER = 4.0F;
12+
13+
int getContainerSize();

β€Žpatches/net/minecraft/world/entity/LivingEntity.java.patchβ€Ž

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,17 @@
1313
import java.util.Iterator;
1414
import java.util.List;
1515
import java.util.Map;
16+
@@ -139,8 +_,9 @@
17+
import org.slf4j.Logger;
18+
19+
import net.neoforged.neoforge.common.extensions.ILivingEntityExtension;
20+
+import org.teneted.neotenet.injection.world.entity.LivingEntityInjection;
21+
22+
-public abstract class LivingEntity extends Entity implements Attackable, WaypointTransmitter, ILivingEntityExtension {
23+
+public abstract class LivingEntity extends Entity implements Attackable, WaypointTransmitter, ILivingEntityExtension, LivingEntityInjection {
24+
private static final Logger LOGGER = LogUtils.getLogger();
25+
private static final String TAG_ACTIVE_EFFECTS = "active_effects";
26+
public static final String TAG_ATTRIBUTES = "attributes";
1627
@@ -177,14 +_,14 @@
1728
private static final double MAX_LINE_OF_SIGHT_TEST_RANGE = 128.0;
1829
protected static final int LIVING_ENTITY_FLAG_IS_USING = 1;
@@ -218,7 +229,12 @@
218229
return true;
219230
}
220231

221-
@@ -1014,12 +_,13 @@
232+
@@ -1010,16 +_,17 @@
233+
}
234+
235+
public final boolean addEffect(MobEffectInstance newEffect) {
236+
- return this.addEffect(newEffect, null);
237+
+ return this.addEffect(newEffect, (Entity) null);
222238
}
223239

224240
public boolean addEffect(MobEffectInstance newEffect, @Nullable Entity source) {

β€Žpatches/net/minecraft/world/entity/Mob.java.patchβ€Ž

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
--- a/net/minecraft/world/entity/Mob.java
22
+++ b/net/minecraft/world/entity/Mob.java
3+
@@ -95,8 +_,9 @@
4+
import net.minecraft.world.phys.Vec3;
5+
import net.minecraft.world.ticks.ContainerSingleItem;
6+
import org.jspecify.annotations.Nullable;
7+
+import org.teneted.neotenet.injection.world.entity.MobInjection;
8+
9+
-public abstract class Mob extends LivingEntity implements Targeting, EquipmentUser, Leashable {
10+
+public abstract class Mob extends LivingEntity implements Targeting, EquipmentUser, Leashable, MobInjection {
11+
private static final EntityDataAccessor<Byte> DATA_MOB_FLAGS_ID = SynchedEntityData.defineId(Mob.class, EntityDataSerializers.BYTE);
12+
private static final int MOB_FLAG_NO_AI = 1;
13+
private static final int MOB_FLAG_LEFTHANDED = 2;
314
@@ -131,19 +_,25 @@
415
protected JumpControl jumpControl;
516
private final BodyRotationControl bodyRotationControl;

β€Žpatches/net/minecraft/world/entity/player/Player.java.patchβ€Ž

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
--- a/net/minecraft/world/entity/player/Player.java
22
+++ b/net/minecraft/world/entity/player/Player.java
3-
@@ -126,6 +_,7 @@
3+
@@ -124,8 +_,10 @@
4+
import org.jspecify.annotations.Nullable;
5+
46
import net.neoforged.neoforge.common.extensions.IPlayerExtension;
7+
+import org.teneted.neotenet.injection.world.entity.player.PlayerInjection;
58

6-
public abstract class Player extends Avatar implements ContainerUser, IPlayerExtension {
9+
-public abstract class Player extends Avatar implements ContainerUser, IPlayerExtension {
10+
+public abstract class Player extends Avatar implements ContainerUser, IPlayerExtension, PlayerInjection {
711
+ public static final String PERSISTED_NBT_TAG = "PlayerPersisted";
812
public static final int MAX_HEALTH = 20;
913
public static final int SLEEP_DURATION = 100;
@@ -24,14 +28,17 @@
2428
protected final float defaultFlySpeed = 0.02F;
2529
private int lastLevelUpTime;
2630
private final GameProfile gameProfile;
27-
@@ -173,6 +_,10 @@
31+
@@ -173,6 +_,13 @@
2832
private Optional<GlobalPos> lastDeathLocation = Optional.empty();
2933
public @Nullable FishingHook fishing;
3034
protected float hurtDir;
3135
+ private final java.util.Collection<MutableComponent> prefixes = new java.util.LinkedList<>();
3236
+ private final java.util.Collection<MutableComponent> suffixes = new java.util.LinkedList<>();
3337
+ @Nullable
3438
+ private Pose forcedPose = null;
39+
+ // CraftBukkit start
40+
+ public boolean fauxSleeping;
41+
+ public int oldLevel = -1;
3542

3643
public Player(Level level, GameProfile gameProfile) {
3744
super(EntityTypes.PLAYER, level);

β€Žpatches/net/minecraft/world/level/BlockGetter.java.patchβ€Ž

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
--- a/net/minecraft/world/level/BlockGetter.java
22
+++ b/net/minecraft/world/level/BlockGetter.java
3+
@@ -22,8 +_,9 @@
4+
import org.jspecify.annotations.Nullable;
5+
6+
import net.neoforged.neoforge.common.extensions.IBlockGetterExtension;
7+
+import org.teneted.neotenet.injection.world.level.BlockGetterInjection;
8+
9+
-public interface BlockGetter extends LevelHeightAccessor, IBlockGetterExtension {
10+
+public interface BlockGetter extends LevelHeightAccessor, IBlockGetterExtension, BlockGetterInjection {
11+
@Nullable BlockEntity getBlockEntity(BlockPos pos);
12+
13+
default <T extends BlockEntity> Optional<T> getBlockEntity(BlockPos pos, BlockEntityType<T> type) {
314
@@ -36,7 +_,7 @@
415
FluidState getFluidState(BlockPos pos);
516

β€Žpatches/net/minecraft/world/level/Level.java.patchβ€Ž

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
import net.minecraft.world.entity.player.Player;
2121
import net.minecraft.world.item.ItemStack;
2222
import net.minecraft.world.item.alchemy.PotionBrewing;
23-
@@ -88,11 +_,13 @@
23+
@@ -88,11 +_,14 @@
2424
import net.minecraft.world.phys.Vec3;
2525
import net.minecraft.world.scores.Scoreboard;
2626
import org.apache.commons.lang3.mutable.MutableBoolean;
@@ -29,9 +29,10 @@
2929
import org.jspecify.annotations.Nullable;
3030

3131
import net.neoforged.neoforge.common.extensions.ILevelExtension;
32+
+import org.teneted.neotenet.injection.world.level.LevelInjection;
3233

3334
-public abstract class Level implements LevelAccessor, AutoCloseable, ILevelExtension {
34-
+public abstract class Level extends net.neoforged.neoforge.attachment.AttachmentHolder implements LevelAccessor, AutoCloseable, ILevelExtension {
35+
+public abstract class Level extends net.neoforged.neoforge.attachment.AttachmentHolder implements LevelAccessor, AutoCloseable, ILevelExtension, LevelInjection {
3536
public static final Codec<ResourceKey<Level>> RESOURCE_KEY_CODEC = ResourceKey.codec(Registries.DIMENSION);
3637
public static final ResourceKey<Level> OVERWORLD = ResourceKey.create(Registries.DIMENSION, Identifier.withDefaultNamespace("overworld"));
3738
public static final ResourceKey<Level> NETHER = ResourceKey.create(Registries.DIMENSION, Identifier.withDefaultNamespace("the_nether"));
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
--- a/net/minecraft/world/level/LevelAccessor.java
2+
+++ b/net/minecraft/world/level/LevelAccessor.java
3+
@@ -22,8 +_,9 @@
4+
import net.minecraft.world.ticks.ScheduledTick;
5+
import net.minecraft.world.ticks.TickPriority;
6+
import org.jspecify.annotations.Nullable;
7+
+import org.teneted.neotenet.injection.world.level.LevelAccessorInjection;
8+
9+
-public interface LevelAccessor extends CommonLevelAccessor, ScheduledTickAccess {
10+
+public interface LevelAccessor extends CommonLevelAccessor, ScheduledTickAccess, LevelAccessorInjection {
11+
long nextSubTickCount();
12+
13+
@Override
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
--- a/net/minecraft/world/level/LevelWriter.java
2+
+++ b/net/minecraft/world/level/LevelWriter.java
3+
@@ -5,8 +_,9 @@
4+
import net.minecraft.world.level.block.Block;
5+
import net.minecraft.world.level.block.state.BlockState;
6+
import org.jspecify.annotations.Nullable;
7+
+import org.teneted.neotenet.injection.world.level.LevelWriterInjection;
8+
9+
-public interface LevelWriter {
10+
+public interface LevelWriter extends LevelWriterInjection {
11+
boolean setBlock(BlockPos pos, BlockState blockState, @Block.UpdateFlags int updateFlags, int updateLimit);
12+
13+
default boolean setBlock(BlockPos pos, BlockState blockState, @Block.UpdateFlags int updateFlags) {
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
--- a/net/minecraft/world/level/ServerLevelAccessor.java
2+
+++ b/net/minecraft/world/level/ServerLevelAccessor.java
3+
@@ -4,8 +_,9 @@
4+
import net.minecraft.server.level.ServerLevel;
5+
import net.minecraft.world.DifficultyInstance;
6+
import net.minecraft.world.entity.Entity;
7+
+import org.teneted.neotenet.injection.world.level.ServerLevelAccessorInjection;
8+
9+
-public interface ServerLevelAccessor extends LevelAccessor {
10+
+public interface ServerLevelAccessor extends LevelAccessor, ServerLevelAccessorInjection {
11+
ServerLevel getLevel();
12+
13+
DifficultyInstance getCurrentDifficultyAt(BlockPos pos);

0 commit comments

Comments
Β (0)