Skip to content

Commit

Permalink
Update to 1.20.4
Browse files Browse the repository at this point in the history
  • Loading branch information
Patbox committed Dec 16, 2023
1 parent 564c2c5 commit ec1aaac
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 16 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'fabric-loom' version '1.0.+'
id 'fabric-loom' version '1.4.+'
id 'maven-publish'
}

Expand Down Expand Up @@ -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')
}
Expand Down
10 changes: 5 additions & 5 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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()));
}
}
}
Expand All @@ -256,16 +258,18 @@ 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;
this.y = y;
this.z = z;
this.power = power;
this.behavior = behavior;
this.damageSource = damageSource;
}

@Override
Expand Down Expand Up @@ -329,10 +333,9 @@ public void collectBlocksAndDamageEntities() {
int u = MathHelper.floor(this.z + (double) q + 1.0D);
List<Entity> 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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit ec1aaac

Please sign in to comment.