Update to 1.21.8

This commit is contained in:
2025-07-20 23:18:21 +02:00
parent 977050276c
commit ce0f8643e7
10 changed files with 35 additions and 29 deletions

View File

@@ -1,5 +1,5 @@
plugins { plugins {
id 'fabric-loom' version '1.10-SNAPSHOT' id 'fabric-loom' version '1.11-SNAPSHOT'
id 'maven-publish' id 'maven-publish'
} }

View File

@@ -2,17 +2,17 @@
org.gradle.jvmargs=-Xmx1G org.gradle.jvmargs=-Xmx1G
# Fabric Properties # Fabric Properties
# check these on https://modmuss50.me/fabric.html # check these on https://modmuss50.me/fabric.html
minecraft_version=1.21.5 minecraft_version=1.21.8
yarn_mappings=1.21.5+build.1 yarn_mappings=1.21.8+build.1
loader_version=0.16.13 loader_version=0.16.14
# Mod Properties # Mod Properties
mod_version=2.0.2 mod_version=2.0.3
maven_group=systems.brn maven_group=systems.brn
archives_base_name=plasticgun archives_base_name=plasticgun
# Dependencies # Dependencies
# check this on https://modmuss50.me/fabric.html # check this on https://modmuss50.me/fabric.html
fabric_version=0.120.0+1.21.5 fabric_version=0.129.0+1.21.8
trinkets_version=3.11.0-beta.1+polymerport.1 trinkets_version=3.11.0-beta.1+polymerport.2
polymer_version=0.12.3+1.21.5 polymer_version=0.13.7+1.21.8
server_translations_api_version=2.5.0+1.21.5-rc1 server_translations_api_version=2.5.1+1.21.5

View File

@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-bin.zip distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-bin.zip
networkTimeout=10000 networkTimeout=10000
validateDistributionUrl=true validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME

View File

@@ -36,7 +36,7 @@ public class BulletEntity extends PersistentProjectileEntity implements PolymerE
private final float scale; private final float scale;
public BulletEntity(LivingEntity livingEntity, ItemStack stack, Hand hand, Gun gun, float scale, double damage, float speed, double explosionPower, double repulsionPower, boolean isIncendiary) { public BulletEntity(LivingEntity livingEntity, ItemStack stack, Hand hand, Gun gun, float scale, double damage, float speed, double explosionPower, double repulsionPower, boolean isIncendiary) {
super(BULLET_ENTITY_TYPE, livingEntity.getPos().x, livingEntity.getPos().y + 1.75d, livingEntity.getPos().z, livingEntity.getEntityWorld(), stack, livingEntity.getStackInHand(hand)); super(BULLET_ENTITY_TYPE, livingEntity.getPos().x, livingEntity.getPos().y + 1.75d, livingEntity.getPos().z, livingEntity.getWorld(), stack, livingEntity.getStackInHand(hand));
this.setOwner(livingEntity); this.setOwner(livingEntity);
this.setVelocity(livingEntity, livingEntity.getPitch(), livingEntity.getYaw(), 0.0F, speed, 0); this.setVelocity(livingEntity, livingEntity.getPitch(), livingEntity.getYaw(), 0.0F, speed, 0);
this.pickupType = PickupPermission.DISALLOWED; this.pickupType = PickupPermission.DISALLOWED;

View File

@@ -117,14 +117,14 @@ public class GrenadeItem extends SimpleItem implements PolymerItem {
public void turnIntoEntity(ServerPlayerEntity player, @Nullable ItemStack stack, int speed, int timer) { public void turnIntoEntity(ServerPlayerEntity player, @Nullable ItemStack stack, int speed, int timer) {
GrenadeEntity grenadeEntity = new GrenadeEntity(player, stack, timer, 0.5f, speed, explosionPower, repulsionPower, isIncendiary, isFragmentation, flashBangDuration, stunDuration, smokeTicks, 8, smokeCount); GrenadeEntity grenadeEntity = new GrenadeEntity(player, stack, timer, 0.5f, speed, explosionPower, repulsionPower, isIncendiary, isFragmentation, flashBangDuration, stunDuration, smokeTicks, 8, smokeCount);
player.getServerWorld().spawnEntity(grenadeEntity); player.getWorld().spawnEntity(grenadeEntity);
player.getServerWorld().playSound(null, player.getX(), player.getY(), player.getZ(), SoundEvents.UI_BUTTON_CLICK.value(), SoundCategory.PLAYERS, 1.0f, 2.0f); player.getWorld().playSound(null, player.getX(), player.getY(), player.getZ(), SoundEvents.UI_BUTTON_CLICK.value(), SoundCategory.PLAYERS, 1.0f, 2.0f);
} }
public void turnIntoEntity(Entity entity, @Nullable ItemStack stack, int speed, int timer) { public void turnIntoEntity(Entity entity, @Nullable ItemStack stack, int speed, int timer) {
GrenadeEntity grenadeEntity = new GrenadeEntity(entity.getEntityWorld(), entity.getPos(), stack, timer, 1f, explosionPower, repulsionPower, isIncendiary, isFragmentation, flashBangDuration, stunDuration, smokeTicks, 8, smokeCount); GrenadeEntity grenadeEntity = new GrenadeEntity(entity.getWorld(), entity.getPos(), stack, timer, 1f, explosionPower, repulsionPower, isIncendiary, isFragmentation, flashBangDuration, stunDuration, smokeTicks, 8, smokeCount);
entity.getEntityWorld().spawnEntity(grenadeEntity); entity.getWorld().spawnEntity(grenadeEntity);
entity.getEntityWorld().playSound(null, entity.getX(), entity.getY(), entity.getZ(), SoundEvents.UI_BUTTON_CLICK.value(), SoundCategory.PLAYERS, 1.0f, 2.0f); entity.getWorld().playSound(null, entity.getX(), entity.getY(), entity.getZ(), SoundEvents.UI_BUTTON_CLICK.value(), SoundCategory.PLAYERS, 1.0f, 2.0f);
} }
public void checkExplosions(ServerWorld world, PlayerEntity playerEntity, ItemStack stackInSlot) { public void checkExplosions(ServerWorld world, PlayerEntity playerEntity, ItemStack stackInSlot) {

View File

@@ -79,12 +79,12 @@ public class Gun extends SimpleItem implements PolymerItem {
.maxDamage(clipSize + 1) .maxDamage(clipSize + 1)
, id(path), Items.WOODEN_SWORD , id(path), Items.WOODEN_SWORD
); );
this.verticalRecoilMin = verticalRecoilMin / 10f; this.verticalRecoilMin = verticalRecoilMin / 100f;
this.verticalRecoilMax = verticalRecoilMax / 10f; this.verticalRecoilMax = verticalRecoilMax / 100f;
this.velocityRecoilMin = velocityRecoilMin; this.velocityRecoilMin = velocityRecoilMin;
this.velocityRecoilMax = velocityRecoilMax; this.velocityRecoilMax = velocityRecoilMax;
this.horizontalRecoilMin = horizontalRecoilMin / 10f; this.horizontalRecoilMin = horizontalRecoilMin / 100f;
this.horizontalRecoilMax = horizontalRecoilMax / 10f; this.horizontalRecoilMax = horizontalRecoilMax / 100f;
if (verticalRecoilMin > verticalRecoilMax) { if (verticalRecoilMin > verticalRecoilMax) {
logger.error("verticalRecoilMin > verticalRecoilMax for {}", path); logger.error("verticalRecoilMin > verticalRecoilMax for {}", path);
} }
@@ -255,7 +255,7 @@ public class Gun extends SimpleItem implements PolymerItem {
} }
public int doRecoil(LivingEntity entity) { public int doRecoil(LivingEntity entity) {
if (entity.getEntityWorld() instanceof ServerWorld serverWorld) { if (entity.getWorld() instanceof ServerWorld serverWorld) {
Random rng = entity.getWorld().getRandom(); Random rng = entity.getWorld().getRandom();
// Get the entity's current position and yaw // Get the entity's current position and yaw
Vec3d pos = entity.getPos(); Vec3d pos = entity.getPos();

View File

@@ -147,7 +147,7 @@ public class WeaponShootGoal<T extends HostileEntity & RangedAttackMob> extends
if (itemGunMap.containsKey(gunStack.getItem())) { if (itemGunMap.containsKey(gunStack.getItem())) {
Gun gun = itemGunMap.get(gunStack.getItem()); Gun gun = itemGunMap.get(gunStack.getItem());
// Handle item usage // Handle item usage
gun.reload(this.actor.getEntityWorld(), this.actor, gunHand, this.actor.getRandom(), this.actor.getWorld().getLocalDifficulty(this.actor.getBlockPos())); gun.reload(this.actor.getWorld(), this.actor, gunHand, this.actor.getRandom(), this.actor.getWorld().getLocalDifficulty(this.actor.getBlockPos()));
if (!canSeeTarget && this.targetSeeingTicker < -60) { if (!canSeeTarget && this.targetSeeingTicker < -60) {
this.actor.clearActiveItem(); this.actor.clearActiveItem();
} else if (canSeeTarget) { } else if (canSeeTarget) {
@@ -156,7 +156,7 @@ public class WeaponShootGoal<T extends HostileEntity & RangedAttackMob> extends
int currentCooldown = gunStack.getOrDefault(GUN_COOLDOWN_COMPONENT, 1); int currentCooldown = gunStack.getOrDefault(GUN_COOLDOWN_COMPONENT, 1);
ItemStack chamber = gunStack.getOrDefault(GUN_AMMO_COMPONENT, ItemStack.EMPTY).copy(); ItemStack chamber = gunStack.getOrDefault(GUN_AMMO_COMPONENT, ItemStack.EMPTY).copy();
if (!chamber.isEmpty() && currentReload == 1 && currentCooldown == 0 && lockedTicks >= 10) { if (!chamber.isEmpty() && currentReload == 1 && currentCooldown == 0 && lockedTicks >= 10) {
if (this.actor.getEntityWorld() instanceof ServerWorld serverWorld) { if (this.actor.getWorld() instanceof ServerWorld serverWorld) {
this.targetSeeingTicker -= gun.shoot(serverWorld, this.actor, gunHand); this.targetSeeingTicker -= gun.shoot(serverWorld, this.actor, gunHand);
} }
} }

View File

@@ -38,7 +38,7 @@ public class EventHandler {
} }
public static void rightClickWithItem(ServerPlayerEntity serverPlayerEntity, Hand hand) { public static void rightClickWithItem(ServerPlayerEntity serverPlayerEntity, Hand hand) {
if (serverPlayerEntity.getEntityWorld() instanceof ServerWorld world) { if (serverPlayerEntity.getWorld() instanceof ServerWorld world) {
Item stackInHand = serverPlayerEntity.getStackInHand(hand).getItem(); Item stackInHand = serverPlayerEntity.getStackInHand(hand).getItem();
if (itemGunMap.containsKey(stackInHand)) { if (itemGunMap.containsKey(stackInHand)) {
itemGunMap.get(stackInHand).reload(world, serverPlayerEntity, hand); itemGunMap.get(stackInHand).reload(world, serverPlayerEntity, hand);
@@ -54,7 +54,7 @@ public class EventHandler {
} }
public static void leftClickWithItem(ServerPlayerEntity serverPlayerEntity, Hand hand) { public static void leftClickWithItem(ServerPlayerEntity serverPlayerEntity, Hand hand) {
if (serverPlayerEntity.getEntityWorld() instanceof ServerWorld world) { if (serverPlayerEntity.getWorld() instanceof ServerWorld world) {
ItemStack stackInHand = serverPlayerEntity.getStackInHand(hand); ItemStack stackInHand = serverPlayerEntity.getStackInHand(hand);
Item itemInHand = stackInHand.getItem(); Item itemInHand = stackInHand.getItem();
if (itemGrenadeItemMap.containsKey(itemInHand)) { if (itemGrenadeItemMap.containsKey(itemInHand)) {
@@ -68,7 +68,7 @@ public class EventHandler {
} }
public static void tickItemUpdate(ServerPlayerEntity serverPlayerEntity) { public static void tickItemUpdate(ServerPlayerEntity serverPlayerEntity) {
if (serverPlayerEntity.getEntityWorld() instanceof ServerWorld world) { if (serverPlayerEntity.getWorld() instanceof ServerWorld world) {
Hand hand = serverPlayerEntity.getActiveHand(); Hand hand = serverPlayerEntity.getActiveHand();
ItemStack stackInHand = serverPlayerEntity.getStackInHand(hand); ItemStack stackInHand = serverPlayerEntity.getStackInHand(hand);
Item itemInHand = stackInHand.getItem(); Item itemInHand = stackInHand.getItem();

View File

@@ -135,7 +135,7 @@ public class Util {
int minZ = MathHelper.floor(pos.z - radius - 1.0); int minZ = MathHelper.floor(pos.z - radius - 1.0);
int maxZ = MathHelper.floor(pos.z + radius + 1.0); int maxZ = MathHelper.floor(pos.z + radius + 1.0);
Box box = new Box(minX, minY, minZ, maxX, maxY, maxZ); Box box = new Box(minX, minY, minZ, maxX, maxY, maxZ);
return entity.getEntityWorld().getOtherEntities(entity, box); return entity.getWorld().getOtherEntities(entity, box);
} }
public static void setProjectileData(List<DataTracker.SerializedEntry<?>> data, boolean initial, float scale, ItemStack itemStack) { public static void setProjectileData(List<DataTracker.SerializedEntry<?>> data, boolean initial, float scale, ItemStack itemStack) {
@@ -261,7 +261,13 @@ public class Util {
} }
public static void entityHitParticles(LivingEntity livingEntity, double damage) { public static void entityHitParticles(LivingEntity livingEntity, double damage) {
if (livingEntity.getEntityWorld() instanceof ServerWorld world) { if (livingEntity.getWorld() instanceof ServerWorld world) {
if (livingEntity instanceof ServerPlayerEntity) {
ServerPlayerEntity serverPlayerEntity = (ServerPlayerEntity) livingEntity;
if (serverPlayerEntity.isCreative()) {
return;
}
}
Vec3d pos = livingEntity.getPos(); Vec3d pos = livingEntity.getPos();
int particleCount = (int) damage * 4; // Number of particles int particleCount = (int) damage * 4; // Number of particles
double radius = livingEntity.getWidth() / 2 + 0.5; // Radius of the circle double radius = livingEntity.getWidth() / 2 + 0.5; // Radius of the circle

View File

@@ -37,7 +37,7 @@ public class ThrowableProjectile extends PersistentProjectileEntity implements P
} }
public ThrowableProjectile(EntityType<? extends PersistentProjectileEntity> entityType, ServerPlayerEntity player, ItemStack itemStack, float scale, float speed, double damage, PickupPermission pickupPermission, byte penetration) { public ThrowableProjectile(EntityType<? extends PersistentProjectileEntity> entityType, ServerPlayerEntity player, ItemStack itemStack, float scale, float speed, double damage, PickupPermission pickupPermission, byte penetration) {
super(entityType, player.getPos().x, player.getPos().y + 1.5d, player.getPos().z, player.getServerWorld(), itemStack, itemStack); super(entityType, player.getPos().x, player.getPos().y + 1.5d, player.getPos().z, player.getWorld(), itemStack, itemStack);
this.setOwner(player); this.setOwner(player);
this.setVelocity(player, player.getPitch(), player.getYaw(), 0.0F, speed, 0); this.setVelocity(player, player.getPitch(), player.getYaw(), 0.0F, speed, 0);
this.pickupType = pickupPermission; this.pickupType = pickupPermission;