Skip to content

Commit

Permalink
Merge pull request #430 from WaitingIdly/mob-spawner-entity
Browse files Browse the repository at this point in the history
Disable Mob Spawner Entity Render
  • Loading branch information
ACGaming authored Apr 9, 2024
2 parents 84add0b + 748d8ae commit 282faf5
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ All changes are toggleable via config files.
* **Disable Audio Debug:** Improves loading times by removing debug code for missing sounds and subtitles
* **Disable Creeper Music Discs:** Disables creepers dropping music discs when slain by skeletons
* **Disable Fancy Missing Model:** Improves rendering performance by removing the resource location text on missing models
* **Disable Mob Spawner Entity Render:** Disables rendering an entity inside of Mob Spawners
* **Disable Narrator:** Disables the narrator functionality entirely
* **Disable Sleeping:** Disables skipping night by using a bed while making it still able to set spawn
* **Disable Villager Trade Leveling:** Disables leveling of villager careers, only allowing base level trades
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1711,6 +1711,11 @@ public static class PerformanceCategory
@Config.Comment("Improves rendering performance by removing the resource location text on missing models")
public boolean utDisableFancyMissingModelToggle = true;

@Config.RequiresMcRestart
@Config.Name("Disable Mob Spawner Entity")
@Config.Comment("Improves rendering performance by disabling rendering the entity inside mob spawners")
public boolean utDisableMobSpawnerRendering = false;

@Config.RequiresMcRestart
@Config.Name("Faster Background Startup")
@Config.Comment("Fixes slow background startup edge case caused by checking tooltips during the loading process")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ public List<String> getMixinConfigs()
configs.add("mixins.tweaks.performance.audioreload.json");
configs.add("mixins.tweaks.performance.fps.json");
configs.add("mixins.tweaks.performance.missingmodel.json");
configs.add("mixins.tweaks.performance.mobspawnerrender.json");
configs.add("mixins.tweaks.performance.resourcemanager.json");
configs.add("mixins.tweaks.world.loading.client.json");
}
Expand Down Expand Up @@ -345,6 +346,8 @@ public boolean shouldMixinConfigQueue(String mixinConfig)
return UTConfigTweaks.PERFORMANCE.utUncapFPSToggle;
case "mixins.tweaks.performance.missingmodel.json":
return UTConfigTweaks.PERFORMANCE.utDisableFancyMissingModelToggle;
case "mixins.tweaks.performance.mobspawnerrender.json":
return UTConfigTweaks.PERFORMANCE.utDisableMobSpawnerRendering;
case "mixins.tweaks.performance.resourcemanager.json":
return UTConfigTweaks.PERFORMANCE.utCheckAnimatedModelsToggle;
case "mixins.tweaks.world.loading.client.json":
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package mod.acgaming.universaltweaks.tweaks.performance.mobspawnerrender.mixin;

import mod.acgaming.universaltweaks.config.UTConfigTweaks;
import net.minecraft.client.renderer.tileentity.TileEntityMobSpawnerRenderer;
import net.minecraft.tileentity.TileEntityMobSpawner;
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(value = TileEntityMobSpawnerRenderer.class)
public abstract class UTTileEntityMobSpawnerRenderer
{
@Inject(method = "render(Lnet/minecraft/tileentity/TileEntityMobSpawner;DDDFIF)V", at = @At("HEAD"), cancellable = true)
private void utDisableEntityRendering(TileEntityMobSpawner te, double x, double y, double z, float partialTicks, int destroyStage, float alpha, CallbackInfo ci)
{
if (!UTConfigTweaks.PERFORMANCE.utDisableMobSpawnerRendering) return;
ci.cancel();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"package": "mod.acgaming.universaltweaks.tweaks.performance.mobspawnerrender.mixin",
"refmap": "universaltweaks.refmap.json",
"minVersion": "0.8",
"compatibilityLevel": "JAVA_8",
"client": ["UTTileEntityMobSpawnerRenderer"]
}

0 comments on commit 282faf5

Please sign in to comment.