-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #357 from IcarussOne/main
2nd Batch of Tweaks
- Loading branch information
Showing
7 changed files
with
93 additions
and
0 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
22 changes: 22 additions & 0 deletions
22
...main/java/mod/acgaming/universaltweaks/bugfixes/blocks/bed/UTSleepResetsWeatherMixin.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,22 @@ | ||
package mod.acgaming.universaltweaks.bugfixes.blocks.bed.mixin; | ||
|
||
import net.minecraft.world.WorldServer; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
|
||
import com.llamalad7.mixinextras.injector.WrapWithCondition; | ||
|
||
import mod.acgaming.universaltweaks.config.UTConfigBugfixes; | ||
|
||
// MC-63340 | ||
// https://bugs.mojang.com/browse/MC-63340 | ||
// Courtesy of fonnymunkey | ||
@Mixin(WorldServer.class) | ||
public abstract class UTSleepResetsWeatherMixin | ||
{ | ||
@WrapWithCondition(method = "wakeAllPlayers", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/WorldServer;resetRainAndThunder()V")) | ||
public boolean utWakeAllPlayers(WorldServer instance) | ||
{ | ||
return !UTConfigBugfixes.BLOCKS.utSleepResetsWeatherToggle; | ||
} | ||
} |
42 changes: 42 additions & 0 deletions
42
...n/java/mod/acgaming/universaltweaks/bugfixes/misc/enchantment/UTBlastProtectionMixin.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,42 @@ | ||
package mod.acgaming.universaltweaks.bugfixes.misc.enchantment.mixin; | ||
|
||
import net.minecraft.enchantment.EnchantmentHelper; | ||
import net.minecraft.enchantment.EnchantmentProtection; | ||
import net.minecraft.entity.EntityLivingBase; | ||
import net.minecraft.init.Enchantments; | ||
import net.minecraft.util.math.MathHelper; | ||
|
||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.Overwrite; | ||
|
||
import mod.acgaming.universaltweaks.config.UTConfigBugfixes; | ||
|
||
// MC-198809 | ||
// https://bugs.mojang.com/browse/MC-198809 | ||
// Courtesy of fonnymunkey | ||
@Mixin(EnchantmentProtection.class) | ||
public abstract class UTBlastProtectionMixin | ||
{ | ||
/** | ||
* @author fonnymunkey | ||
* @reason Fix blast protection flooring reduction making it not effective | ||
*/ | ||
@Overwrite | ||
public static double getBlastDamageReduction(EntityLivingBase entityLivingBaseIn, double damage) | ||
{ | ||
int i = EnchantmentHelper.getMaxEnchantmentLevel(Enchantments.BLAST_PROTECTION, entityLivingBaseIn); | ||
|
||
if (i > 0) | ||
{ | ||
if (UTConfigBugfixes.MISC.utBlastProtectionKnockbackToggle) | ||
{ | ||
damage -= damage * Math.min(1D, (double) ((float) i * 0.15F)); | ||
} else | ||
{ | ||
damage -= (double) MathHelper.floor(damage * (double) ((float) i * 0.15F)); | ||
} | ||
} | ||
|
||
return damage; | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"package": "mod.acgaming.universaltweaks.bugfixes.blocks.bed.mixin", | ||
"refmap": "universaltweaks.refmap.json", | ||
"minVersion": "0.8", | ||
"compatibilityLevel": "JAVA_8", | ||
"client": ["UTSleepResetsWeatherMixin"] | ||
} |
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,7 @@ | ||
{ | ||
"package": "mod.acgaming.universaltweaks.bugfixes.misc.enchantment.mixin", | ||
"refmap": "universaltweaks.refmap.json", | ||
"minVersion": "0.8", | ||
"compatibilityLevel": "JAVA_8", | ||
"client": ["UTBlastProtectionMixin"] | ||
} |