From ec1aaac4d046502b76af73352520bfa09261f64c Mon Sep 17 00:00:00 2001 From: Patbox Date: Sat, 16 Dec 2023 17:46:19 +0100 Subject: [PATCH] Update to 1.20.4 --- build.gradle | 4 ++-- gradle.properties | 10 +++++----- gradle/wrapper/gradle-wrapper.properties | 2 +- .../pb4/destroythemonument/blocks/WeakGlassBlock.java | 4 ++-- .../pb4/destroythemonument/entities/DtmTntEntity.java | 11 +++++++---- .../game/logic/CaptureGameLogic.java | 2 +- .../game/logic/StandardGameLogic.java | 5 ++++- 7 files changed, 22 insertions(+), 16 deletions(-) diff --git a/build.gradle b/build.gradle index 49cc657..40ef77b 100644 --- a/build.gradle +++ b/build.gradle @@ -1,5 +1,5 @@ plugins { - id 'fabric-loom' version '1.0.+' + id 'fabric-loom' version '1.4.+' id 'maven-publish' } @@ -28,7 +28,7 @@ dependencies { modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}" // Plasmid - modImplementation "xyz.nucleoid:plasmid:0.5+1.20.1-SNAPSHOT" + modImplementation "xyz.nucleoid:plasmid:0.5.102-SNAPSHOT+1.20.4" //modImplementation "xyz.nucleoid:substrate:0.1.3" //implementation include('kdotjpg:open-simplex:2.0') } diff --git a/gradle.properties b/gradle.properties index 343bfa1..36164a9 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,14 +3,14 @@ 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.1 -loader_version=0.14.21 +minecraft_version=1.20.4 +yarn_mappings=1.20.4+build.1 +loader_version=0.15.2 # Dependencies -fabric_version=0.83.0+1.20.1 +fabric_version=0.91.1+1.20.4 # Mod Properties -mod_version=1.0.4 +mod_version=1.0.5 maven_group=eu.pb4 archives_base_name=destroythemonument diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index e750102..e411586 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.3-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/src/main/java/eu/pb4/destroythemonument/blocks/WeakGlassBlock.java b/src/main/java/eu/pb4/destroythemonument/blocks/WeakGlassBlock.java index 17a7958..16f4dc0 100644 --- a/src/main/java/eu/pb4/destroythemonument/blocks/WeakGlassBlock.java +++ b/src/main/java/eu/pb4/destroythemonument/blocks/WeakGlassBlock.java @@ -4,7 +4,7 @@ import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.block.Blocks; -import net.minecraft.block.GlassBlock; +import net.minecraft.block.TransparentBlock; import net.minecraft.entity.projectile.ProjectileEntity; import net.minecraft.item.ItemStack; import net.minecraft.server.network.ServerPlayerEntity; @@ -14,7 +14,7 @@ import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; -public class WeakGlassBlock extends GlassBlock implements PolymerBlock { +public class WeakGlassBlock extends TransparentBlock implements PolymerBlock { public WeakGlassBlock(Settings settings) { super(settings); } diff --git a/src/main/java/eu/pb4/destroythemonument/entities/DtmTntEntity.java b/src/main/java/eu/pb4/destroythemonument/entities/DtmTntEntity.java index 4f1d076..0d84ea1 100644 --- a/src/main/java/eu/pb4/destroythemonument/entities/DtmTntEntity.java +++ b/src/main/java/eu/pb4/destroythemonument/entities/DtmTntEntity.java @@ -13,7 +13,9 @@ import net.minecraft.fluid.FluidState; import net.minecraft.nbt.NbtCompound; import net.minecraft.network.packet.s2c.play.ExplosionS2CPacket; +import net.minecraft.particle.ParticleTypes; import net.minecraft.server.network.ServerPlayerEntity; +import net.minecraft.sound.SoundEvents; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Box; import net.minecraft.util.math.MathHelper; @@ -233,7 +235,7 @@ private void explode() { for (var player : this.getWorld().getPlayers()) { ServerPlayerEntity serverPlayerEntity = (ServerPlayerEntity)player; if (serverPlayerEntity.squaredDistanceTo(this.getX(), this.getBodyY(0.0625D), this.getZ()) < 4096.0D) { - serverPlayerEntity.networkHandler.sendPacket(new ExplosionS2CPacket(this.getX(), this.getBodyY(0.0625D), this.getZ(), 3, explosion.getAffectedBlocks(), explosion.getAffectedPlayers().get(serverPlayerEntity))); + serverPlayerEntity.networkHandler.sendPacket(new ExplosionS2CPacket(this.getX(), this.getBodyY(0.0625D), this.getZ(), 3, explosion.getAffectedBlocks(), explosion.getAffectedPlayers().get(serverPlayerEntity), explosion.getDestructionType(), explosion.getEmitterParticle(), explosion.getParticle(), explosion.getSoundEvent())); } } } @@ -256,9 +258,10 @@ public static class CustomExplosion extends Explosion { private final double y; private final float power; private final ExplosionBehavior behavior; + private final DamageSource damageSource; public CustomExplosion(World world, @Nullable Entity entity, @Nullable DamageSource damageSource, @Nullable ExplosionBehavior behavior, double x, double y, double z, float power, boolean createFire, DestructionType destructionType) { - super(world, entity, damageSource, behavior, x, y, z, power, createFire, destructionType); + super(world, entity, damageSource, behavior, x, y, z, power, createFire, destructionType, ParticleTypes.EXPLOSION, ParticleTypes.EXPLOSION_EMITTER, SoundEvents.ENTITY_GENERIC_EXPLODE); this.world = world; this.entity = entity; this.x = x; @@ -266,6 +269,7 @@ public CustomExplosion(World world, @Nullable Entity entity, @Nullable DamageSou this.z = z; this.power = power; this.behavior = behavior; + this.damageSource = damageSource; } @Override @@ -329,10 +333,9 @@ public void collectBlocksAndDamageEntities() { int u = MathHelper.floor(this.z + (double) q + 1.0D); List list = this.world.getOtherEntities(this.entity, new Box(k, r, t, l, s, u)); Vec3d vec3d = new Vec3d(this.x, this.y, this.z); - var damageSource = this.getDamageSource(); for (int v = 0; v < list.size(); ++v) { Entity entity = list.get(v); - if (!entity.isImmuneToExplosion()) { + if (!entity.isImmuneToExplosion(this)) { double w = Math.sqrt(entity.squaredDistanceTo(vec3d)) / (double) q; if (w <= 1.0D) { double x = entity.getX() - this.x; diff --git a/src/main/java/eu/pb4/destroythemonument/game/logic/CaptureGameLogic.java b/src/main/java/eu/pb4/destroythemonument/game/logic/CaptureGameLogic.java index 935f35a..f60e1ff 100644 --- a/src/main/java/eu/pb4/destroythemonument/game/logic/CaptureGameLogic.java +++ b/src/main/java/eu/pb4/destroythemonument/game/logic/CaptureGameLogic.java @@ -146,7 +146,7 @@ protected ActionResult onPlayerBreakBlock(ServerPlayerEntity player, ServerWorld this.maybeEliminate(oldTeam); this.teams.getManager().playersIn(oldTeam.team).playSound(SoundEvents.ENTITY_WITHER_SPAWN, SoundCategory.MASTER, 0.6f, 1f); } - this.gameSpace.getPlayers().sendPacket(new ExplosionS2CPacket((double) blockPos.getX() + 0.5, (double) blockPos.getY() + 0.5, (double) blockPos.getZ() + 0.5, 1f, new ArrayList<>(), new Vec3d(0.0, 0.0, 0.0))); + //this.gameSpace.getPlayers().sendPacket(new ExplosionS2CPacket((double) blockPos.getX() + 0.5, (double) blockPos.getY() + 0.5, (double) blockPos.getZ() + 0.5, 1f, new ArrayList<>(), new Vec3d(0.0, 0.0, 0.0))); playerData.brokenMonuments += 1; playerData.addToTimers(20 * 20); //this.statistics.forPlayer(player).increment(DtmStatistics.MONUMENTS_DESTROYED, 1); diff --git a/src/main/java/eu/pb4/destroythemonument/game/logic/StandardGameLogic.java b/src/main/java/eu/pb4/destroythemonument/game/logic/StandardGameLogic.java index f72054c..7e29ebe 100644 --- a/src/main/java/eu/pb4/destroythemonument/game/logic/StandardGameLogic.java +++ b/src/main/java/eu/pb4/destroythemonument/game/logic/StandardGameLogic.java @@ -12,6 +12,7 @@ import eu.pb4.destroythemonument.other.FormattingUtil; import it.unimi.dsi.fastutil.objects.Object2ObjectMap; import net.minecraft.network.packet.s2c.play.ExplosionS2CPacket; +import net.minecraft.particle.ParticleTypes; import net.minecraft.server.network.ServerPlayerEntity; import net.minecraft.server.world.ServerWorld; import net.minecraft.sound.SoundCategory; @@ -24,6 +25,8 @@ import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Vec3d; import net.minecraft.world.GameMode; +import net.minecraft.world.explosion.Explosion; +import net.minecraft.world.explosion.ExplosionBehavior; import xyz.nucleoid.plasmid.game.GameActivity; import xyz.nucleoid.plasmid.game.GameSpace; import xyz.nucleoid.plasmid.game.common.team.GameTeamKey; @@ -95,7 +98,7 @@ protected ActionResult onPlayerBreakBlock(ServerPlayerEntity player, ServerWorld this.gameSpace.getPlayers().sendMessage(text); this.maybeEliminate(monument.teamData); - this.gameSpace.getPlayers().sendPacket(new ExplosionS2CPacket((double) blockPos.getX() + 0.5, (double) blockPos.getY() + 0.5, (double) blockPos.getZ() + 0.5, 1f, new ArrayList<>(), new Vec3d(0.0, 0.0, 0.0))); + this.gameSpace.getPlayers().sendPacket(new ExplosionS2CPacket((double) blockPos.getX() + 0.5, (double) blockPos.getY() + 0.5, (double) blockPos.getZ() + 0.5, 1f, new ArrayList<>(), new Vec3d(0.0, 0.0, 0.0), Explosion.DestructionType.DESTROY, ParticleTypes.EXPLOSION, ParticleTypes.EXPLOSION_EMITTER, SoundEvents.ENTITY_GENERIC_EXPLODE)); this.teams.getManager().playersIn(monument.teamData.team).playSound(SoundEvents.ENTITY_WITHER_SPAWN, SoundCategory.MASTER, 0.6f, 1f); playerData.brokenMonuments += 1; playerData.addToTimers(20 * 20);