Skip to content

Commit c900e6f

Browse files
committed
Fix crashes 2 and configurable elytra armor points
1 parent b9c7225 commit c900e6f

7 files changed

Lines changed: 31 additions & 25 deletions

File tree

common/src/main/java/com/oroarmor/netherite_plus/config/NetheritePlusConfig.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,9 @@ public static class DAMAGE extends ConfigItemGroup {
5454
public static final ConfigItem<Double> CROSSBOW_DAMAGE_MULTIPLIER = new ConfigItem<>("crossbow_damage_multiplier", 1d, "config.netherite_plus.damage.crossbow_damage_multiplier");
5555
public static final ConfigItem<Double> TRIDENT_DAMAGE_ADDITION = new ConfigItem<>("trident_damage_addition", 0d, "config.netherite_plus.damage.trident_damage_addition");
5656
public static final ConfigItem<Double> TRIDENT_DAMAGE_MULTIPLIER = new ConfigItem<>("trident_damage_multiplier", 1d, "config.netherite_plus.damage.trident_damage_multiplier");
57+
public static final ConfigItem<Integer> ELYTRA_ARMOR_POINTS = new ConfigItem("elytra_armor_points", 4, "config.netherite_plus.damage.elytra_armor_points");
5758

58-
public static final List<ConfigItem<?>> OPTIONS = ImmutableList.of(BOW_DAMAGE_ADDITION, BOW_DAMAGE_MULTIPLIER, CROSSBOW_DAMAGE_ADDITION, CROSSBOW_DAMAGE_MULTIPLIER, TRIDENT_DAMAGE_ADDITION, TRIDENT_DAMAGE_MULTIPLIER);
59+
public static final List<ConfigItem<?>> OPTIONS = ImmutableList.of(BOW_DAMAGE_ADDITION, BOW_DAMAGE_MULTIPLIER, CROSSBOW_DAMAGE_ADDITION, CROSSBOW_DAMAGE_MULTIPLIER, TRIDENT_DAMAGE_ADDITION, TRIDENT_DAMAGE_MULTIPLIER, ELYTRA_ARMOR_POINTS);
5960

6061
public DAMAGE() {
6162
super(OPTIONS, "damage");

common/src/main/java/com/oroarmor/netherite_plus/item/NetheriteElytraArmorMaterials.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
import java.util.function.Supplier;
44

5+
import com.oroarmor.netherite_plus.config.NetheritePlusConfig;
6+
57
import net.minecraft.entity.EquipmentSlot;
68
import net.minecraft.item.ArmorMaterial;
79
import net.minecraft.item.Items;
@@ -14,7 +16,7 @@
1416
import net.fabricmc.api.Environment;
1517

1618
public enum NetheriteElytraArmorMaterials implements ArmorMaterial {
17-
NETHERITE_ELYTRA_MATERIAL("netherite_elytra", 37, new int[]{3, 6, 4, 3}, 15, SoundEvents.ITEM_ARMOR_EQUIP_NETHERITE, 3.0F, 0.1F, () -> {
19+
NETHERITE_ELYTRA_MATERIAL("netherite_elytra", 37, new int[]{3, 6, NetheritePlusConfig.DAMAGE.ELYTRA_ARMOR_POINTS.getValue(), 3}, 15, SoundEvents.ITEM_ARMOR_EQUIP_NETHERITE, 3.0F, 0.1F, () -> {
1820
return Ingredient.ofItems(Items.NETHERITE_INGOT);
1921
});
2022

common/src/main/resources/assets/netherite_plus/lang/en_us.json

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -49,16 +49,16 @@
4949
"config.netherite_plus": "Netherite Plus Config",
5050
"config.netherite_plus.enabled": "Enabled Features",
5151
"config.netherite_plus.enabled.config_debug_print": "Prints the config on game start",
52-
"config.netherite_plus.enabled.anvils": "Enable or disable netherite anvils",
52+
"config.netherite_plus.enabled.anvils": "Enable or disable Netherite anvils",
5353
"config.netherite_plus.enabled.bows_crossbows": "Enable or disable bows and crossbows",
54-
"config.netherite_plus.enabled.elytra": "Enable or disable netherite elytra",
55-
"config.netherite_plus.enabled.fake_netherite_blocks": "Enable or disable fake netherite blocks",
56-
"config.netherite_plus.enabled.fishing_rod": "Enable or disable netherite fishing rod",
57-
"config.netherite_plus.enabled.horse_armor": "Enable or disable netherite horse armor",
58-
"config.netherite_plus.enabled.shields": "Enable or disable netherite shields",
59-
"config.netherite_plus.enabled.shulker_boxes": "Enable or disable netherite shulker boxes",
60-
"config.netherite_plus.enabled.trident": "Enable or disable netherite tridents",
61-
"config.netherite_plus.enabled.beacon": "Enable or disable netherite beacons",
54+
"config.netherite_plus.enabled.elytra": "Enable or disable Netherite elytra",
55+
"config.netherite_plus.enabled.fake_netherite_blocks": "Enable or disable fake Netherite blocks",
56+
"config.netherite_plus.enabled.fishing_rod": "Enable or disable Netherite fishing rod",
57+
"config.netherite_plus.enabled.horse_armor": "Enable or disable Netherite horse armor",
58+
"config.netherite_plus.enabled.shields": "Enable or disable Netherite shields",
59+
"config.netherite_plus.enabled.shulker_boxes": "Enable or disable Netherite shulker boxes",
60+
"config.netherite_plus.enabled.trident": "Enable or disable Netherite tridents",
61+
"config.netherite_plus.enabled.beacon": "Enable or disable Netherite beacons",
6262
"config.netherite_plus.durabilities": "Item Durabilities",
6363
"config.netherite_plus.durabilities.bow": "Netherite Bow Durability",
6464
"config.netherite_plus.durabilities.crossbow": "Netherite Crossbow Durability",
@@ -67,14 +67,15 @@
6767
"config.netherite_plus.durabilities.shield": "Netherite Shield Durability",
6868
"config.netherite_plus.durabilities.trident": "Netherite Trident Durability",
6969
"config.netherite_plus.damage": "Damage Features",
70-
"config.netherite_plus.damage.bow_damage_addition": "Damage added to the netherite bow after the multiplier",
71-
"config.netherite_plus.damage.bow_damage_multiplier": "Multiplier of the normal bow damage for the netherite bow",
72-
"config.netherite_plus.damage.crossbow_damage_addition": "Damage added to the netherite crossbow after the multiplier",
73-
"config.netherite_plus.damage.crossbow_damage_multiplier": "Multiplier of the normal crossbow damage for the netherite crossbow",
74-
"config.netherite_plus.damage.trident_damage_addition": "Damage added to the netherite trident after the multiplier",
75-
"config.netherite_plus.damage.trident_damage_multiplier": "Multiplier of the normal trident damage for the netherite trident",
70+
"config.netherite_plus.damage.bow_damage_addition": "Damage added to the Netherite bow after the multiplier",
71+
"config.netherite_plus.damage.bow_damage_multiplier": "Multiplier of the normal bow damage for the Netherite bow",
72+
"config.netherite_plus.damage.crossbow_damage_addition": "Damage added to the Netherite crossbow after the multiplier",
73+
"config.netherite_plus.damage.crossbow_damage_multiplier": "Multiplier of the normal crossbow damage for the Netherite crossbow",
74+
"config.netherite_plus.damage.trident_damage_addition": "Damage added to the Netherite trident after the multiplier",
75+
"config.netherite_plus.damage.trident_damage_multiplier": "Multiplier of the normal trident damage for the Netherite trident",
76+
"config.netherite_plus.damage.elytra_armor_points": "Armor points for the Netherite Elytra",
7677
"config.netherite_plus.anvil": "Anvil Features",
77-
"config.netherite_plus.anvil.xp_redcution": "XP Reduction in netherite anvil",
78+
"config.netherite_plus.anvil.xp_redcution": "XP Reduction in Netherite anvil",
7879
"config.netherite_plus.graphics": "Graphics Settings",
7980
"config.netherite_plus.graphics.lava_vision": "How far each level of lava vision gives",
8081
"effect.minecraft.lava_vision": "Lava Vision",

fabric/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ dependencies {
9595
modCompile "net.fabricmc.fabric-api:fabric-api:${rootProject.fabric_version}"
9696

9797
//Libraries
98-
includeLibraries(['com.oroarmor:oro-config:1.1.0',
98+
includeLibraries(['com.oroarmor:oro-config:1.2.0',
9999
'com.oroarmor:Multi-Item-Lib:1.1.1'])
100100

101101
runAndCompile(["net.kyrptonaught:quickshulker:${project.quickshulker}",

fabric/src/main/java/com/oroarmor/netherite_plus/client/NetheritePlusClientModFabric.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ public class NetheritePlusClientModFabric implements ClientModInitializer {
3535
@SuppressWarnings({ "rawtypes", "unchecked" })
3636
@Override
3737
public void onInitializeClient() {
38-
BlockEntityRendererRegistry.INSTANCE.register((BlockEntityType<NetheriteShulkerBoxBlockEntity>) NetheritePlusBlocks.NETHERITE_SHULKER_BOX_ENTITY.get(), NetheriteShulkerBoxBlockEntityRenderer::new);
39-
BlockEntityRendererRegistry.INSTANCE.register((BlockEntityType<NetheriteBeaconBlockEntity>) NetheritePlusBlocks.NETHERITE_BEACON_BLOCK_ENTITY.get(), NetheriteBeaconBlockEntityRenderer::new);
38+
if(NetheritePlusConfig.ENABLED.ENABLED_SHULKER_BOXES.getValue()) BlockEntityRendererRegistry.INSTANCE.register((BlockEntityType<NetheriteShulkerBoxBlockEntity>) NetheritePlusBlocks.NETHERITE_SHULKER_BOX_ENTITY.get(), NetheriteShulkerBoxBlockEntityRenderer::new);
39+
if(NetheritePlusConfig.ENABLED.ENABLED_BEACON.getValue()) BlockEntityRendererRegistry.INSTANCE.register((BlockEntityType<NetheriteBeaconBlockEntity>) NetheritePlusBlocks.NETHERITE_BEACON_BLOCK_ENTITY.get(), NetheriteBeaconBlockEntityRenderer::new);
4040

4141
NetheritePlusClientMod.init();
4242
NetheritePlusTexturesFabric.register();

fabric/src/main/java/com/oroarmor/netherite_plus/item/NetheriteElytraItem_Trinkets.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import java.util.List;
44
import com.oroarmor.netherite_plus.compatibility.NetheritePlusTrinketsRenderer;
5+
import com.oroarmor.netherite_plus.config.NetheritePlusConfig;
56
import dev.emi.trinkets.api.Slots;
67
import dev.emi.trinkets.api.Trinket;
78
import dev.emi.trinkets.api.TrinketItem;
@@ -42,12 +43,12 @@ public boolean canWearInSlot(String group, String slot) {
4243

4344
@Override
4445
public void onEquip(PlayerEntity player, ItemStack stack) {
45-
player.getAttributes().getCustomInstance(EntityAttributes.GENERIC_ARMOR).setBaseValue(4 + player.getAttributes().getCustomInstance(EntityAttributes.GENERIC_ARMOR).getBaseValue());
46+
player.getAttributes().getCustomInstance(EntityAttributes.GENERIC_ARMOR).setBaseValue(NetheritePlusConfig.DAMAGE.ELYTRA_ARMOR_POINTS.getValue() + player.getAttributes().getCustomInstance(EntityAttributes.GENERIC_ARMOR).getBaseValue());
4647
}
4748

4849
@Override
4950
public void onUnequip(PlayerEntity player, ItemStack stack) {
50-
player.getAttributes().getCustomInstance(EntityAttributes.GENERIC_ARMOR).setBaseValue(-4 + player.getAttributes().getCustomInstance(EntityAttributes.GENERIC_ARMOR).getBaseValue());
51+
player.getAttributes().getCustomInstance(EntityAttributes.GENERIC_ARMOR).setBaseValue(-NetheritePlusConfig.DAMAGE.ELYTRA_ARMOR_POINTS.getValue() + player.getAttributes().getCustomInstance(EntityAttributes.GENERIC_ARMOR).getBaseValue());
5152
}
5253

5354
@Environment(EnvType.CLIENT)

forge/build.gradle

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,14 @@ dependencies {
3535
exclude(module: "fabric-loader")
3636
}
3737

38-
compile('com.oroarmor:oro-config:1.1.0') {
38+
compile('com.oroarmor:oro-config:1.2.0') {
3939
exclude(module: "fabric-loader")
4040
}
41-
shadow('com.oroarmor:oro-config:1.1.0') {
41+
shadow('com.oroarmor:oro-config:1.2.0') {
4242
exclude(module: "fabric-loader")
4343
exclude(module: "modmenu")
4444
exclude(module: "config-2")
45+
exclude(module: "fabric-command-api-v1")
4546
}
4647

4748
compileOnly(project(path: ":common")) {

0 commit comments

Comments
 (0)