-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1.21 fixes and additional optimizations
- Fixed enchantments not working due to a Mixin - Added an "unstable" category for things that aren't enabled by default because they aren't fully polished - Added a tnt networking optimization - Fixed some older optimizations that were disabled - Moved some optimizations to the "unstable" category - Add a proper naming scheme
- Loading branch information
Showing
15 changed files
with
104 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 0 additions & 18 deletions
18
.../com/github/tatercertified/potatoptimize/mixin/memory/reduce_alloc/EnchantmentsMixin.java
This file was deleted.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
...ading/entity_ticking/EntityListMixin.java → ...table/entity_ticking/EntityListMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...y_ticking/EntityServerThreadingMixin.java → ...y_ticking/EntityServerThreadingMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
...b/tatercertified/potatoptimize/mixin/unstable/explosion_packets/ClientExplosionMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package com.github.tatercertified.potatoptimize.mixin.unstable.explosion_packets; | ||
|
||
import net.minecraft.client.MinecraftClient; | ||
import net.minecraft.client.sound.PositionedSoundInstance; | ||
import net.minecraft.entity.Entity; | ||
import net.minecraft.entity.EntityType; | ||
import net.minecraft.entity.Ownable; | ||
import net.minecraft.entity.TntEntity; | ||
import net.minecraft.particle.ParticleTypes; | ||
import net.minecraft.sound.SoundEvents; | ||
import net.minecraft.world.World; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | ||
|
||
@Mixin(TntEntity.class) | ||
public abstract class ClientExplosionMixin extends Entity implements Ownable { | ||
public ClientExplosionMixin(EntityType<?> type, World world) { | ||
super(type, world); | ||
} | ||
|
||
@Inject(method = "tick", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/TntEntity;discard()V", shift = At.Shift.BEFORE)) | ||
private void addClientFunctionality(CallbackInfo ci) { | ||
this.getWorld().addParticle(ParticleTypes.EXPLOSION_EMITTER, this.getX(), this.getY() + 0.5, this.getZ(), 0.0, 0.0, 0.0); | ||
MinecraftClient.getInstance().getSoundManager().play(PositionedSoundInstance.master(SoundEvents.ENTITY_GENERIC_EXPLODE, 1.0F)); | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
...tercertified/potatoptimize/mixin/unstable/explosion_packets/ExplosionNetworkingMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package com.github.tatercertified.potatoptimize.mixin.unstable.explosion_packets; | ||
|
||
import com.llamalad7.mixinextras.sugar.Local; | ||
import net.minecraft.entity.Entity; | ||
import net.minecraft.entity.damage.DamageSource; | ||
import net.minecraft.particle.ParticleEffect; | ||
import net.minecraft.registry.entry.RegistryEntry; | ||
import net.minecraft.server.world.ServerWorld; | ||
import net.minecraft.sound.SoundEvent; | ||
import net.minecraft.world.World; | ||
import net.minecraft.world.explosion.Explosion; | ||
import net.minecraft.world.explosion.ExplosionBehavior; | ||
import org.jetbrains.annotations.Nullable; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; | ||
|
||
@Mixin(ServerWorld.class) | ||
public class ExplosionNetworkingMixin { | ||
|
||
@Inject(method = "createExplosion", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/explosion/Explosion;shouldDestroy()Z", shift = At.Shift.AFTER), cancellable = true) | ||
private void cancelPackets(@Nullable Entity entity, @Nullable DamageSource damageSource, @Nullable ExplosionBehavior behavior, double x, double y, double z, float power, boolean createFire, World.ExplosionSourceType explosionSourceType, ParticleEffect particle, ParticleEffect emitterParticle, RegistryEntry<SoundEvent> soundEvent, CallbackInfoReturnable<Explosion> cir, @Local(ordinal = 0) Explosion explosion) { | ||
cir.setReturnValue(explosion); | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
...ry/reduce_random/RandomCreationMixin.java → ...le/reduce_random/RandomCreationMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters