mc 26.1-snap-1

This commit is contained in:
gnembon committed 2025-12-17 17:05:15 +01:00
1 parent 4e160d235a
commit be1211dda7
24 files changed
+61 -60

No files matched your search

+5 -6
View File
@@ -1,5 +1,5 @@
plugins { plugins {
id 'fabric-loom' version '1.13-SNAPSHOT' id 'net.fabricmc.fabric-loom' version "${loom_version}"
id 'maven-publish' id 'maven-publish'
} }
@@ -18,8 +18,7 @@ loom {
dependencies { dependencies {
// To change the versions see the gradle.properties file // To change the versions see the gradle.properties file
minecraft "com.mojang:minecraft:${project.minecraft_version}" minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings loom.officialMojangMappings() implementation "net.fabricmc:fabric-loader:${project.loader_version}"
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
// Fabric API. This is technically optional, but you probably want it anyway. // Fabric API. This is technically optional, but you probably want it anyway.
//modImplementation "net.fabricmc:fabric:${project.fabric_version}" //modImplementation "net.fabricmc:fabric:${project.fabric_version}"
@@ -43,7 +42,7 @@ tasks.withType(JavaCompile).configureEach {
it.options.encoding = "UTF-8" it.options.encoding = "UTF-8"
// Minecraft 1.20.5 upwards uses Java 21. // Minecraft 1.20.5 upwards uses Java 21.
it.options.release = 21 it.options.release = 25
} }
java { java {
@@ -52,8 +51,8 @@ java {
// If you remove this line, sources will not be generated. // If you remove this line, sources will not be generated.
withSourcesJar() withSourcesJar()
sourceCompatibility = JavaVersion.VERSION_21 sourceCompatibility = JavaVersion.VERSION_25
targetCompatibility = JavaVersion.VERSION_21 targetCompatibility = JavaVersion.VERSION_25
} }
jar { jar {
+4 -5
View File
@@ -7,10 +7,9 @@ org.gradle.configuration-cache=false
# Fabric Properties # Fabric Properties
# check https://fabricmc.net/develop/ # check https://fabricmc.net/develop/
minecraft_version=1.21.11 minecraft_version=26.1-snapshot-1
loader_version=0.18.2 loader_version=0.18.3
jsr305_version=3.0.2 loom_version=1.14-SNAPSHOT
fabric_version=0.134.0+1.21.9
# Mod Properties # Mod Properties
mod_version = 1.4.193 mod_version = 1.4.193
@@ -21,7 +20,7 @@ org.gradle.configuration-cache=false
# The Curseforge versions "names" or ids for the main branch (comma separated: 1.16.4,1.16.5) # The Curseforge versions "names" or ids for the main branch (comma separated: 1.16.4,1.16.5)
# This is needed because CF uses too vague names for prereleases and release candidates # This is needed because CF uses too vague names for prereleases and release candidates
# Can also be the version ID directly coming from https://minecraft.curseforge.com/api/game/versions?token=[API_TOKEN] # Can also be the version ID directly coming from https://minecraft.curseforge.com/api/game/versions?token=[API_TOKEN]
release-curse-versions = Minecraft 1.21:1.21.11 release-curse-versions = Minecraft 26:26.1-Snapshot
# Whether or not to build another branch on release # Whether or not to build another branch on release
release-extra-branch = false release-extra-branch = false
# The name of the second branch to release # The name of the second branch to release
+1 -1
View File
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-9.1.0-bin.zip distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.1-bin.zip
networkTimeout=10000 networkTimeout=10000
validateDistributionUrl=true validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
@@ -75,10 +75,10 @@ public interface FertilizableCoral extends BonemealableBlock {
} }
else else
{ {
if (worldIn.random.nextInt(10) == 0) if (worldIn.getRandom().nextInt(10) == 0)
{ {
BlockPos randomPos = pos.offset(worldIn.random.nextInt(16) - 8, worldIn.random.nextInt(8), worldIn.random.nextInt(16) - 8); BlockPos randomPos = pos.offset(worldIn.getRandom().nextInt(16) - 8, worldIn.getRandom().nextInt(8), worldIn.getRandom().nextInt(16) - 8);
if (coralBlocks.contains(worldIn.getBlockState(randomPos).getBlockHolder())) if (worldIn.getBlockState(randomPos).is(BlockTags.CORAL_BLOCKS))
{ {
worldIn.setBlock(randomPos, Blocks.WET_SPONGE.defaultBlockState(), Block.UPDATE_ALL); worldIn.setBlock(randomPos, Blocks.WET_SPONGE.defaultBlockState(), Block.UPDATE_ALL);
} }
@@ -133,7 +133,7 @@ public class OptimizedExplosion
double xInc = (xRel / len) * 0.3; double xInc = (xRel / len) * 0.3;
double yInc = (yRel / len) * 0.3; double yInc = (yRel / len) * 0.3;
double zInc = (zRel / len) * 0.3; double zInc = (zRel / len) * 0.3;
float rand = eAccess.getLevel().random.nextFloat(); float rand = eAccess.getLevel().getRandom().nextFloat();
float sizeRand = (CarpetSettings.tntRandomRange >= 0 ? (float) CarpetSettings.tntRandomRange : rand); float sizeRand = (CarpetSettings.tntRandomRange >= 0 ? (float) CarpetSettings.tntRandomRange : rand);
float size = eAccess.getRadius() * (0.7F + sizeRand * 0.6F); float size = eAccess.getRadius() * (0.7F + sizeRand * 0.6F);
Vec3 vec3 = eAccess.getCenter(); Vec3 vec3 = eAccess.getCenter();
@@ -22,7 +22,7 @@ public class ParticleDisplay
Vec3 incvec = to.subtract(from).normalize();// multiply(50/sqrt(lineLengthSq)); Vec3 incvec = to.subtract(from).normalize();// multiply(50/sqrt(lineLengthSq));
for (Vec3 delta = new Vec3(0.0,0.0,0.0); for (Vec3 delta = new Vec3(0.0,0.0,0.0);
delta.lengthSqr() < lineLengthSq; delta.lengthSqr() < lineLengthSq;
delta = delta.add(incvec.scale(player.level().random.nextFloat()))) delta = delta.add(incvec.scale(player.level().getRandom().nextFloat())))
{ {
player.level().sendParticles( player.level().sendParticles(
player, player,
@@ -14,7 +14,7 @@ import java.util.List;
import net.minecraft.server.level.ServerPlayer; import net.minecraft.server.level.ServerPlayer;
import net.minecraft.world.entity.player.Player; import net.minecraft.world.entity.player.Player;
import net.minecraft.world.inventory.AbstractContainerMenu; import net.minecraft.world.inventory.AbstractContainerMenu;
import net.minecraft.world.inventory.ClickType; import net.minecraft.world.inventory.ContainerInput;
import net.minecraft.world.inventory.ContainerListener; import net.minecraft.world.inventory.ContainerListener;
import net.minecraft.world.inventory.DataSlot; import net.minecraft.world.inventory.DataSlot;
@@ -26,7 +26,7 @@ public abstract class AbstractContainerMenu_scarpetMixin implements AbstractCont
@Shadow @Final private List<DataSlot> dataSlots; @Shadow @Final private List<DataSlot> dataSlots;
@Inject(method = "doClick", at = @At("HEAD"), cancellable = true) @Inject(method = "doClick", at = @At("HEAD"), cancellable = true)
private void callSlotClickListener(int slotIndex, int button, ClickType actionType, Player player, CallbackInfo ci) { private void callSlotClickListener(int slotIndex, int button, ContainerInput actionType, Player player, CallbackInfo ci) {
if(!(player instanceof ServerPlayer serverPlayerEntity)) return; if(!(player instanceof ServerPlayer serverPlayerEntity)) return;
for(ContainerListener screenHandlerListener : this.containerListeners) { for(ContainerListener screenHandlerListener : this.containerListeners) {
if(screenHandlerListener instanceof ScreenValue.ScarpetScreenHandlerListener scarpetScreenHandlerListener) { if(screenHandlerListener instanceof ScreenValue.ScarpetScreenHandlerListener scarpetScreenHandlerListener) {
@@ -31,10 +31,10 @@ public abstract class ArmorStand_scarpetMarkerMixin extends LivingEntity
{ {
if (!level().isClientSide()) if (!level().isClientSide())
{ {
if (getTags().contains(Auxiliary.MARKER_STRING)) if (entityTags().contains(Auxiliary.MARKER_STRING))
{ {
String prefix = Auxiliary.MARKER_STRING+"_"; String prefix = Auxiliary.MARKER_STRING+"_";
Optional<String> owner = getTags().stream().filter(s -> s.startsWith(prefix)).findFirst(); Optional<String> owner = entityTags().stream().filter(s -> s.startsWith(prefix)).findFirst();
if (owner.isPresent()) if (owner.isPresent())
{ {
String hostName = StringUtils.removeStart(owner.get(),prefix); String hostName = StringUtils.removeStart(owner.get(),prefix);
@@ -11,7 +11,7 @@ import net.minecraft.world.level.levelgen.structure.pieces.PieceGeneratorSupplie
@Mixin(PieceGeneratorSupplier.class) @Mixin(PieceGeneratorSupplier.class)
public interface PieceGeneratorSupplier_plopMixin public interface PieceGeneratorSupplier_plopMixin
{ {
@Redirect(method = "method_39845", at = @At( @Redirect(method = "lambda$simple$0", at = @At(
value = "INVOKE", value = "INVOKE",
target = "java/util/function/Predicate.test(Ljava/lang/Object;)Z" target = "java/util/function/Predicate.test(Ljava/lang/Object;)Z"
), remap = false) ), remap = false)
@@ -11,9 +11,9 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
@Mixin(ReloadCommand.class) @Mixin(ReloadCommand.class)
public class ReloadCommand_reloadAppsMixin { public class ReloadCommand_reloadAppsMixin {
//method_13530(Lcom/mojang/brigadier/context/CommandContext;)I //lambda$register$0(Lcom/mojang/brigadier/context/CommandContext;)I
// internal of register. // internal of register.
@Inject(method = "method_13530", at = @At("TAIL"), remap = false) @Inject(method = "lambda$register$0", at = @At("TAIL"), remap = false)
private static void onReload(CommandContext<CommandSourceStack> context, CallbackInfoReturnable<Integer> cir) private static void onReload(CommandContext<CommandSourceStack> context, CallbackInfoReturnable<Integer> cir)
{ {
// can't fetch here the reference to the server // can't fetch here the reference to the server
@@ -280,7 +280,7 @@ public class ServerGamePacketListenerImpl_scarpetEventsMixin
} }
} }
@Inject(method = "method_44356", // lambda of handleChatCommand(ServerboundChatCommandPacket) @Inject(method = "lambda$handleChatCommand$0", // lambda of handleChatCommand(ServerboundChatCommandPacket)
at = @At(value = "HEAD") at = @At(value = "HEAD")
) )
private void onChatCommandMessage(ServerboundChatCommandPacket serverboundChatCommandPacket, CallbackInfo ci) { private void onChatCommandMessage(ServerboundChatCommandPacket serverboundChatCommandPacket, CallbackInfo ci) {
@@ -30,7 +30,7 @@ public class SummonCommand_lightningMixin
ServerLevel world = (ServerLevel) entity.level(); ServerLevel world = (ServerLevel) entity.level();
BlockPos at = entity.blockPosition(); BlockPos at = entity.blockPosition();
DifficultyInstance localDifficulty_1 = world.getCurrentDifficultyAt(at); DifficultyInstance localDifficulty_1 = world.getCurrentDifficultyAt(at);
boolean boolean_2 = world.getGameRules().get(GameRules.SPAWN_MOBS) && world.random.nextDouble() < (double)localDifficulty_1.getEffectiveDifficulty() * 0.01D; boolean boolean_2 = world.getGameRules().get(GameRules.SPAWN_MOBS) && world.getRandom().nextDouble() < (double)localDifficulty_1.getEffectiveDifficulty() * 0.01D;
if (boolean_2) { if (boolean_2) {
SkeletonHorse skeletonHorseEntity_1 = EntityType.SKELETON_HORSE.create(world, EntitySpawnReason.EVENT); SkeletonHorse skeletonHorseEntity_1 = EntityType.SKELETON_HORSE.create(world, EntitySpawnReason.EVENT);
skeletonHorseEntity_1.setTrap(true); skeletonHorseEntity_1.setTrap(true);
@@ -961,7 +961,7 @@ public class CarpetScriptHost extends ScriptHost
String markerName = Auxiliary.MARKER_STRING + "_" + ((getName() == null) ? "" : getName()); String markerName = Auxiliary.MARKER_STRING + "_" + ((getName() == null) ? "" : getName());
for (ServerLevel world : scriptServer().server.getAllLevels()) for (ServerLevel world : scriptServer().server.getAllLevels())
{ {
for (Entity e : world.getEntities(EntityType.ARMOR_STAND, (as) -> as.getTags().contains(markerName))) for (Entity e : world.getEntities(EntityType.ARMOR_STAND, (as) -> as.entityTags().contains(markerName)))
{ {
e.discard(); e.discard();
} }
@@ -1109,7 +1109,7 @@ public class CarpetScriptHost extends ScriptHost
} }
/** /**
* <p>Creates a {@link Component} using {@link Messenger} that has the locals in the {@code line} snippet with a hover over * <p>Creates a {@link Component} using {@link carper.utils.Messenger} that has the locals in the {@code line} snippet with a hover over
* tooltip with the value of the local at that location</p> * tooltip with the value of the local at that location</p>
* *
* @param line The line to find references to locals on * @param line The line to find references to locals on
@@ -434,7 +434,7 @@ public class Auxiliary
CarpetContext cc = (CarpetContext) c; CarpetContext cc = (CarpetContext) c;
int total = 0; int total = 0;
String markerName = MARKER_STRING + "_" + ((cc.host.getName() == null) ? "" : cc.host.getName()); String markerName = MARKER_STRING + "_" + ((cc.host.getName() == null) ? "" : cc.host.getName());
for (Entity e : cc.level().getEntities(EntityType.ARMOR_STAND, as -> as.getTags().contains(markerName))) for (Entity e : cc.level().getEntities(EntityType.ARMOR_STAND, as -> as.entityTags().contains(markerName)))
{ {
total++; total++;
e.discard(); e.discard();
@@ -703,7 +703,7 @@ public class WorldAccess
booleanStateTest(c, "block_tick", lv, (s, p) -> booleanStateTest(c, "block_tick", lv, (s, p) ->
{ {
ServerLevel w = ((CarpetContext) c).level(); ServerLevel w = ((CarpetContext) c).level();
s.randomTick(w, p, w.random); s.randomTick(w, p, w.getRandom());
return true; return true;
})); }));
@@ -713,7 +713,7 @@ public class WorldAccess
ServerLevel w = ((CarpetContext) c).level(); ServerLevel w = ((CarpetContext) c).level();
if (s.isRandomlyTicking() || s.getFluidState().isRandomlyTicking()) if (s.isRandomlyTicking() || s.getFluidState().isRandomlyTicking())
{ {
s.randomTick(w, p, w.random); s.randomTick(w, p, w.getRandom());
} }
return true; return true;
})); }));
@@ -89,7 +89,7 @@ public class FeatureGenerator
checks.set(true); checks.set(true);
try try
{ {
return configuredFeature.place(world, world.getChunkSource().getGenerator(), world.random, pos); return configuredFeature.place(world, world.getChunkSource().getGenerator(), world.getRandom(), pos);
} }
finally finally
{ {
@@ -115,7 +115,7 @@ public class FeatureGenerator
checks.set(true); checks.set(true);
try try
{ {
return configuredStandard.place(world, world.getChunkSource().getGenerator(), world.random, pos); return configuredStandard.place(world, world.getChunkSource().getGenerator(), world.getRandom(), pos);
} }
finally finally
{ {
@@ -161,7 +161,7 @@ public class FeatureGenerator
checks.set(true); checks.set(true);
try try
{ {
return feature.place(w, w.getChunkSource().getGenerator(), w.random, p); return feature.place(w, w.getChunkSource().getGenerator(), w.getRandom(), p);
} }
finally finally
{ {
@@ -2245,7 +2245,7 @@ public class ShapeDispatcher
int pcount = 0; int pcount = 0;
if (distance < 100) if (distance < 100)
{ {
RandomSource rand = players.get(0).level().random; RandomSource rand = players.get(0).level().getRandom();
int particles = (int) (distance / density) + 1; int particles = (int) (distance / density) + 1;
Vec3 towards = to.subtract(from); Vec3 towards = to.subtract(from);
for (int i = 0; i < particles; i++) for (int i = 0; i < particles; i++)
@@ -26,7 +26,6 @@ import net.minecraft.client.gui.Font;
import net.minecraft.client.gui.components.debug.DebugScreenEntries; import net.minecraft.client.gui.components.debug.DebugScreenEntries;
import net.minecraft.client.multiplayer.ClientLevel; import net.minecraft.client.multiplayer.ClientLevel;
import net.minecraft.client.renderer.ItemBlockRenderTypes; import net.minecraft.client.renderer.ItemBlockRenderTypes;
import net.minecraft.client.renderer.LightTexture;
import net.minecraft.client.renderer.MultiBufferSource; import net.minecraft.client.renderer.MultiBufferSource;
import net.minecraft.client.renderer.RenderBuffers; import net.minecraft.client.renderer.RenderBuffers;
import net.minecraft.client.renderer.rendertype.RenderType; import net.minecraft.client.renderer.rendertype.RenderType;
@@ -43,6 +42,7 @@ import net.minecraft.core.Direction;
import net.minecraft.nbt.CompoundTag; import net.minecraft.nbt.CompoundTag;
import net.minecraft.nbt.ListTag; import net.minecraft.nbt.ListTag;
import net.minecraft.resources.ResourceKey; import net.minecraft.resources.ResourceKey;
import net.minecraft.util.LightCoordsUtil;
import net.minecraft.util.Mth; import net.minecraft.util.Mth;
import net.minecraft.util.ProblemReporter; import net.minecraft.util.ProblemReporter;
import net.minecraft.world.item.ItemDisplayContext; import net.minecraft.world.item.ItemDisplayContext;
@@ -406,7 +406,7 @@ public class ShapesRenderer
int light = 0; int light = 0;
if (client.level != null) if (client.level != null)
{ {
light = LightTexture.pack( light = LightCoordsUtil.pack(
shape.blockLight < 0 ? client.level.getBrightness(LightLayer.BLOCK, blockPos) : shape.blockLight, shape.blockLight < 0 ? client.level.getBrightness(LightLayer.BLOCK, blockPos) : shape.blockLight,
shape.skyLight < 0 ? client.level.getBrightness(LightLayer.SKY, blockPos) : shape.skyLight shape.skyLight < 0 ? client.level.getBrightness(LightLayer.SKY, blockPos) : shape.skyLight
); );
@@ -92,6 +92,7 @@ import java.util.Set;
import java.util.UUID; import java.util.UUID;
import java.util.function.BiConsumer; import java.util.function.BiConsumer;
import java.util.function.BiFunction; import java.util.function.BiFunction;
import java.util.function.BiPredicate;
import java.util.function.Predicate; import java.util.function.Predicate;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import java.util.stream.Stream; import java.util.stream.Stream;
@@ -297,6 +298,8 @@ public class EntityValue extends Value
public static final Map<String, EntityClassDescriptor> byName = new HashMap<>() public static final Map<String, EntityClassDescriptor> byName = new HashMap<>()
{{ {{
List<EntityType<?>> allTypes = BuiltInRegistries.ENTITY_TYPE.stream().toList(); List<EntityType<?>> allTypes = BuiltInRegistries.ENTITY_TYPE.stream().toList();
BiPredicate<EntityType<?>, TagKey<EntityType<?>>> is = (type, tag) -> type.builtInRegistryHolder().is(tag);
// nonliving types // nonliving types
Set<EntityType<?>> projectiles = Set.of( Set<EntityType<?>> projectiles = Set.of(
EntityType.ARROW, EntityType.DRAGON_FIREBALL, EntityType.FIREWORK_ROCKET, EntityType.ARROW, EntityType.DRAGON_FIREBALL, EntityType.FIREWORK_ROCKET,
@@ -340,7 +343,7 @@ public class EntityValue extends Value
); );
Set<EntityType<?>> living = allTypes.stream().filter(et -> Set<EntityType<?>> living = allTypes.stream().filter(et ->
!deads.contains(et) && !projectiles.contains(et) && !minecarts.contains(et) && !et.is(EntityTypeTags.BOAT) !deads.contains(et) && !projectiles.contains(et) && !minecarts.contains(et) && !is.test(et, EntityTypeTags.BOAT)
).collect(Collectors.toSet()); ).collect(Collectors.toSet());
Set<EntityType<?>> regular = allTypes.stream().filter(et -> Set<EntityType<?>> regular = allTypes.stream().filter(et ->
@@ -364,17 +367,17 @@ public class EntityValue extends Value
// combat groups // combat groups
put("arthropod", new EntityClassDescriptor(EntityTypeTest.forClass(LivingEntity.class), e -> (e.getType().is(EntityTypeTags.ARTHROPOD) && e.isAlive()), allTypes.stream().filter(arthropods::contains))); put("arthropod", new EntityClassDescriptor(EntityTypeTest.forClass(LivingEntity.class), e -> (is.test(e.getType(), EntityTypeTags.ARTHROPOD) && e.isAlive()), allTypes.stream().filter(arthropods::contains)));
put("!arthropod", new EntityClassDescriptor(EntityTypeTest.forClass(LivingEntity.class), e -> (!e.getType().is(EntityTypeTags.ARTHROPOD) && e.isAlive()), allTypes.stream().filter(et -> !arthropods.contains(et) && living.contains(et)))); put("!arthropod", new EntityClassDescriptor(EntityTypeTest.forClass(LivingEntity.class), e -> (!is.test(e.getType(), EntityTypeTags.ARTHROPOD) && e.isAlive()), allTypes.stream().filter(et -> !arthropods.contains(et) && living.contains(et))));
put("undead", new EntityClassDescriptor(EntityTypeTest.forClass(LivingEntity.class), e -> (e.getType().is(EntityTypeTags.UNDEAD) && e.isAlive()), allTypes.stream().filter(undeads::contains))); put("undead", new EntityClassDescriptor(EntityTypeTest.forClass(LivingEntity.class), e -> (is.test(e.getType(), EntityTypeTags.UNDEAD) && e.isAlive()), allTypes.stream().filter(undeads::contains)));
put("!undead", new EntityClassDescriptor(EntityTypeTest.forClass(LivingEntity.class), e -> (!e.getType().is(EntityTypeTags.UNDEAD) && e.isAlive()), allTypes.stream().filter(et -> !undeads.contains(et) && living.contains(et)))); put("!undead", new EntityClassDescriptor(EntityTypeTest.forClass(LivingEntity.class), e -> (!is.test(e.getType(), EntityTypeTags.UNDEAD) && e.isAlive()), allTypes.stream().filter(et -> !undeads.contains(et) && living.contains(et))));
put("aquatic", new EntityClassDescriptor(EntityTypeTest.forClass(LivingEntity.class), e -> (e.getType().is(EntityTypeTags.AQUATIC) && e.isAlive()), allTypes.stream().filter(aquatique::contains))); put("aquatic", new EntityClassDescriptor(EntityTypeTest.forClass(LivingEntity.class), e -> (is.test(e.getType(), EntityTypeTags.AQUATIC) && e.isAlive()), allTypes.stream().filter(aquatique::contains)));
put("!aquatic", new EntityClassDescriptor(EntityTypeTest.forClass(LivingEntity.class), e -> (!e.getType().is(EntityTypeTags.AQUATIC) && e.isAlive()), allTypes.stream().filter(et -> !aquatique.contains(et) && living.contains(et)))); put("!aquatic", new EntityClassDescriptor(EntityTypeTest.forClass(LivingEntity.class), e -> (!is.test(e.getType(), EntityTypeTags.AQUATIC) && e.isAlive()), allTypes.stream().filter(et -> !aquatique.contains(et) && living.contains(et))));
put("illager", new EntityClassDescriptor(EntityTypeTest.forClass(LivingEntity.class), e -> (e.getType().is(EntityTypeTags.ILLAGER) && e.isAlive()), allTypes.stream().filter(illagers::contains))); put("illager", new EntityClassDescriptor(EntityTypeTest.forClass(LivingEntity.class), e -> (is.test(e.getType(), EntityTypeTags.ILLAGER) && e.isAlive()), allTypes.stream().filter(illagers::contains)));
put("!illager", new EntityClassDescriptor(EntityTypeTest.forClass(LivingEntity.class), e -> (!e.getType().is(EntityTypeTags.ILLAGER) && e.isAlive()), allTypes.stream().filter(et -> !illagers.contains(et) && living.contains(et)))); put("!illager", new EntityClassDescriptor(EntityTypeTest.forClass(LivingEntity.class), e -> (!is.test(e.getType(), EntityTypeTags.ILLAGER) && e.isAlive()), allTypes.stream().filter(et -> !illagers.contains(et) && living.contains(et))));
put("regular", new EntityClassDescriptor(EntityTypeTest.forClass(LivingEntity.class), e -> { put("regular", new EntityClassDescriptor(EntityTypeTest.forClass(LivingEntity.class), e -> {
EntityType<?> type = e.getType(); EntityType<?> type = e.getType();
@@ -457,17 +460,17 @@ public class EntityValue extends Value
put("mount", (e, a) -> (e.getVehicle() != null) ? new EntityValue(e.getVehicle()) : Value.NULL); put("mount", (e, a) -> (e.getVehicle() != null) ? new EntityValue(e.getVehicle()) : Value.NULL);
put("unmountable", (e, a) -> BooleanValue.of(Vanilla.Entity_isPermanentVehicle(e))); put("unmountable", (e, a) -> BooleanValue.of(Vanilla.Entity_isPermanentVehicle(e)));
// deprecated // deprecated
put("tags", (e, a) -> ListValue.wrap(e.getTags().stream().map(StringValue::new))); put("tags", (e, a) -> ListValue.wrap(e.entityTags().stream().map(StringValue::new)));
put("scoreboard_tags", (e, a) -> ListValue.wrap(e.getTags().stream().map(StringValue::new))); put("scoreboard_tags", (e, a) -> ListValue.wrap(e.entityTags().stream().map(StringValue::new)));
put("entity_tags", (e, a) -> { put("entity_tags", (e, a) -> {
EntityType<?> type = e.getType(); EntityType<?> type = e.getType();
return ListValue.wrap(e.level().getServer().registryAccess().lookupOrThrow(Registries.ENTITY_TYPE).getTags().filter(entry -> entry.stream().anyMatch(h -> h.value() == type)).map(entry -> ValueConversions.of(entry))); return ListValue.wrap(e.level().getServer().registryAccess().lookupOrThrow(Registries.ENTITY_TYPE).getTags().filter(entry -> entry.stream().anyMatch(h -> h.value() == type)).map(entry -> ValueConversions.of(entry)));
}); });
// deprecated // deprecated
put("has_tag", (e, a) -> BooleanValue.of(e.getTags().contains(a.getString()))); put("has_tag", (e, a) -> BooleanValue.of(e.entityTags().contains(a.getString())));
put("has_scoreboard_tag", (e, a) -> BooleanValue.of(e.getTags().contains(a.getString()))); put("has_scoreboard_tag", (e, a) -> BooleanValue.of(e.entityTags().contains(a.getString())));
put("has_entity_tag", (e, a) -> { put("has_entity_tag", (e, a) -> {
Optional<HolderSet.Named<EntityType<?>>> tag = e.level().getServer().registryAccess().lookupOrThrow(Registries.ENTITY_TYPE).get(TagKey.create(Registries.ENTITY_TYPE, InputValidator.identifierOf(a.getString()))); Optional<HolderSet.Named<EntityType<?>>> tag = e.level().getServer().registryAccess().lookupOrThrow(Registries.ENTITY_TYPE).get(TagKey.create(Registries.ENTITY_TYPE, InputValidator.identifierOf(a.getString())));
if (tag.isEmpty()) if (tag.isEmpty())
@@ -211,7 +211,7 @@ public class NBTSerializableValue extends Value implements ContainerValueInterfa
); );
if (!list.isEmpty()) if (!list.isEmpty())
{ {
inventory = (Container) list.get(world.random.nextInt(list.size())); inventory = (Container) list.get(world.getRandom().nextInt(list.size()));
} }
} }
@@ -39,7 +39,7 @@ import net.minecraft.world.inventory.BlastFurnaceMenu;
import net.minecraft.world.inventory.BrewingStandMenu; import net.minecraft.world.inventory.BrewingStandMenu;
import net.minecraft.world.inventory.CartographyTableMenu; import net.minecraft.world.inventory.CartographyTableMenu;
import net.minecraft.world.inventory.ChestMenu; import net.minecraft.world.inventory.ChestMenu;
import net.minecraft.world.inventory.ClickType; import net.minecraft.world.inventory.ContainerInput;
import net.minecraft.world.inventory.ContainerListener; import net.minecraft.world.inventory.ContainerListener;
import net.minecraft.world.inventory.CraftingMenu; import net.minecraft.world.inventory.CraftingMenu;
import net.minecraft.world.inventory.DataSlot; import net.minecraft.world.inventory.DataSlot;
@@ -226,11 +226,11 @@ public class ScreenValue extends Value
screenHandler.addSlotListener(new ScarpetScreenHandlerListener() screenHandler.addSlotListener(new ScarpetScreenHandlerListener()
{ {
@Override @Override
public boolean onSlotClick(ServerPlayer player, ClickType actionType, int slot, int button) public boolean onSlotClick(ServerPlayer player, ContainerInput actionType, int slot, int button)
{ {
Map<Value, Value> data = new HashMap<>(); Map<Value, Value> data = new HashMap<>();
data.put(StringValue.of("slot"), slot == AbstractContainerMenu.SLOT_CLICKED_OUTSIDE ? Value.NULL : NumericValue.of(slot)); data.put(StringValue.of("slot"), slot == AbstractContainerMenu.SLOT_CLICKED_OUTSIDE ? Value.NULL : NumericValue.of(slot));
if (actionType == ClickType.QUICK_CRAFT) if (actionType == ContainerInput.QUICK_CRAFT)
{ {
data.put(StringValue.of("quick_craft_stage"), NumericValue.of(AbstractContainerMenu.getQuickcraftHeader(button))); data.put(StringValue.of("quick_craft_stage"), NumericValue.of(AbstractContainerMenu.getQuickcraftHeader(button)));
button = AbstractContainerMenu.getQuickcraftType(button); button = AbstractContainerMenu.getQuickcraftType(button);
@@ -402,7 +402,7 @@ public class ScreenValue extends Value
public interface ScarpetScreenHandlerListener extends ContainerListener public interface ScarpetScreenHandlerListener extends ContainerListener
{ {
boolean onSlotClick(ServerPlayer player, ClickType actionType, int slot, int button); boolean onSlotClick(ServerPlayer player, ContainerInput actionType, int slot, int button);
boolean onButtonClick(ServerPlayer player, int button); boolean onButtonClick(ServerPlayer player, int button);
@@ -546,7 +546,7 @@ public class ScreenValue extends Value
} }
} }
private static String actionTypeToString(ClickType actionType) private static String actionTypeToString(ContainerInput actionType)
{ {
return switch (actionType) return switch (actionType)
{ {
@@ -182,7 +182,7 @@ public class PerimeterDiagnostics
{ {
el.snapTo(pos.getX() + 0.5F, pos.getY(), pos.getZ()+0.5F, 0.0F, 0.0F); el.snapTo(pos.getX() + 0.5F, pos.getY(), pos.getZ()+0.5F, 0.0F, 0.0F);
return el.checkSpawnObstruction(worldServer) && el.checkSpawnRules(worldServer, EntitySpawnReason.NATURAL) && return el.checkSpawnObstruction(worldServer) && el.checkSpawnRules(worldServer, EntitySpawnReason.NATURAL) &&
SpawnPlacements.checkSpawnRules(el.getType(),(ServerLevel)el.level(), EntitySpawnReason.NATURAL, el.blockPosition(), el.level().random) && SpawnPlacements.checkSpawnRules(el.getType(),(ServerLevel)el.level(), EntitySpawnReason.NATURAL, el.blockPosition(), el.level().getRandom()) &&
worldServer.noCollision(el); // check collision rules once they stop fiddling with them after 1.14.1 worldServer.noCollision(el); // check collision rules once they stop fiddling with them after 1.14.1
} }
return false; return false;
@@ -439,14 +439,14 @@ public class SpawnReporter
{ {
float f = x + 0.5F; float f = x + 0.5F;
float f1 = z + 0.5F; float f1 = z + 0.5F;
mob.snapTo(f, y, f1, worldIn.random.nextFloat() * 360.0F, 0.0F); mob.snapTo(f, y, f1, worldIn.getRandom().nextFloat() * 360.0F, 0.0F);
fits = worldIn.noCollision(mob); fits = worldIn.noCollision(mob);
EntityType<?> etype = mob.getType(); EntityType<?> etype = mob.getType();
for (int i = 0; i < 20; ++i) for (int i = 0; i < 20; ++i)
{ {
if ( if (
SpawnPlacements.checkSpawnRules(etype,worldIn, EntitySpawnReason.NATURAL, pos, worldIn.random) && SpawnPlacements.checkSpawnRules(etype,worldIn, EntitySpawnReason.NATURAL, pos, worldIn.getRandom()) &&
SpawnPlacements.isSpawnPositionOk(etype, worldIn, pos) && SpawnPlacements.isSpawnPositionOk(etype, worldIn, pos) &&
mob.checkSpawnRules(worldIn, EntitySpawnReason.NATURAL) mob.checkSpawnRules(worldIn, EntitySpawnReason.NATURAL)
// && mob.canSpawn(worldIn) // entity collisions // mostly - except ocelots // && mob.canSpawn(worldIn) // entity collisions // mostly - except ocelots
+1 -1
View File
@@ -1,4 +1,4 @@
accessWidener v1 named accessWidener v1 official
accessible class net/minecraft/server/level/ChunkMap$DistanceManager accessible class net/minecraft/server/level/ChunkMap$DistanceManager
accessible class net/minecraft/server/level/ThreadedLevelLightEngine$TaskType accessible class net/minecraft/server/level/ThreadedLevelLightEngine$TaskType