Skip to content

Commit

Permalink
5.3.0 - 1.19.4!
Browse files Browse the repository at this point in the history
  • Loading branch information
Dqu1J committed Mar 26, 2023
1 parent 00e1558 commit 50f154c
Show file tree
Hide file tree
Showing 12 changed files with 43 additions and 44 deletions.
6 changes: 3 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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()));
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/dqu/additionaladditions/gui/ConfigGui.java
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/dqu/additionaladditions/gui/ConfirmGui.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
24 changes: 12 additions & 12 deletions src/main/java/dqu/additionaladditions/item/AdditionalArmorItem.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ public class AdditionalArmorItem extends ArmorItem {
private Multimap<Attribute, AttributeModifier> 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) {
Expand All @@ -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<Attribute, AttributeModifier> 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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public InteractionResultHolder<ItemStack> 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());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,11 @@ public boolean overrideOtherStackedOnMe(ItemStack stack, ItemStack otherStack, S
public void appendHoverText(ItemStack stack, @Nullable Level world, List<Component> 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[]{})));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,6 @@ public int getBarWidth(ItemStack stack) {
public void appendHoverText(ItemStack stack, @Nullable Level world, List<Component> 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) );
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/dqu/additionaladditions/mixin/GuiMixin.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,28 +8,25 @@
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());
public static final Item ROSE_GOLD_HOE = new AdditionalHoeItem(RoseGoldToolMaterial.MATERIAL, -2, -1F, new Item.Properties());
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());
Expand Down

0 comments on commit 50f154c

Please sign in to comment.