Skip to content

Commit

Permalink
Add removed spawnParticles methods (intermediary)
Browse files Browse the repository at this point in the history
  • Loading branch information
Patbox committed Dec 7, 2024
1 parent b985c97 commit 4cda940
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package xyz.nucleoid.extras.mixin.compat;


import net.minecraft.entity.Entity;
import net.minecraft.network.packet.Packet;
import net.minecraft.network.packet.s2c.play.ParticleS2CPacket;
import net.minecraft.particle.ParticleEffect;
import net.minecraft.server.network.ServerPlayerEntity;
import net.minecraft.server.world.ServerWorld;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;

@SuppressWarnings("MissingUnique")
@Mixin(ServerWorld.class)
public abstract class ServerWorldMixin {

@Shadow
public abstract <T extends ParticleEffect> int spawnParticles(T parameters, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double speed);

@Shadow
public abstract <T extends ParticleEffect> boolean spawnParticles(ServerPlayerEntity viewer, T parameters, boolean force, boolean important, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double speed);

// spawnParticles from 1.21.3
public <T extends ParticleEffect> int method_14199(T parameters, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double speed) {
return this.spawnParticles(parameters, x, y, z, count, offsetX, offsetY, offsetZ, speed);
}

// spawnParticles from 1.21.3
public <T extends ParticleEffect> boolean method_14166(ServerPlayerEntity viewer, T parameters, boolean force, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double speed) {
return this.spawnParticles(viewer, parameters, force, false, x, y , z, count, offsetX, offsetY, offsetZ, speed);
}

}
1 change: 1 addition & 0 deletions src/main/resources/extras.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"ServerEntityManagerAccessor",
"ServerWorldAccessor",
"TextCodecMixin",
"compat.ServerWorldMixin",
"datafixer.ItemStackComponentizationFixMixin",
"datafixer.Schema1460Mixin",
"debug.EntityMixin",
Expand Down

0 comments on commit 4cda940

Please sign in to comment.