Skip to content

Commit

Permalink
Implement burning mobs tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
ACGaming committed Jul 13, 2024
1 parent 0c1cb46 commit eed1eab
Show file tree
Hide file tree
Showing 7 changed files with 56 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import java.util.HashMap;
import java.util.Map;

import com.cleanroommc.configanytime.ConfigAnytime;
import mod.acgaming.universaltweaks.UniversalTweaks;
import mod.acgaming.universaltweaks.core.UTLoadingPlugin;
Expand Down Expand Up @@ -474,11 +473,18 @@ public static class EntitiesCategory
@Config.Comment("Sets the acceleration value for controlling boats")
public double utBoatSpeed = 0.04D;

@Config.RequiresMcRestart
@Config.Name("Burning Baby Zombies")
@Config.Comment("Lets baby zombies burn in daylight as in Minecraft 1.13+")
public boolean utBurningBabyZombiesToggle = true;

@Config.Name("Burning Skeletons")
@Config.Comment("Lets skeletons burn in daylight")
public boolean utBurningSkeletonsToggle = true;

@Config.Name("Burning Zombies")
@Config.Comment("Lets zombies burn in daylight")
public boolean utBurningZombiesToggle = true;

@Config.Name("Creeper Charged Spawning Chance")
@Config.Comment("Sets the chance for creepers to spawn charged")
@Config.RangeDouble(min = 0.0D, max = 1.0D)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public class UTLoadingPlugin implements IFMLLoadingPlugin, IEarlyMixinLoader
put("mixins.tweaks.entities.ai.wither.json", () -> UTConfigTweaks.ENTITIES.utWitherAIToggle);
put("mixins.tweaks.entities.armedarmorstands.json", () -> UTConfigTweaks.ENTITIES.utArmedArmorStandsToggle);
put("mixins.tweaks.entities.burning.horse.json", () -> UTConfigTweaks.ENTITIES.UNDEAD_HORSES.utBurningUndeadHorsesToggle);
put("mixins.tweaks.entities.burning.zombie.json", () -> UTConfigTweaks.ENTITIES.utBurningBabyZombiesToggle);
put("mixins.tweaks.entities.burning.mobs.json", () -> UTConfigTweaks.ENTITIES.utBurningBabyZombiesToggle);
put("mixins.tweaks.entities.damage.arrow.json", () -> UTConfigTweaks.ENTITIES.utCriticalArrowDamage != -1);
put("mixins.tweaks.entities.damage.collision.json", () -> UTConfigTweaks.ENTITIES.COLLISION_DAMAGE.utCollisionDamageToggle);
put("mixins.tweaks.entities.damage.falling.json", () -> UTConfigTweaks.ENTITIES.WATER_FALL_DAMAGE.utFallDamageToggle);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
package mod.acgaming.universaltweaks.tweaks.entities.burning.zombie.mixin;

import net.minecraft.entity.monster.EntityZombie;
package mod.acgaming.universaltweaks.tweaks.entities.burning.mobs.mixin;

import mod.acgaming.universaltweaks.config.UTConfigTweaks;
import net.minecraft.entity.monster.EntityZombie;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package mod.acgaming.universaltweaks.tweaks.entities.burning.mobs.mixin;

import mod.acgaming.universaltweaks.config.UTConfigTweaks;
import net.minecraft.entity.monster.AbstractSkeleton;
import net.minecraft.entity.monster.EntityMob;
import net.minecraft.world.World;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;

@Mixin(AbstractSkeleton.class)
public abstract class UTBurningSkeletonsMixin extends EntityMob
{
protected UTBurningSkeletonsMixin(World worldIn)
{
super(worldIn);
}

@Redirect(method = "onLivingUpdate", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/World;isDaytime()Z"))
public boolean utBurningSkeletons(World instance)
{
return this.world.isDaytime() && UTConfigTweaks.ENTITIES.utBurningSkeletonsToggle;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package mod.acgaming.universaltweaks.tweaks.entities.burning.mobs.mixin;

import mod.acgaming.universaltweaks.config.UTConfigTweaks;
import net.minecraft.entity.monster.EntityZombie;
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(EntityZombie.class)
public abstract class UTBurningZombiesMixin
{
@Inject(method = "shouldBurnInDay", at = @At(value = "HEAD"), cancellable = true)
public void utBurningZombies(CallbackInfoReturnable<Boolean> cir)
{
cir.setReturnValue(UTConfigTweaks.ENTITIES.utBurningZombiesToggle);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ public class UTObsoleteModsHandler
put("loginhpfix", () -> UTConfigBugfixes.ENTITIES.utMaxHealthToggle);
put("maxhealthfixer", () -> UTConfigBugfixes.ENTITIES.utMaxHealthToggle);
put("mendingfix", () -> UTConfigTweaks.ITEMS.MENDING.utMendingToggle);
put("mobsunscreen", () -> !UTConfigTweaks.ENTITIES.utBurningSkeletonsToggle || !UTConfigTweaks.ENTITIES.utBurningZombiesToggle);
put("movingquickly", () -> UTConfigTweaks.ENTITIES.PLAYER_SPEED.utPlayerSpeedToggle);
put("mtqfix", () -> UTConfigTweaks.ENTITIES.PLAYER_SPEED.utPlayerSpeedToggle);
put("mup", () -> true);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"package": "mod.acgaming.universaltweaks.tweaks.entities.burning.zombie.mixin",
"package": "mod.acgaming.universaltweaks.tweaks.entities.burning.mobs.mixin",
"refmap": "universaltweaks.refmap.json",
"minVersion": "0.8",
"compatibilityLevel": "JAVA_8",
"mixins": ["UTBurningBabyZombiesMixin"]
"mixins": ["UTBurningBabyZombiesMixin", "UTBurningSkeletonsMixin", "UTBurningZombiesMixin"]
}

0 comments on commit eed1eab

Please sign in to comment.