Light cleanup

This commit is contained in:
drcrazy 2019-08-01 03:38:55 +03:00
parent e7adce612e
commit d53779f2c9
6 changed files with 28 additions and 45 deletions

View file

@ -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");

View file

@ -95,35 +95,17 @@ public class ModLoot {
if (ConfigTechReborn.enableOverworldLoot) {
switch (stringId) {
case "minecraft:chests/abandoned_mineshaft":
supplier.withPool(poolBasic);
break;
case "minecraft:chests/desert_pyramid":
supplier.withPool(poolBasic);
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;

View file

@ -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);
}
}

View file

@ -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,7 +58,7 @@ public enum TRArmorMaterial implements ArmorMaterial {
private final float toughness;
private final Lazy<Ingredient> repairMaterial;
private TRArmorMaterial(int maxDamageFactor, int[] damageReductionAmountArray, int enchantability,
TRArmorMaterial(int maxDamageFactor, int[] damageReductionAmountArray, int enchantability,
SoundEvent soundEvent, float toughness, Supplier<Ingredient> repairMaterialIn) {
this.maxDamageFactor = maxDamageFactor;
this.damageReductionAmountArray = damageReductionAmountArray;
@ -91,11 +90,8 @@ public enum TRArmorMaterial implements ArmorMaterial {
@Override
public Ingredient getRepairIngredient() {
if (repairMaterial != null) {
return repairMaterial.get();
}
return null;
}
@Override
public String getName() {

View file

@ -65,7 +65,7 @@ import java.util.List;
public class TRBlockEntities {
public static List<BlockEntityType<?>> TYPES = new ArrayList<>();
private static List<BlockEntityType<?>> TYPES = new ArrayList<>();
public static final BlockEntityType<ThermalGeneratorBlockEntity> THERMAL_GEN = register(ThermalGeneratorBlockEntity.class, "thermal_generator", TRContent.Machine.THERMAL_GENERATOR);
public static final BlockEntityType<QuantumTankBlockEntity> QUANTUM_TANK = register(QuantumTankBlockEntity.class, "quantum_tank", TRContent.Machine.QUANTUM_TANK);

View file

@ -63,7 +63,7 @@ public enum TRToolTier implements ToolMaterial {
private final int enchantability;
private final Lazy<Ingredient> repairMaterial;
private TRToolTier(int harvestLevelIn, int maxUsesIn, float efficiencyIn, float attackDamageIn,
TRToolTier(int harvestLevelIn, int maxUsesIn, float efficiencyIn, float attackDamageIn,
int enchantabilityIn, Supplier<Ingredient> repairMaterialIn) {
this.harvestLevel = harvestLevelIn;
this.maxUses = maxUsesIn;