diff --git a/src/main/java/techreborn/events/ModRegistry.java b/src/main/java/techreborn/events/ModRegistry.java index 6ad52912a..c84462434 100644 --- a/src/main/java/techreborn/events/ModRegistry.java +++ b/src/main/java/techreborn/events/ModRegistry.java @@ -86,7 +86,7 @@ public class ModRegistry { registerSounds(); } - public static void registerBlocks() { + private static void registerBlocks() { Settings itemGroup = new Item.Settings().group(TechReborn.ITEMGROUP); Arrays.stream(Ores.values()).forEach(value -> RebornRegistry.registerBlock(value.block, itemGroup)); Arrays.stream(StorageBlocks.values()).forEach(value -> RebornRegistry.registerBlock(value.block, itemGroup)); @@ -113,7 +113,7 @@ public class ModRegistry { TechReborn.LOGGER.debug("TechReborns Blocks Loaded"); } - public static void registerItems() { + private static void registerItems() { Arrays.stream(Ingots.values()).forEach(value -> RebornRegistry.registerItem(value.item)); Arrays.stream(Nuggets.values()).forEach(value -> RebornRegistry.registerItem(value.item)); Arrays.stream(Gems.values()).forEach(value -> RebornRegistry.registerItem(value.item)); @@ -213,11 +213,11 @@ public class ModRegistry { TechReborn.LOGGER.debug("TechReborns Items Loaded"); } - public static void registerFluids() { + private static void registerFluids() { Arrays.stream(ModFluids.values()).forEach(ModFluids::register); } - public static void registerSounds() { + private static void registerSounds() { ModSounds.ALARM = InitUtils.setup("alarm"); ModSounds.ALARM_2 = InitUtils.setup("alarm_2"); ModSounds.ALARM_3 = InitUtils.setup("alarm_3"); diff --git a/src/main/java/techreborn/init/ModLoot.java b/src/main/java/techreborn/init/ModLoot.java index afc4de215..a06a9d1f9 100644 --- a/src/main/java/techreborn/init/ModLoot.java +++ b/src/main/java/techreborn/init/ModLoot.java @@ -95,39 +95,21 @@ public class ModLoot { if (ConfigTechReborn.enableOverworldLoot) { switch (stringId) { case "minecraft:chests/abandoned_mineshaft": - supplier.withPool(poolBasic); + case "minecraft:chests/desert_pyramid": + case "minecraft:chests/igloo_chest": + case "minecraft:chests/jungle_temple": + case "minecraft:chests/simple_dungeon": + case "minecraft:chests/village/village_weaponsmith": + case "minecraft:chests/village/village_armorer": + case "minecraft:chests/village/village_toolsmith": + supplier.withPool(poolBasic); break; - case "minecraft:chests/desert_pyramid": - supplier.withPool(poolBasic); + case "minecraft:chests/stronghold_corridor": + case "minecraft:chests/stronghold_crossing": + case "minecraft:chests/stronghold_library": + supplier.withPool(poolAdvanced); break; - case "minecraft:chests/igloo_chest": - supplier.withPool(poolBasic); - break; - case "minecraft:chests/jungle_temple": - supplier.withPool(poolBasic); - break; - case "minecraft:chests/simple_dungeon": - supplier.withPool(poolBasic); - break; - case "minecraft:chests/village/village_weaponsmith": - supplier.withPool(poolBasic); - break; - case "minecraft:chests/village/village_armorer": - supplier.withPool(poolBasic); - break; - case "minecraft:chests/village/village_toolsmith": - supplier.withPool(poolBasic); - break; - case "minecraft:chests/stronghold_corridor": - supplier.withPool(poolAdvanced); - break; - case "minecraft:chests/stronghold_crossing": - supplier.withPool(poolAdvanced); - break; - case "minecraft:chests/stronghold_library": - supplier.withPool(poolAdvanced); - break; - case "minecraft:chests/woodland_mansion": + case "minecraft:chests/woodland_mansion": supplier.withPool(poolIndustrial); break; } diff --git a/src/main/java/techreborn/init/ModSounds.java b/src/main/java/techreborn/init/ModSounds.java index 5b89f8c0b..d9f445740 100644 --- a/src/main/java/techreborn/init/ModSounds.java +++ b/src/main/java/techreborn/init/ModSounds.java @@ -27,6 +27,7 @@ package techreborn.init; import net.minecraft.block.entity.BlockEntity; import net.minecraft.sound.SoundCategory; import net.minecraft.sound.SoundEvent; +import net.minecraft.world.World; import reborncore.common.recipes.ICrafterSoundHanlder; /** @@ -48,7 +49,11 @@ public class ModSounds { @Override public void playSound(boolean firstRun, BlockEntity blockEntity) { - blockEntity.getWorld().playSound(null, blockEntity.getPos().getX(), blockEntity.getPos().getY(), + World world = blockEntity.getWorld(); + if (world == null){ + return; + } + world.playSound(null, blockEntity.getPos().getX(), blockEntity.getPos().getY(), blockEntity.getPos().getZ(), ModSounds.MACHINE_RUN, SoundCategory.BLOCKS, 0.1F, 1F); } } diff --git a/src/main/java/techreborn/init/TRArmorMaterial.java b/src/main/java/techreborn/init/TRArmorMaterial.java index 472921392..84ef4fb1d 100644 --- a/src/main/java/techreborn/init/TRArmorMaterial.java +++ b/src/main/java/techreborn/init/TRArmorMaterial.java @@ -30,7 +30,6 @@ import net.minecraft.recipe.Ingredient; import net.minecraft.sound.SoundEvent; import net.minecraft.sound.SoundEvents; import net.minecraft.util.Lazy; -import techreborn.TechReborn; import java.util.function.Supplier; @@ -59,8 +58,8 @@ public enum TRArmorMaterial implements ArmorMaterial { private final float toughness; private final Lazy repairMaterial; - private TRArmorMaterial(int maxDamageFactor, int[] damageReductionAmountArray, int enchantability, - SoundEvent soundEvent, float toughness, Supplier repairMaterialIn) { + TRArmorMaterial(int maxDamageFactor, int[] damageReductionAmountArray, int enchantability, + SoundEvent soundEvent, float toughness, Supplier repairMaterialIn) { this.maxDamageFactor = maxDamageFactor; this.damageReductionAmountArray = damageReductionAmountArray; this.enchantability = enchantability; @@ -91,10 +90,7 @@ public enum TRArmorMaterial implements ArmorMaterial { @Override public Ingredient getRepairIngredient() { - if (repairMaterial != null) { - return repairMaterial.get(); - } - return null; + return repairMaterial.get(); } @Override diff --git a/src/main/java/techreborn/init/TRBlockEntities.java b/src/main/java/techreborn/init/TRBlockEntities.java index 5cf33081d..802e626aa 100644 --- a/src/main/java/techreborn/init/TRBlockEntities.java +++ b/src/main/java/techreborn/init/TRBlockEntities.java @@ -65,7 +65,7 @@ import java.util.List; public class TRBlockEntities { - public static List> TYPES = new ArrayList<>(); + private static List> TYPES = new ArrayList<>(); public static final BlockEntityType THERMAL_GEN = register(ThermalGeneratorBlockEntity.class, "thermal_generator", TRContent.Machine.THERMAL_GENERATOR); public static final BlockEntityType QUANTUM_TANK = register(QuantumTankBlockEntity.class, "quantum_tank", TRContent.Machine.QUANTUM_TANK); diff --git a/src/main/java/techreborn/init/TRToolTier.java b/src/main/java/techreborn/init/TRToolTier.java index fb920526c..cad0ed85c 100644 --- a/src/main/java/techreborn/init/TRToolTier.java +++ b/src/main/java/techreborn/init/TRToolTier.java @@ -63,7 +63,7 @@ public enum TRToolTier implements ToolMaterial { private final int enchantability; private final Lazy repairMaterial; - private TRToolTier(int harvestLevelIn, int maxUsesIn, float efficiencyIn, float attackDamageIn, + TRToolTier(int harvestLevelIn, int maxUsesIn, float efficiencyIn, float attackDamageIn, int enchantabilityIn, Supplier repairMaterialIn) { this.harvestLevel = harvestLevelIn; this.maxUses = maxUsesIn;