Skip to content

Commit

Permalink
Skeleton trap tweak follow-up
Browse files Browse the repository at this point in the history
  • Loading branch information
ACGaming committed Dec 2, 2024
1 parent c6b2d21 commit 53a843a
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ All changes are toggleable via config files.
* **No Portal Spawning:** Prevents zombie pigmen spawning from nether portals
* **No Redstone Lighting:** Disables lighting of active redstone, repeaters, and comparators to improve performance
* **No Saddled Wandering:** Stops horses wandering around when saddled
* **No Skeleton Trap Spawning:** Prevents skeleton traps spawning during thunderstorms
* **No Smelting XP:** Disables the experience reward when smelting items in furnaces
* **Offhand Improvement:** Prevents placing offhand blocks when blocks or food are held in the mainhand
* **Overhaul Beacon:** Change how beacon construct and range apply per level
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ public class UTLoadingPlugin implements IFMLLoadingPlugin, IEarlyMixinLoader
put("mixins.tweaks.entities.speed.cobweb.json", () -> UTConfigTweaks.ENTITIES.COBWEB_SLOWNESS.utCobwebSlownessToggle);
put("mixins.tweaks.entities.speed.player.json", () -> UTConfigTweaks.ENTITIES.PLAYER_SPEED.utPlayerSpeedToggle);
put("mixins.tweaks.entities.taming.horse.json", () -> UTConfigTweaks.ENTITIES.UNDEAD_HORSES.utTamingUndeadHorsesToggle);
put("mixins.tweaks.entities.skeletontrap.json", () -> UTConfigTweaks.ENTITIES.UNDEAD_HORSES.utSkeletonTrapSpawningToggle);
put("mixins.tweaks.entities.spawning.skeletontrap.json", () -> UTConfigTweaks.ENTITIES.UNDEAD_HORSES.utSkeletonTrapSpawningToggle);
put("mixins.tweaks.entities.trading.json", () -> UTConfigTweaks.ENTITIES.utVillagerTradeLevelingToggle || UTConfigTweaks.ENTITIES.utVillagerTradeRestockToggle);
put("mixins.tweaks.entities.voidteleport.json", () -> UTConfigTweaks.ENTITIES.VOID_TELEPORT.utVoidTeleportToggle);
put("mixins.tweaks.items.attackcooldown.server.json", () -> UTConfigTweaks.ITEMS.ATTACK_COOLDOWN.utAttackCooldownToggle);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package mod.acgaming.universaltweaks.tweaks.entities.spawning.skeletontrap.mixin;

import net.minecraft.entity.Entity;
import net.minecraft.world.GameRules;
import net.minecraft.world.WorldServer;

import mod.acgaming.universaltweaks.config.UTConfigTweaks;
Expand All @@ -11,9 +11,9 @@
@Mixin(WorldServer.class)
public class UTSkeletonTrapSpawningMixin
{
@Redirect(method = "updateBlocks()V", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/WorldServer;spawnEntity(Lnet/minecraft/entity/Entity;)Z"))
private boolean utSkeletonTrapSpawning(WorldServer worldIn, Entity entityIn)
@Redirect(method = "updateBlocks()V", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/GameRules;getBoolean(Ljava/lang/String;)Z"))
private boolean utSkeletonTrapSpawning(GameRules rules, String name)
{
return !UTConfigTweaks.ENTITIES.UNDEAD_HORSES.utSkeletonTrapSpawningToggle && worldIn.spawnEntity(entityIn);
return !UTConfigTweaks.ENTITIES.UNDEAD_HORSES.utSkeletonTrapSpawningToggle && rules.getBoolean(name);
}
}
}

0 comments on commit 53a843a

Please sign in to comment.