diff --git a/docs/scarpet/api/BlocksAndWorldAccess.md b/docs/scarpet/api/BlocksAndWorldAccess.md index d3f3c10a8..a2715a57e 100644 --- a/docs/scarpet/api/BlocksAndWorldAccess.md +++ b/docs/scarpet/api/BlocksAndWorldAccess.md @@ -625,7 +625,7 @@ It returns a `map` with a report indicating how many chunks were affected, and h Adds a chunk ticket at a position, which makes the game to keep the designated area centered around `pos` with radius of `radius` loaded for a predefined amount of ticks, defined by `type`. Allowed types -are `portal`: 300 ticks, `teleport`: 5 ticks, and `unknown`: 1 tick. Radius can be from 1 to 32 ticks. +are `portal`: 300 ticks, `teleport`: 40 ticks, and `unknown`: 1 tick. Radius can be from 1 to 32 ticks. This function is tentative - will likely change when chunk ticket API is properly fleshed out. diff --git a/gradle.properties b/gradle.properties index 84e52b0b9..36efe1f35 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,7 +3,7 @@ org.gradle.jvmargs=-Xmx1G # Fabric Properties # check https://fabricmc.net/develop/ - minecraft_version=1.21.2 + minecraft_version=24w44a loader_version=0.16.7 jsr305_version=3.0.2 fabric_version=0.106.0+1.21.2 @@ -17,7 +17,7 @@ org.gradle.jvmargs=-Xmx1G # 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 # 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.2 + release-curse-versions = Minecraft 1.22:1.22.0-Snapshot # Whether or not to build another branch on release release-extra-branch = false # The name of the second branch to release diff --git a/src/main/java/carpet/helpers/ParticleDisplay.java b/src/main/java/carpet/helpers/ParticleDisplay.java index 0184375c6..733c06ac5 100644 --- a/src/main/java/carpet/helpers/ParticleDisplay.java +++ b/src/main/java/carpet/helpers/ParticleDisplay.java @@ -18,7 +18,7 @@ public static void drawParticleLine(ServerPlayer player, Vec3 from, Vec3 to, Str if (accentParticle != null) player.serverLevel().sendParticles( player, accentParticle, - true, + true, true, to.x, to.y, to.z, count, spread, spread, spread, 0.0); @@ -33,7 +33,7 @@ public static void drawParticleLine(ServerPlayer player, Vec3 from, Vec3 to, Str player.serverLevel().sendParticles( player, mainParticle, - true, + true, true, delta.x+from.x, delta.y+from.y, delta.z+from.z, 1, 0.0, 0.0, 0.0, 0.0); } diff --git a/src/main/java/carpet/mixins/Explosion_optimizedTntMixin.java b/src/main/java/carpet/mixins/Explosion_optimizedTntMixin.java index dadd8465a..43d38cb12 100644 --- a/src/main/java/carpet/mixins/Explosion_optimizedTntMixin.java +++ b/src/main/java/carpet/mixins/Explosion_optimizedTntMixin.java @@ -86,12 +86,12 @@ private void onExplostion(ServerLevel world, Entity entity, DamageSource damageS } @Redirect(method = "hurtEntities", - at = @At(value = "INVOKE", target = "Lnet/minecraft/world/entity/Entity;setDeltaMovement(Lnet/minecraft/world/phys/Vec3;)V")) + at = @At(value = "INVOKE", target = "Lnet/minecraft/world/entity/Entity;push(Lnet/minecraft/world/phys/Vec3;)V")) private void setVelocityAndUpdateLogging(Entity entity, Vec3 velocity) { if (eLogger != null) { eLogger.onEntityImpacted(entity, velocity.subtract(entity.getDeltaMovement())); } - entity.setDeltaMovement(velocity); + entity.push(velocity); } } diff --git a/src/main/java/carpet/mixins/LevelRenderer_scarpetRenderMixin.java b/src/main/java/carpet/mixins/LevelRenderer_scarpetRenderMixin.java index 9672f485f..4b1f40639 100644 --- a/src/main/java/carpet/mixins/LevelRenderer_scarpetRenderMixin.java +++ b/src/main/java/carpet/mixins/LevelRenderer_scarpetRenderMixin.java @@ -32,7 +32,7 @@ private void addRenderers(Minecraft minecraft, EntityRenderDispatcher entityRend } @Inject(method = "addParticlesPass", at = @At("RETURN")) - private void renderScarpetThingsLate(FrameGraphBuilder frameGraphBuilder, Camera camera, LightTexture lightTexture, float f, FogParameters fogParameters, CallbackInfo ci) + private void renderScarpetThingsLate(FrameGraphBuilder frameGraphBuilder, Camera camera, float f, FogParameters fogParameters, CallbackInfo ci) { // in normal circumstances we want to render shapes at the very end so it appears correctly behind stuff. // we might actually not need to play with render hooks here. diff --git a/src/main/java/carpet/script/api/Auxiliary.java b/src/main/java/carpet/script/api/Auxiliary.java index 4cb8f5d84..b5b5e9c93 100644 --- a/src/main/java/carpet/script/api/Auxiliary.java +++ b/src/main/java/carpet/script/api/Auxiliary.java @@ -208,14 +208,14 @@ public static void apply(Expression expression) { for (ServerPlayer p : (world.players())) { - world.sendParticles(p, particle, true, vec.x, vec.y, vec.z, count, + world.sendParticles(p, particle, true, true, vec.x, vec.y, vec.z, count, spread, spread, spread, speed); } } else { world.sendParticles(player, - particle, true, vec.x, vec.y, vec.z, count, + particle, true, true, vec.x, vec.y, vec.z, count, spread, spread, spread, speed); } diff --git a/src/main/java/carpet/script/api/WorldAccess.java b/src/main/java/carpet/script/api/WorldAccess.java index 1e9aa470a..4144d3253 100644 --- a/src/main/java/carpet/script/api/WorldAccess.java +++ b/src/main/java/carpet/script/api/WorldAccess.java @@ -151,7 +151,7 @@ public class WorldAccess private static final Map> ticketTypes = Map.of( "portal", TicketType.PORTAL, - "teleport", TicketType.POST_TELEPORT, + "teleport", TicketType.ENDER_PEARL, "unknown", TicketType.UNKNOWN ); // dummy entity for dummy requirements in the loot tables (see snowball) @@ -1694,9 +1694,9 @@ LivingEntity getIndirectSourceEntity() { cc.level().getChunkSource().addRegionTicket(TicketType.PORTAL, target, radius, pos); } - else if (ticket == TicketType.POST_TELEPORT) // post teleport + else if (ticket == TicketType.ENDER_PEARL) // post teleport { - cc.level().getChunkSource().addRegionTicket(TicketType.POST_TELEPORT, target, radius, 1); + cc.level().getChunkSource().addRegionTicket(TicketType.ENDER_PEARL, target, radius, target); } else { diff --git a/src/main/java/carpet/script/utils/FeatureGenerator.java b/src/main/java/carpet/script/utils/FeatureGenerator.java index a686543ee..79a5e7669 100644 --- a/src/main/java/carpet/script/utils/FeatureGenerator.java +++ b/src/main/java/carpet/script/utils/FeatureGenerator.java @@ -261,7 +261,7 @@ public static StructureStart shouldStructureSta } else { - StructureStart filledStructure = structure.generate( + StructureStart filledStructure = structure.generate(Holder.direct(structure), world.dimension(), world.registryAccess(), generator, generator.getBiomeSource(), seed, world.getStructureManager(), world.getSeed(), chunkPos, 0, world, structureBiomes::contains); if (filledStructure != null && filledStructure.isValid()) @@ -418,7 +418,7 @@ public static boolean plopAnywhere(Structure structure, ServerLevel world, Block checks.set(true); try { - StructureStart start = structure.generate(world.registryAccess(), generator, generator.getBiomeSource(), world.getChunkSource().randomState(), world.getStructureManager(), world.getSeed(), new ChunkPos(pos), 0, world, b -> true); + StructureStart start = structure.generate(Holder.direct(structure), world.dimension(), world.registryAccess(), generator, generator.getBiomeSource(), world.getChunkSource().randomState(), world.getStructureManager(), world.getSeed(), new ChunkPos(pos), 0, world, b -> true); if (start == StructureStart.INVALID_START) { return false; diff --git a/src/main/java/carpet/script/utils/ShapeDispatcher.java b/src/main/java/carpet/script/utils/ShapeDispatcher.java index 0f96aa6b5..928ec3969 100644 --- a/src/main/java/carpet/script/utils/ShapeDispatcher.java +++ b/src/main/java/carpet/script/utils/ShapeDispatcher.java @@ -775,7 +775,7 @@ public Consumer alternative() } Vec3 v = relativiseRender(p.level(), this.pos, 0); - p.serverLevel().sendParticles(p, particle, true, v.x, v.y, v.z, 1, 0.0, 0.0, 0.0, 0.0); + p.serverLevel().sendParticles(p, particle, true, true, v.x, v.y, v.z, 1, 0.0, 0.0, 0.0, 0.0); }; } @@ -1070,7 +1070,7 @@ public Consumer alternative() ParticleOptions locparticledata = getParticleData(String.format(Locale.ROOT, "dust %.1f %.1f %.1f %.1f", fr, fg, fb, fa), p.level().registryAccess()); for (Vec3 v : getAlterPoint(p)) { - p.serverLevel().sendParticles(p, locparticledata, true, + p.serverLevel().sendParticles(p, locparticledata, true, true, v.x, v.y, v.z, 1, 0.0, 0.0, 0.0, 0.0); } @@ -1297,7 +1297,7 @@ public Consumer alternative() double x = radius * Mth.cos(theta) * Mth.cos(phi); double y = radius * Mth.cos(theta) * Mth.sin(phi); double z = radius * Mth.sin(theta); - world.sendParticles(p, particle, true, + world.sendParticles(p, particle, true, true, x + ccx, y + ccy, z + ccz, 1, 0.0, 0.0, 0.0, 0.0); } @@ -1395,7 +1395,7 @@ public Consumer alternative() double x = radius * Mth.cos(phi); double y = d; double z = radius * Mth.sin(phi); - world.sendParticles(p, particle, true, x + ccx, y + ccy, z + ccz, 1, 0.0, 0.0, 0.0, 0.0); + world.sendParticles(p, particle, true, true,x + ccx, y + ccy, z + ccz, 1, 0.0, 0.0, 0.0, 0.0); } } else if (axis == Direction.Axis.X) @@ -1407,7 +1407,7 @@ else if (axis == Direction.Axis.X) double x = d; double y = radius * Mth.cos(phi); double z = radius * Mth.sin(phi); - world.sendParticles(p, particle, true, x + ccx, y + ccy, z + ccz, 1, 0.0, 0.0, 0.0, 0.0); + world.sendParticles(p, particle, true, true, x + ccx, y + ccy, z + ccz, 1, 0.0, 0.0, 0.0, 0.0); } } else // Z @@ -1419,7 +1419,7 @@ else if (axis == Direction.Axis.X) double x = radius * Mth.sin(phi); double y = radius * Mth.cos(phi); double z = d; - world.sendParticles(p, particle, true, x + ccx, y + ccy, z + ccz, 1, 0.0, 0.0, 0.0, 0.0); + world.sendParticles(p, particle, true, true, x + ccx, y + ccy, z + ccz, 1, 0.0, 0.0, 0.0, 0.0); } } }; @@ -2184,12 +2184,12 @@ private static int drawOptimizedParticleLine(List playerList, Part for (ServerPlayer player : playerList) { ServerLevel world = player.serverLevel(); - world.sendParticles(player, particle, true, + world.sendParticles(player, particle, true, true, (towards.x) / 2 + from.x, (towards.y) / 2 + from.y, (towards.z) / 2 + from.z, particles / 3, towards.x / 6, towards.y / 6, towards.z / 6, 0.0); - world.sendParticles(player, particle, true, + world.sendParticles(player, particle, true, true, from.x, from.y, from.z, 1, 0.0, 0.0, 0.0, 0.0); - world.sendParticles(player, particle, true, + world.sendParticles(player, particle, true, true, to.x, to.y, to.z, 1, 0.0, 0.0, 0.0, 0.0); parts += particles / 3 + 2; } @@ -2201,10 +2201,10 @@ private static int drawOptimizedParticleLine(List playerList, Part for (ServerPlayer player : playerList) { ServerLevel world = player.serverLevel(); - world.sendParticles(player, particle, true, + world.sendParticles(player, particle, true, true, (towards.x) / center + from.x, (towards.y) / center + from.y, (towards.z) / center + from.z, particles / divider, towards.x / dev, towards.y / dev, towards.z / dev, 0.0); - world.sendParticles(player, particle, true, + world.sendParticles(player, particle, true, true, (towards.x) * (1.0 - 1.0 / center) + from.x, (towards.y) * (1.0 - 1.0 / center) + from.y, (towards.z) * (1.0 - 1.0 / center) + from.z, particles / divider, towards.x / dev, towards.y / dev, towards.z / dev, 0.0); } @@ -2232,7 +2232,7 @@ public static int drawParticleLine(List players, ParticleOptions p Vec3 at = from.add(towards.scale(rand.nextDouble())); for (ServerPlayer player : players) { - player.serverLevel().sendParticles(player, particle, true, + player.serverLevel().sendParticles(player, particle, true, true, at.x, at.y, at.z, 1, 0.0, 0.0, 0.0, 0.0); pcount++; @@ -2253,7 +2253,7 @@ public static int drawParticleLine(List players, ParticleOptions p { for (ServerPlayer player : players) { - player.serverLevel().sendParticles(player, particle, true, + player.serverLevel().sendParticles(player, particle, true, true, delta.x + from.x, delta.y + from.y, delta.z + from.z, 1, 0.0, 0.0, 0.0, 0.0); pcount++;