Skip to content

Commit

Permalink
24w44a
Browse files Browse the repository at this point in the history
  • Loading branch information
gnembon committed Oct 30, 2024
1 parent aea9144 commit 0bf2b5b
Show file tree
Hide file tree
Showing 9 changed files with 28 additions and 28 deletions.
2 changes: 1 addition & 1 deletion docs/scarpet/api/BlocksAndWorldAccess.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/carpet/helpers/ParticleDisplay.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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);
}
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/carpet/mixins/Explosion_optimizedTntMixin.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/carpet/script/api/Auxiliary.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
6 changes: 3 additions & 3 deletions src/main/java/carpet/script/api/WorldAccess.java
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ public class WorldAccess

private static final Map<String, TicketType<?>> 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)
Expand Down Expand Up @@ -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
{
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/carpet/script/utils/FeatureGenerator.java
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ public static <T extends FeatureConfiguration> 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())
Expand Down Expand Up @@ -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;
Expand Down
26 changes: 13 additions & 13 deletions src/main/java/carpet/script/utils/ShapeDispatcher.java
Original file line number Diff line number Diff line change
Expand Up @@ -775,7 +775,7 @@ public Consumer<ServerPlayer> 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);
};
}

Expand Down Expand Up @@ -1070,7 +1070,7 @@ public Consumer<ServerPlayer> 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);
}
Expand Down Expand Up @@ -1297,7 +1297,7 @@ public Consumer<ServerPlayer> 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);
}
Expand Down Expand Up @@ -1395,7 +1395,7 @@ public Consumer<ServerPlayer> 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)
Expand All @@ -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
Expand All @@ -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);
}
}
};
Expand Down Expand Up @@ -2184,12 +2184,12 @@ private static int drawOptimizedParticleLine(List<ServerPlayer> 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;
}
Expand All @@ -2201,10 +2201,10 @@ private static int drawOptimizedParticleLine(List<ServerPlayer> 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);
}
Expand Down Expand Up @@ -2232,7 +2232,7 @@ public static int drawParticleLine(List<ServerPlayer> 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++;
Expand All @@ -2253,7 +2253,7 @@ public static int drawParticleLine(List<ServerPlayer> 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++;
Expand Down

0 comments on commit 0bf2b5b

Please sign in to comment.