Skip to content

Commit

Permalink
Bukkit-1.21.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Mgazul committed Oct 23, 2024
1 parent 1a32f96 commit 808f072
Show file tree
Hide file tree
Showing 150 changed files with 2,502 additions and 1,439 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
@@ -79,6 +_,8 @@
@Nullable
private DebugSampleSubscriptionTracker debugSampleSubscriptionTracker;
private final ServerLinks serverLinks;
public ServerLinks serverLinks;
+ @Nullable
+ private net.minecraft.client.server.LanServerPinger dediLanPinger;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
@@ -50,6 +_,7 @@
final Executor mainThreadExecutor;
private long ticketTickCounter;
private int simulationDistance = 10;
public int simulationDistance = 10;
+ private final Long2ObjectOpenHashMap<SortedArraySet<Ticket<?>>> forcedTickets = new Long2ObjectOpenHashMap<>();

protected DistanceManager(Executor p_140774_, Executor p_140775_) {
Expand Down
2 changes: 1 addition & 1 deletion patches/net/minecraft/server/level/Ticket.java.patch
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
@@ -9,9 +_,14 @@
private long createdTick;

protected Ticket(TicketType<T> p_9425_, int p_9426_, T p_9427_) {
public Ticket(TicketType<T> p_9425_, int p_9426_, T p_9427_) {
+ this(p_9425_, p_9426_, p_9427_, false);
+ }
+
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
--- a/net/minecraft/server/packs/repository/Pack.java
+++ b/net/minecraft/server/packs/repository/Pack.java
@@ -23,6 +_,16 @@
private final Pack.ResourcesSupplier resources;
public final Pack.ResourcesSupplier resources;
private final Pack.Metadata metadata;
private final PackSelectionConfig selectionConfig;
+ private final boolean hidden; // Neo: Allow packs to be hidden from the UI entirely
Expand Down
2 changes: 1 addition & 1 deletion patches/net/minecraft/server/players/PlayerList.java.patch
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
+ net.neoforged.neoforge.event.EventHooks.firePlayerLoggedIn( p_11263_ );
}

protected void updateEntireScoreboard(ServerScoreboard p_11274_, ServerPlayer p_11275_) {
public void updateEntireScoreboard(ServerScoreboard p_11274_, ServerPlayer p_11275_) {
@@ -301,6 +_,7 @@
optional = Optional.of(compoundtag);
p_11225_.load(compoundtag);
Expand Down
4 changes: 2 additions & 2 deletions patches/net/minecraft/world/entity/Entity.java.patch
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
public boolean blocksBuilding;
@@ -201,8 +_,10 @@
public int tickCount;
private int remainingFireTicks = -this.getFireImmuneTicks();
protected boolean wasTouchingWater;
public int remainingFireTicks = -this.getFireImmuneTicks();
public boolean wasTouchingWater;
+ @Deprecated // Forge: Use forgeFluidTypeHeight instead
protected Object2DoubleMap<TagKey<Fluid>> fluidHeight = new Object2DoubleArrayMap<>(2);
protected boolean wasEyeInWater;
Expand Down
2 changes: 1 addition & 1 deletion patches/net/minecraft/world/entity/LivingEntity.java.patch
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
+ return PLAYER_NOT_WEARING_DISGUISE_ITEM_FOR_TARGET.test(p_379074_, null);
};
private final AttributeMap attributes;
private final CombatTracker combatTracker = new CombatTracker(this);
public CombatTracker combatTracker = new CombatTracker(this);
@@ -268,6 +_,14 @@
EquipmentSlot.class
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
+++ b/net/minecraft/world/entity/item/ItemEntity.java
@@ -49,6 +_,10 @@
@Nullable
private UUID target;
public UUID target;
public final float bobOffs;
+ /**
+ * The maximum age of this EntityItem. The item is expired once this is reached.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
@@ -24,18 +_,20 @@
import net.minecraft.world.level.ItemLike;

public final class Ingredient implements Predicate<ItemStack> {
public class Ingredient implements Predicate<ItemStack> {
- public static final StreamCodec<RegistryFriendlyByteBuf, Ingredient> CONTENTS_STREAM_CODEC = ByteBufCodecs.holderSet(Registries.ITEM)
- .map(Ingredient::new, p_360055_ -> p_360055_.values);
- public static final StreamCodec<RegistryFriendlyByteBuf, Optional<Ingredient>> OPTIONAL_CONTENTS_STREAM_CODEC = ByteBufCodecs.holderSet(Registries.ITEM)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
--- a/net/minecraft/world/level/block/SoundType.java
+++ b/net/minecraft/world/level/block/SoundType.java
@@ -789,6 +_,7 @@
private final SoundEvent hitSound;
public final SoundEvent hitSound;
private final SoundEvent fallSound;

+ @Deprecated // Forge: Use {@link net.neoforged.neoforge.common.util.DeferredSoundType} instead for suppliers
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
public static final int UNKNOWN_LIT_DURATION = 0;
+ private final RecipeType<? extends AbstractCookingRecipe> recipeType;
protected NonNullList<ItemStack> items = NonNullList.withSize(3, ItemStack.EMPTY);
int litTime;
public int litTime;
int litDuration = 0;
@@ -64,9 +_,14 @@
public int get(int p_58431_) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
+ @Deprecated // Neo: always use getType()
private final BlockEntityType<?> type;
@Nullable
protected Level level;
public Level level;
@@ -36,6 +_,8 @@
protected boolean remove;
private BlockState blockState;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
+ // TODO: forceBits-parametered setBits function. -C
private static final int MIN_PALETTE_BITS = 0;
private final PaletteResize<T> dummyPaletteResize = (p_238275_, p_238276_) -> 0;
private final IdMap<T> registry;
public final IdMap<T> registry;
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@
import net.minecraft.world.level.block.entity.SignBlockEntity;
import net.minecraft.world.level.block.entity.TrappedChestBlockEntity;
import net.minecraft.world.level.dimension.LevelStem;
import net.minecraftforge.fml.util.ObfuscationReflectionHelper;
import net.minecraftforge.registries.ForgeRegistries;
import net.neoforged.fml.util.ObfuscationReflectionHelper;
import org.bukkit.Art;
import org.bukkit.Fluid;
import org.bukkit.Material;
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/bukkit/Art.java
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ public enum Art implements Keyed {

private final int id, width, height;
private final NamespacedKey key;
public static final HashMap<String, Art> BY_NAME = Maps.newHashMap();
public static final HashMap<Integer, Art> BY_ID = Maps.newHashMap();
private static final HashMap<String, Art> BY_NAME = Maps.newHashMap();
private static final HashMap<Integer, Art> BY_ID = Maps.newHashMap();

private Art(int id, int width, int height) {
this.id = id;
Expand Down
13 changes: 5 additions & 8 deletions src/main/java/org/bukkit/Bukkit.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package org.bukkit;

import com.google.common.collect.ImmutableList;
import com.mohistmc.youer.Mohist;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.Serializable;
Expand Down Expand Up @@ -97,7 +96,7 @@ public static void setServer(@NotNull Server server) {
}

Bukkit.server = server;
server.getLogger().info("This server is running " + getName() + " version " + getVersion() + " (Implementing API version " + getBukkitVersion() + ", Forge version " + Mohist.versionInfo.forge() + ")");
server.getLogger().info("This server is running " + getName() + " version " + getVersion() + " (Implementing API version " + getBukkitVersion() + ")");
}

/**
Expand Down Expand Up @@ -634,7 +633,10 @@ public static int getTicksPerSpawns(@NotNull SpawnCategory spawnCategory) {
}

/**
* Gets a player object by the given username.
* Gets a player whose name matches the given name closest.
* <p>
* Use {@link #getPlayerExact(String)} to get the player matching the input exactly
* and {@link #matchPlayer(String)} if you want a list of all players matching the input.
* <p>
* This method may not return objects for offline players.
*
Expand Down Expand Up @@ -2149,9 +2151,4 @@ public static <T extends Keyed> Registry<T> getRegistry(@NotNull Class<T> tClass
public static UnsafeValues getUnsafe() {
return server.getUnsafe();
}

@NotNull
public static Server.Spigot spigot() {
return server.spigot();
}
}
Loading

0 comments on commit 808f072

Please sign in to comment.