Skip to content

Commit

Permalink
Update to 1.20.4 (#53)
Browse files Browse the repository at this point in the history
Co-authored-by: ellieisjelly <[email protected]>
  • Loading branch information
ellieisjelly and ellieisjelly authored Feb 11, 2024
1 parent a27efa7 commit 6ca75fc
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 20 deletions.
10 changes: 5 additions & 5 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ org.gradle.jvmargs=-Xmx1G

# Fabric Properties
# check these on https://modmuss50.me/fabric.html
minecraft_version=1.20.1
yarn_mappings=1.20.1+build.10
loader_version=0.14.21
minecraft_version=1.20.4
yarn_mappings=1.20.4+build.3
loader_version=0.15.0

# Mod Properties
mod_version=1.0.0
Expand All @@ -14,7 +14,7 @@ archives_base_name=skywars

# Dependencies
# check these on https://modmuss50.me/fabric.html
fabric_version=0.83.1+1.20.1
fabric_version=0.91.1+1.20.4

# check this on https://ci.gegy.dev/job/plasmid/
plasmid_version=0.5.100+1.20.1
plasmid_version=0.5.102-SNAPSHOT+1.20.4
18 changes: 7 additions & 11 deletions src/main/java/us/potatoboy/skywars/mixin/ExplosionMixin.java
Original file line number Diff line number Diff line change
@@ -1,30 +1,26 @@
package us.potatoboy.skywars.mixin;

import net.minecraft.entity.Entity;
import net.minecraft.util.ActionResult;
import net.minecraft.world.World;
import net.minecraft.world.explosion.Explosion;
import org.spongepowered.asm.mixin.Final;
import net.minecraft.world.explosion.ExplosionBehavior;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.Constant;
import org.spongepowered.asm.mixin.injection.ModifyConstant;
import us.potatoboy.skywars.SkyWars;
import xyz.nucleoid.plasmid.game.manager.GameSpaceManager;

@Mixin(Explosion.class)
@Mixin(ExplosionBehavior.class)
public abstract class ExplosionMixin {
@Final
@Shadow
private World world;

@ModifyConstant(method = "collectBlocksAndDamageEntities", constant = @Constant(doubleValue = 7.0))
private double reduceDamage(double original) {
var gameSpace = GameSpaceManager.get().byWorld(this.world);

@ModifyConstant(method = "calculateDamage", constant = @Constant(doubleValue = 7.0))
private double reduceDamage(double original, Explosion explosion, Entity entity) {
var gameSpace = GameSpaceManager.get().byWorld(entity.getWorld());

if (gameSpace != null && gameSpace.getBehavior().testRule(SkyWars.REDUCED_EXPLOSION_DAMAGE) == ActionResult.SUCCESS) {
return 4.0D;
}

return original;
}
}
8 changes: 4 additions & 4 deletions src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
"skywars.mixins.json"
],
"depends": {
"fabricloader": ">=0.11.6",
"fabric": "*",
"minecraft": ">=1.19",
"plasmid": "0.5.x"
"fabricloader": ">=0.15.0",
"fabric-api": "*",
"minecraft": ">=1.20.4",
"plasmid": ">=0.5.1"
}
}

0 comments on commit 6ca75fc

Please sign in to comment.