From 50f154c4b5eb6967457102e0c11759f92518b223 Mon Sep 17 00:00:00 2001 From: Dqu1J Date: Sun, 26 Mar 2023 14:41:26 +0100 Subject: [PATCH] 5.3.0 - 1.19.4! --- gradle.properties | 6 ++--- .../entity/GlowStickEntity.java | 2 +- .../additionaladditions/gui/ConfigGui.java | 2 +- .../additionaladditions/gui/ConfirmGui.java | 4 ++-- .../item/AdditionalArmorItem.java | 24 +++++++++---------- .../item/DepthMeterItem.java | 2 +- .../item/PocketJukeboxItem.java | 4 ++-- .../item/WateringCanItem.java | 2 +- .../GildedNetheriteArmorMaterial.java | 9 +++---- .../material/RoseGoldArmorMaterial.java | 9 +++---- .../additionaladditions/mixin/GuiMixin.java | 2 +- .../registry/AdditionalMaterials.java | 21 +++++++--------- 12 files changed, 43 insertions(+), 44 deletions(-) diff --git a/gradle.properties b/gradle.properties index 7613999..32175d7 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,14 +2,14 @@ org.gradle.jvmargs=-Xmx1G # Fabric Properties # check these on https://modmuss50.me/fabric.html - minecraft_version=1.19.3 + minecraft_version=1.19.4 loader_version=0.14.4 # Mod Properties - mod_version=5.2.0 + mod_version=5.3.0 maven_group=AdditionalAdditions archives_base_name=AdditionalAdditions # Dependencies - fabric_version=0.74.0+1.19.3 + fabric_version=0.75.3+1.19.4 modmenu_version=5.0.2 libgui_version=6.5.2+1.19.3 lambdynamiclights_version=2.2.0+1.19.3 \ No newline at end of file diff --git a/src/main/java/dqu/additionaladditions/entity/GlowStickEntity.java b/src/main/java/dqu/additionaladditions/entity/GlowStickEntity.java index d0eaf6d..49b2cde 100644 --- a/src/main/java/dqu/additionaladditions/entity/GlowStickEntity.java +++ b/src/main/java/dqu/additionaladditions/entity/GlowStickEntity.java @@ -38,7 +38,7 @@ protected void onHit(HitResult hitResult) { super.onHit(hitResult); if (!this.level.isClientSide()) { this.remove(RemovalReason.DISCARDED); - BlockPos pos = new BlockPos(this.getX(), this.getY(), this.getZ()); + BlockPos pos = BlockPos.containing(this.getX(), this.getY(), this.getZ()); if (this.level.getBlockState(pos).isAir()) { this.level.setBlockAndUpdate(pos, AdditionalBlocks.GLOW_STICK_BLOCK.defaultBlockState() .setValue(GlowStickBlock.FLIPPED, level.getRandom().nextBoolean())); diff --git a/src/main/java/dqu/additionaladditions/gui/ConfigGui.java b/src/main/java/dqu/additionaladditions/gui/ConfigGui.java index 1f677e9..0805f36 100644 --- a/src/main/java/dqu/additionaladditions/gui/ConfigGui.java +++ b/src/main/java/dqu/additionaladditions/gui/ConfigGui.java @@ -15,7 +15,7 @@ import net.minecraft.network.chat.contents.TranslatableContents; public class ConfigGui extends LightweightGuiDescription { - private static final Component OPTION_DONE = MutableComponent.create(new TranslatableContents("gui.done")); + private static final Component OPTION_DONE = MutableComponent.create(new TranslatableContents("gui.done", null, new String[]{})); private static final Component SCREEN_TITLE = MutableComponent.create(new LiteralContents("Additional Additions ")).withStyle(ChatFormatting.BOLD).append(MutableComponent.create(new LiteralContents("options.title"))); public ConfigGui() { diff --git a/src/main/java/dqu/additionaladditions/gui/ConfirmGui.java b/src/main/java/dqu/additionaladditions/gui/ConfirmGui.java index 0d2a773..79d0b3e 100644 --- a/src/main/java/dqu/additionaladditions/gui/ConfirmGui.java +++ b/src/main/java/dqu/additionaladditions/gui/ConfirmGui.java @@ -14,8 +14,8 @@ public class ConfirmGui extends LightweightGuiDescription { private static final Component SCREEN_TITLE = MutableComponent.create(new LiteralContents("Additional Additions ")).withStyle(ChatFormatting.BOLD); - private static final Component OPTION_DONE = MutableComponent.create(new TranslatableContents("gui.done")); - private static final Component DESCRIPTION = MutableComponent.create(new TranslatableContents("additionaladditions.gui.config.restart")); + private static final Component OPTION_DONE = MutableComponent.create(new TranslatableContents("gui.done", null, new String[]{})); + private static final Component DESCRIPTION = MutableComponent.create(new TranslatableContents("additionaladditions.gui.config.restart", null, new String[]{})); public ConfirmGui() { WGridPanel root = (WGridPanel) rootPanel; diff --git a/src/main/java/dqu/additionaladditions/item/AdditionalArmorItem.java b/src/main/java/dqu/additionaladditions/item/AdditionalArmorItem.java index 2db57a4..10612a2 100644 --- a/src/main/java/dqu/additionaladditions/item/AdditionalArmorItem.java +++ b/src/main/java/dqu/additionaladditions/item/AdditionalArmorItem.java @@ -19,9 +19,9 @@ public class AdditionalArmorItem extends ArmorItem { private Multimap modifiers = null; private int previousLoads = BehaviourManager.loads; - public AdditionalArmorItem(ArmorMaterial armorMaterial, EquipmentSlot equipmentSlot, Properties properties) { - super(armorMaterial, equipmentSlot, properties); - rebuildModifiers(equipmentSlot); + public AdditionalArmorItem(ArmorMaterial armorMaterial, Type type, Properties properties) { + super(armorMaterial, type, properties); + rebuildModifiers(type.getSlot()); } private void rebuildModifiers(EquipmentSlot slot) { @@ -37,40 +37,40 @@ private void rebuildModifiers(EquipmentSlot slot) { private void rebuildModifiersIfNeeded() { if (modifiers == null) { - rebuildModifiers(getSlot()); + rebuildModifiers(getType().getSlot()); return; } if (previousLoads != BehaviourManager.loads) { previousLoads = BehaviourManager.loads; - rebuildModifiers(getSlot()); + rebuildModifiers(getType().getSlot()); } } @Override public Multimap getDefaultAttributeModifiers(EquipmentSlot equipmentSlot) { rebuildModifiersIfNeeded(); - return (getSlot() == equipmentSlot) ? this.modifiers : super.getDefaultAttributeModifiers(equipmentSlot); + return (getType().getSlot() == equipmentSlot) ? this.modifiers : super.getDefaultAttributeModifiers(equipmentSlot); } @Override public float getToughness() { - if (getSlot().getIndex() > 3 || slot.getIndex() < 0) return super.getToughness(); - String path = getMaterial().getName() + "/" + slotIndexToName(getSlot().getIndex()); + if (getType().getSlot().getIndex() > 3 || getType().getSlot().getIndex() < 0) return super.getToughness(); + String path = getMaterial().getName() + "/" + slotIndexToName(getType().getSlot().getIndex()); Float toughness = BehaviourManager.INSTANCE.getBehaviourValue(path, BehaviourValues.TOUGHNESS); return (toughness == null) ? super.getToughness() : toughness; } @Override public int getDefense() { - if (getSlot().getIndex() > 3 || slot.getIndex() < 0) return super.getDefense(); - String path = getMaterial().getName() + "/" + slotIndexToName(getSlot().getIndex()); + if (getType().getSlot().getIndex() > 3 || getType().getSlot().getIndex() < 0) return super.getDefense(); + String path = getMaterial().getName() + "/" + slotIndexToName(getType().getSlot().getIndex()); Integer defense = BehaviourManager.INSTANCE.getBehaviourValue(path, BehaviourValues.DEFENSE); return (defense == null) ? super.getDefense() : defense; } public float getKnockbackResistance() { - if (getSlot().getIndex() > 3 || slot.getIndex() < 0) return 0; - String path = getMaterial().getName() + "/" + slotIndexToName(getSlot().getIndex()); + if (getType().getSlot().getIndex() > 3 || getType().getSlot().getIndex() < 0) return 0; + String path = getMaterial().getName() + "/" + slotIndexToName(getType().getSlot().getIndex()); Float knockback = BehaviourManager.INSTANCE.getBehaviourValue(path, BehaviourValues.KNOCKBACK_RESISTANCE); return (knockback == null) ? super.knockbackResistance : knockback; } diff --git a/src/main/java/dqu/additionaladditions/item/DepthMeterItem.java b/src/main/java/dqu/additionaladditions/item/DepthMeterItem.java index 75af0b4..57393fd 100644 --- a/src/main/java/dqu/additionaladditions/item/DepthMeterItem.java +++ b/src/main/java/dqu/additionaladditions/item/DepthMeterItem.java @@ -24,7 +24,7 @@ public InteractionResultHolder use(Level world, Player user, Interact if (!Config.getBool(ConfigValues.DEPTH_METER, "displayElevationAlways")) { ItemStack itemStack = user.getItemInHand(hand); - user.displayClientMessage(MutableComponent.create(new TranslatableContents("depth_meter.elevation", user.getBlockY())), true); + user.displayClientMessage(MutableComponent.create(new TranslatableContents("depth_meter.elevation", null, new String[]{String.valueOf(user.getBlockY())})), true); return InteractionResultHolder.sidedSuccess(itemStack, world.isClientSide()); } diff --git a/src/main/java/dqu/additionaladditions/item/PocketJukeboxItem.java b/src/main/java/dqu/additionaladditions/item/PocketJukeboxItem.java index e8c72b0..55961f1 100644 --- a/src/main/java/dqu/additionaladditions/item/PocketJukeboxItem.java +++ b/src/main/java/dqu/additionaladditions/item/PocketJukeboxItem.java @@ -109,11 +109,11 @@ public boolean overrideOtherStackedOnMe(ItemStack stack, ItemStack otherStack, S public void appendHoverText(ItemStack stack, @Nullable Level world, List tooltip, TooltipFlag context) { String disc = nbtGetDisc(stack); if (disc == null) { - tooltip.add(MutableComponent.create(new TranslatableContents("additionaladditions.gui.pocket_jukebox.tooltip")).setStyle(Style.EMPTY.withColor(ChatFormatting.GRAY))); + tooltip.add(MutableComponent.create(new TranslatableContents("additionaladditions.gui.pocket_jukebox.tooltip", null, new String[]{})).setStyle(Style.EMPTY.withColor(ChatFormatting.GRAY))); } else { Item discItem = BuiltInRegistries.ITEM.get(new ResourceLocation(disc)); String description = discItem.getDescriptionId() + ".desc"; - tooltip.add(MutableComponent.create(new TranslatableContents(description))); + tooltip.add(MutableComponent.create(new TranslatableContents(description, null, new String[]{}))); } } } diff --git a/src/main/java/dqu/additionaladditions/item/WateringCanItem.java b/src/main/java/dqu/additionaladditions/item/WateringCanItem.java index 0df5070..db609d9 100644 --- a/src/main/java/dqu/additionaladditions/item/WateringCanItem.java +++ b/src/main/java/dqu/additionaladditions/item/WateringCanItem.java @@ -106,6 +106,6 @@ public int getBarWidth(ItemStack stack) { public void appendHoverText(ItemStack stack, @Nullable Level world, List tooltip, TooltipFlag context) { int water = (int) (stack.getDamageValue() * 0.1); String tooltipText = String.format(": %s / 10", water); - tooltip.add(MutableComponent.create(new TranslatableContents("block.minecraft.water")).append(tooltipText).withStyle(ChatFormatting.AQUA) ); + tooltip.add(MutableComponent.create(new TranslatableContents("block.minecraft.water", null, new String[]{})).append(tooltipText).withStyle(ChatFormatting.AQUA) ); } } diff --git a/src/main/java/dqu/additionaladditions/material/GildedNetheriteArmorMaterial.java b/src/main/java/dqu/additionaladditions/material/GildedNetheriteArmorMaterial.java index 73a3dd7..49e5507 100644 --- a/src/main/java/dqu/additionaladditions/material/GildedNetheriteArmorMaterial.java +++ b/src/main/java/dqu/additionaladditions/material/GildedNetheriteArmorMaterial.java @@ -7,6 +7,7 @@ import net.minecraft.sounds.SoundEvent; import net.minecraft.sounds.SoundEvents; import net.minecraft.world.entity.EquipmentSlot; +import net.minecraft.world.item.ArmorItem; import net.minecraft.world.item.ArmorMaterial; import net.minecraft.world.item.Items; import net.minecraft.world.item.crafting.Ingredient; @@ -19,13 +20,13 @@ public class GildedNetheriteArmorMaterial implements ArmorMaterial { public static final String NAME = "gilded_netherite"; @Override - public int getDurabilityForSlot(EquipmentSlot slot) { - return BASE_DURABILITY[slot.getIndex()]; + public int getDurabilityForType(ArmorItem.Type type) { + return BASE_DURABILITY[type.getSlot().getIndex()]; } @Override - public int getDefenseForSlot(EquipmentSlot slot) { - return PROTECTION_VALUES[slot.getIndex()]; + public int getDefenseForType(ArmorItem.Type type) { + return PROTECTION_VALUES[type.getSlot().getIndex()]; } @Override diff --git a/src/main/java/dqu/additionaladditions/material/RoseGoldArmorMaterial.java b/src/main/java/dqu/additionaladditions/material/RoseGoldArmorMaterial.java index 490e0bc..0b9dbaa 100644 --- a/src/main/java/dqu/additionaladditions/material/RoseGoldArmorMaterial.java +++ b/src/main/java/dqu/additionaladditions/material/RoseGoldArmorMaterial.java @@ -3,6 +3,7 @@ import net.minecraft.sounds.SoundEvent; import net.minecraft.sounds.SoundEvents; import net.minecraft.world.entity.EquipmentSlot; +import net.minecraft.world.item.ArmorItem; import net.minecraft.world.item.ArmorMaterial; import net.minecraft.world.item.Items; import net.minecraft.world.item.crafting.Ingredient; @@ -15,13 +16,13 @@ public class RoseGoldArmorMaterial implements ArmorMaterial { public static final String NAME = "rose_gold"; @Override - public int getDurabilityForSlot(EquipmentSlot slot) { - return BASE_DURABILITY[slot.getIndex()]; + public int getDurabilityForType(ArmorItem.Type type) { + return BASE_DURABILITY[type.getSlot().getIndex()]; } @Override - public int getDefenseForSlot(EquipmentSlot slot) { - return PROTECTION_VALUES[slot.getIndex()]; + public int getDefenseForType(ArmorItem.Type type) { + return PROTECTION_VALUES[type.getSlot().getIndex()]; } @Override diff --git a/src/main/java/dqu/additionaladditions/mixin/GuiMixin.java b/src/main/java/dqu/additionaladditions/mixin/GuiMixin.java index 2c191f1..b157c5d 100644 --- a/src/main/java/dqu/additionaladditions/mixin/GuiMixin.java +++ b/src/main/java/dqu/additionaladditions/mixin/GuiMixin.java @@ -32,7 +32,7 @@ private void depthMeterMessage(CallbackInfo ci) { if (minecraft.player.isHolding(AdditionalItems.DEPTH_METER_ITEM)) { if (Config.getBool(ConfigValues.DEPTH_METER, "displayElevationAlways")) { String level = String.valueOf((int) minecraft.player.getY()); - minecraft.player.displayClientMessage(MutableComponent.create(new TranslatableContents("depth_meter.elevation", level)), true); + minecraft.player.displayClientMessage(MutableComponent.create(new TranslatableContents("depth_meter.elevation", null, new String[]{level})), true); } } } diff --git a/src/main/java/dqu/additionaladditions/registry/AdditionalMaterials.java b/src/main/java/dqu/additionaladditions/registry/AdditionalMaterials.java index 57c8d21..18787ff 100644 --- a/src/main/java/dqu/additionaladditions/registry/AdditionalMaterials.java +++ b/src/main/java/dqu/additionaladditions/registry/AdditionalMaterials.java @@ -8,17 +8,14 @@ import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.entity.EquipmentSlot; -import net.minecraft.world.item.ArmorMaterial; -import net.minecraft.world.item.CreativeModeTabs; -import net.minecraft.world.item.Item; -import net.minecraft.world.item.Items; +import net.minecraft.world.item.*; public class AdditionalMaterials { public static final ArmorMaterial ROSE_GOLD_ARMOR_MATERIAL = new RoseGoldArmorMaterial(); - public static final Item ROSE_GOLD_HELMET = new AdditionalArmorItem(ROSE_GOLD_ARMOR_MATERIAL, EquipmentSlot.HEAD, new Item.Properties()); - public static final Item ROSE_GOLD_CHESTPLATE = new AdditionalArmorItem(ROSE_GOLD_ARMOR_MATERIAL, EquipmentSlot.CHEST, new Item.Properties()); - public static final Item ROSE_GOLD_LEGGINGS = new AdditionalArmorItem(ROSE_GOLD_ARMOR_MATERIAL, EquipmentSlot.LEGS, new Item.Properties()); - public static final Item ROSE_GOLD_BOOTS = new AdditionalArmorItem(ROSE_GOLD_ARMOR_MATERIAL, EquipmentSlot.FEET, new Item.Properties()); + public static final Item ROSE_GOLD_HELMET = new AdditionalArmorItem(ROSE_GOLD_ARMOR_MATERIAL, ArmorItem.Type.HELMET, new Item.Properties()); + public static final Item ROSE_GOLD_CHESTPLATE = new AdditionalArmorItem(ROSE_GOLD_ARMOR_MATERIAL, ArmorItem.Type.CHESTPLATE, new Item.Properties()); + public static final Item ROSE_GOLD_LEGGINGS = new AdditionalArmorItem(ROSE_GOLD_ARMOR_MATERIAL, ArmorItem.Type.LEGGINGS, new Item.Properties()); + public static final Item ROSE_GOLD_BOOTS = new AdditionalArmorItem(ROSE_GOLD_ARMOR_MATERIAL, ArmorItem.Type.BOOTS, new Item.Properties()); public static final Item ROSE_GOLD_SWORD = new AdditionalSwordItem(RoseGoldToolMaterial.MATERIAL, 4, -2.4F, new Item.Properties()); public static final Item ROSE_GOLD_PICKAXE = new AdditionalPickaxeItem(RoseGoldToolMaterial.MATERIAL, 1, -2.8F, new Item.Properties()); public static final Item ROSE_GOLD_AXE = new AdditionalAxeItem(RoseGoldToolMaterial.MATERIAL, 6, -3.1F, new Item.Properties()); @@ -26,10 +23,10 @@ public class AdditionalMaterials { public static final Item ROSE_GOLD_SHOVEL = new AdditionalShovelItem(RoseGoldToolMaterial.MATERIAL, 1.5F, -3F, new Item.Properties()); public static final ArmorMaterial GILDED_NETHERITE_ARMOR_MATERIAL = new GildedNetheriteArmorMaterial(); - public static final Item GILDED_NETHERITE_HELMET = new AdditionalArmorItem(GILDED_NETHERITE_ARMOR_MATERIAL, EquipmentSlot.HEAD, new Item.Properties().fireResistant()); - public static final Item GILDED_NETHERITE_CHESTPLATE = new AdditionalArmorItem(GILDED_NETHERITE_ARMOR_MATERIAL, EquipmentSlot.CHEST, new Item.Properties().fireResistant()); - public static final Item GILDED_NETHERITE_LEGGINGS = new AdditionalArmorItem(GILDED_NETHERITE_ARMOR_MATERIAL, EquipmentSlot.LEGS, new Item.Properties().fireResistant()); - public static final Item GILDED_NETHERITE_BOOTS = new AdditionalArmorItem(GILDED_NETHERITE_ARMOR_MATERIAL, EquipmentSlot.FEET, new Item.Properties().fireResistant()); + public static final Item GILDED_NETHERITE_HELMET = new AdditionalArmorItem(GILDED_NETHERITE_ARMOR_MATERIAL, ArmorItem.Type.HELMET, new Item.Properties().fireResistant()); + public static final Item GILDED_NETHERITE_CHESTPLATE = new AdditionalArmorItem(GILDED_NETHERITE_ARMOR_MATERIAL, ArmorItem.Type.CHESTPLATE, new Item.Properties().fireResistant()); + public static final Item GILDED_NETHERITE_LEGGINGS = new AdditionalArmorItem(GILDED_NETHERITE_ARMOR_MATERIAL, ArmorItem.Type.LEGGINGS, new Item.Properties().fireResistant()); + public static final Item GILDED_NETHERITE_BOOTS = new AdditionalArmorItem(GILDED_NETHERITE_ARMOR_MATERIAL, ArmorItem.Type.BOOTS, new Item.Properties().fireResistant()); public static final Item GILDED_NETHERITE_SWORD = new AdditionalSwordItem(GildedNetheriteToolMaterial.MATERIAL, 5, -2.4F, new Item.Properties().fireResistant()); public static final Item GILDED_NETHERITE_PICKAXE = new AdditionalPickaxeItem(GildedNetheriteToolMaterial.MATERIAL, 3, -2.6F, new Item.Properties().fireResistant()); public static final Item GILDED_NETHERITE_AXE = new AdditionalAxeItem(GildedNetheriteToolMaterial.MATERIAL, 7, -3F, new Item.Properties().fireResistant());