This commit is contained in:
LexManos committed 2024-08-08 13:40:50 -07:00
1 parent 0ca1d0ebd0
commit db4d8a4729
8 files changed
+30 -28

No files matched your search

+4 -4
View File
@@ -5,13 +5,13 @@ org.gradle.daemon=false
org.gradle.parallel=true
JAVA_VERSION=21
MC_VERSION=1.21
MC_VERSION=1.21.1
MC_NEXT_VERSION=1.22
MCP_VERSION=20240613.102039
MCP_VERSION=20240808.132146
MAPPING_CHANNEL=official
MAPPING_VERSION=1.21
MAPPING_VERSION=1.21.1
// Set to true before the first build of a new MC version, so we don't do compatibility checks
CHECK_COMPATIBILITY=false
// Set to true to allow for fuzzy patching. Useful during updateing
UPDATING=false
UPDATING=true
@@ -1,10 +1,10 @@
--- a/net/minecraft/commands/arguments/EntityArgument.java
+++ b/net/minecraft/commands/arguments/EntityArgument.java
@@ -115,7 +_,7 @@
@@ -123,7 +_,7 @@
if (p_91482_.getSource() instanceof SharedSuggestionProvider sharedsuggestionprovider) {
StringReader stringreader = new StringReader(p_91483_.getInput());
stringreader.setCursor(p_91483_.getStart());
- EntitySelectorParser entityselectorparser = new EntitySelectorParser(stringreader, sharedsuggestionprovider.hasPermission(2));
- EntitySelectorParser entityselectorparser = new EntitySelectorParser(stringreader, EntitySelectorParser.allowSelectors(sharedsuggestionprovider));
+ EntitySelectorParser entityselectorparser = new EntitySelectorParser(stringreader, net.minecraftforge.common.ForgeHooks.canUseEntitySelectors(sharedsuggestionprovider));
try {
@@ -1,10 +1,10 @@
--- a/net/minecraft/commands/arguments/MessageArgument.java
+++ b/net/minecraft/commands/arguments/MessageArgument.java
@@ -84,7 +_,7 @@
@@ -89,7 +_,7 @@
public static record Message(String text, MessageArgument.Part[] parts) {
Component resolveComponent(CommandSourceStack p_232197_) throws CommandSyntaxException {
- return this.toComponent(p_232197_, p_232197_.hasPermission(2));
- return this.toComponent(p_232197_, EntitySelectorParser.allowSelectors(p_232197_));
+ return this.toComponent(p_232197_, net.minecraftforge.common.ForgeHooks.canUseEntitySelectors(p_232197_));
}
@@ -1,6 +1,6 @@
--- a/net/minecraft/commands/arguments/selector/EntitySelectorParser.java
+++ b/net/minecraft/commands/arguments/selector/EntitySelectorParser.java
@@ -472,6 +_,11 @@
@@ -477,6 +_,11 @@
}
this.reader.skip();
@@ -12,7 +12,7 @@
this.parseSelector();
} else {
this.parseNameOrUUID();
@@ -488,6 +_,7 @@
@@ -493,6 +_,7 @@
p_121248_.suggest("@s", Component.translatable("argument.entity.selector.self"));
p_121248_.suggest("@e", Component.translatable("argument.entity.selector.allEntities"));
p_121248_.suggest("@n", Component.translatable("argument.entity.selector.nearestEntity"));
@@ -1,6 +1,6 @@
--- a/net/minecraft/world/level/block/SculkSensorBlock.java
+++ b/net/minecraft/world/level/block/SculkSensorBlock.java
@@ -294,8 +_,13 @@
@@ -293,8 +_,13 @@
@Override
protected void spawnAfterBreak(BlockState p_222142_, ServerLevel p_222143_, BlockPos p_222144_, ItemStack p_222145_, boolean p_222146_) {
super.spawnAfterBreak(p_222142_, p_222143_, p_222144_, p_222145_, p_222146_);
@@ -9,19 +9,20 @@
private static final Logger LOGGER = LogUtils.getLogger();
private final BlockEntityType<?> type;
@Nullable
@@ -38,9 +_,11 @@
@@ -38,10 +_,12 @@
private DataComponentMap components = DataComponentMap.EMPTY;
public BlockEntity(BlockEntityType<?> p_155228_, BlockPos p_155229_, BlockState p_155230_) {
+ super(BlockEntity.class);
this.type = p_155228_;
this.worldPosition = p_155229_.immutable();
this.validateBlockState(p_155230_);
this.blockState = p_155230_;
+ this.gatherCapabilities();
}
public static BlockPos getPosFromTag(CompoundTag p_187473_) {
@@ -61,6 +_,7 @@
private void validateBlockState(BlockState p_345558_) {
@@ -72,6 +_,7 @@
}
protected void loadAdditional(CompoundTag p_331149_, HolderLookup.Provider p_333170_) {
@@ -29,7 +30,7 @@
}
public final void loadWithComponents(CompoundTag p_331756_, HolderLookup.Provider p_335164_) {
@@ -76,6 +_,7 @@
@@ -87,6 +_,7 @@
}
protected void saveAdditional(CompoundTag p_187471_, HolderLookup.Provider p_327783_) {
@@ -37,7 +38,7 @@
}
public final CompoundTag saveWithFullMetadata(HolderLookup.Provider p_331193_) {
@@ -205,6 +_,13 @@
@@ -216,6 +_,13 @@
public void setRemoved() {
this.remove = true;
@@ -34,7 +34,7 @@
p_62866_.onPlace(this.level, p_62865_, blockstate, p_62867_);
}
@@ -321,6 +_,12 @@
@@ -326,6 +_,12 @@
@Nullable
public BlockEntity getBlockEntity(BlockPos p_62868_, LevelChunk.EntityCreationType p_62869_) {
BlockEntity blockentity = this.blockEntities.get(p_62868_);
@@ -47,7 +47,7 @@
if (blockentity == null) {
CompoundTag compoundtag = this.pendingBlockEntities.remove(p_62868_);
if (compoundtag != null) {
@@ -338,9 +_,6 @@
@@ -343,9 +_,6 @@
this.addAndRegisterBlockEntity(blockentity);
}
}
@@ -57,7 +57,7 @@
}
return blockentity;
@@ -354,6 +_,7 @@
@@ -359,6 +_,7 @@
}
this.updateBlockEntityTicker(p_156391_);
@@ -65,7 +65,7 @@
}
}
@@ -406,9 +_,14 @@
@@ -411,9 +_,14 @@
public CompoundTag getBlockEntityNbtForSaving(BlockPos p_62932_, HolderLookup.Provider p_329605_) {
BlockEntity blockentity = this.getBlockEntity(p_62932_);
if (blockentity != null && !blockentity.isRemoved()) {
@@ -80,7 +80,7 @@
} else {
CompoundTag compoundtag = this.pendingBlockEntities.get(p_62932_);
if (compoundtag != null) {
@@ -488,7 +_,7 @@
@@ -493,7 +_,7 @@
p_187974_.accept((p_327409_, p_327410_, p_327411_) -> {
BlockEntity blockentity = this.getBlockEntity(p_327409_, LevelChunk.EntityCreationType.IMMEDIATE);
if (blockentity != null && p_327411_ != null && blockentity.getType() == p_327410_) {
@@ -89,7 +89,7 @@
}
});
}
@@ -596,6 +_,7 @@
@@ -601,6 +_,7 @@
}
public void clearAllBlockEntities() {
@@ -97,7 +97,7 @@
this.blockEntities.values().forEach(BlockEntity::setRemoved);
this.blockEntities.clear();
this.tickersInLevel.values().forEach(p_187966_ -> p_187966_.rebind(NULL_TICKER));
@@ -603,6 +_,7 @@
@@ -608,6 +_,7 @@
}
public void registerAllBlockEntitiesAfterLevelLoad() {
@@ -105,7 +105,7 @@
this.blockEntities.values().forEach(p_187988_ -> {
if (this.level instanceof ServerLevel serverlevel) {
this.addGameEventListener(p_187988_, serverlevel);
@@ -654,6 +_,24 @@
@@ -659,6 +_,24 @@
return new LevelChunk.BoundTickingBlockEntity<>(p_156376_, p_156377_);
}
@@ -130,7 +130,7 @@
class BoundTickingBlockEntity<T extends BlockEntity> implements TickingBlockEntity {
private final T blockEntity;
private final BlockEntityTicker<T> ticker;
@@ -671,6 +_,7 @@
@@ -676,6 +_,7 @@
if (LevelChunk.this.isTicking(blockpos)) {
try {
ProfilerFiller profilerfiller = LevelChunk.this.level.getProfiler();
@@ -138,7 +138,7 @@
profilerfiller.push(this::getType);
BlockState blockstate = LevelChunk.this.getBlockState(blockpos);
if (this.blockEntity.getType().isValid(blockstate)) {
@@ -692,6 +_,11 @@
@@ -697,6 +_,11 @@
CrashReport crashreport = CrashReport.forThrowable(throwable, "Ticking block entity");
CrashReportCategory crashreportcategory = crashreport.addCategory("Block entity being ticked");
this.blockEntity.fillCrashReportCategory(crashreportcategory);
@@ -150,7 +150,7 @@
throw new ReportedException(crashreport);
}
}
@@ -765,5 +_,32 @@
@@ -770,5 +_,32 @@
public String toString() {
return this.ticker + " <wrapped>";
}
@@ -42,6 +42,7 @@ import it.unimi.dsi.fastutil.objects.ObjectArrayList;
import net.minecraft.commands.CommandSourceStack;
import net.minecraft.commands.Commands;
import net.minecraft.commands.SharedSuggestionProvider;
import net.minecraft.commands.arguments.selector.EntitySelectorParser;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.core.Holder;
@@ -1003,7 +1004,7 @@ public final class ForgeHooks {
}
public static boolean canUseEntitySelectors(SharedSuggestionProvider provider) {
if (provider.hasPermission(Commands.LEVEL_GAMEMASTERS))
if (EntitySelectorParser.allowSelectors(provider))
return true;
else if (provider instanceof CommandSourceStack source && source.source instanceof ServerPlayer player)
return PermissionAPI.getPermission(player, ForgeMod.USE_SELECTORS_PERMISSION);