diff --git a/src/main/java/thedarkcolour/exdeorum/blockentity/MechanicalHammerBlockEntity.java b/src/main/java/thedarkcolour/exdeorum/blockentity/MechanicalHammerBlockEntity.java index 6b71fd0f..da187ce1 100644 --- a/src/main/java/thedarkcolour/exdeorum/blockentity/MechanicalHammerBlockEntity.java +++ b/src/main/java/thedarkcolour/exdeorum/blockentity/MechanicalHammerBlockEntity.java @@ -229,7 +229,7 @@ public class MechanicalHammerBlockEntity extends AbstractMachineBlockEntity getDropsFor(ItemStack contents) { - return owner.getRecipeCaches().getCompressedSieveRecipes(this.mesh.getItem(), contents); + return this.owner.getRecipeCaches().getCompressedSieveRecipes(this.mesh.getItem(), contents); } } diff --git a/src/main/java/thedarkcolour/exdeorum/blockentity/logic/SieveLogic.java b/src/main/java/thedarkcolour/exdeorum/blockentity/logic/SieveLogic.java index 98522a11..b292fe84 100644 --- a/src/main/java/thedarkcolour/exdeorum/blockentity/logic/SieveLogic.java +++ b/src/main/java/thedarkcolour/exdeorum/blockentity/logic/SieveLogic.java @@ -130,7 +130,7 @@ public class SieveLogic { } protected List getDropsFor(ItemStack contents) { - return owner.getRecipeCaches().getSieveRecipes(this.mesh.getItem(), contents); + return this.owner.getRecipeCaches().getSieveRecipes(this.mesh.getItem(), contents); } protected int getResultAmount(SieveRecipe recipe, LootContext context, RandomSource rand) { diff --git a/src/main/java/thedarkcolour/exdeorum/client/ClientHandler.java b/src/main/java/thedarkcolour/exdeorum/client/ClientHandler.java index 48fc0139..15968998 100644 --- a/src/main/java/thedarkcolour/exdeorum/client/ClientHandler.java +++ b/src/main/java/thedarkcolour/exdeorum/client/ClientHandler.java @@ -71,7 +71,8 @@ public class ClientHandler { fmlBus.addListener(ClientHandler::onPlayerRespawn); fmlBus.addListener(ClientHandler::onPlayerLogout); fmlBus.addListener(ClientHandler::onScreenOpen); - fmlBus.addListener(EventPriority.HIGHEST, ClientHandler::onRecipesUpdated); // We need to be at HIGH or HIGHEST to be called before JEI + // we need to be at HIGH or HIGHEST to be called before JEI + fmlBus.addListener(EventPriority.HIGHEST, ClientHandler::onRecipesUpdated); if (ModList.get().isLoaded(ModIds.JEI) || ModList.get().isLoaded(ModIds.EMI)) { modBus.addListener(ClientHandler::registerAdditionalModels); diff --git a/src/main/java/thedarkcolour/exdeorum/client/ClientsideCode.java b/src/main/java/thedarkcolour/exdeorum/client/ClientsideCode.java index 5fec128e..5ab7f553 100644 --- a/src/main/java/thedarkcolour/exdeorum/client/ClientsideCode.java +++ b/src/main/java/thedarkcolour/exdeorum/client/ClientsideCode.java @@ -29,7 +29,6 @@ public class ClientsideCode { private static final RecipeCaches RECIPE_CACHES = new RecipeCaches(); public static RecipeCaches getRecipeCaches() { - assert EffectiveSide.get().isClient() : Thread.currentThread().getName(); return RECIPE_CACHES; } diff --git a/src/main/java/thedarkcolour/exdeorum/compat/jei/CycleTimer.java b/src/main/java/thedarkcolour/exdeorum/compat/jei/CycleTimer.java index 3a270914..d4222a80 100644 --- a/src/main/java/thedarkcolour/exdeorum/compat/jei/CycleTimer.java +++ b/src/main/java/thedarkcolour/exdeorum/compat/jei/CycleTimer.java @@ -44,7 +44,7 @@ public class CycleTimer { public void onDraw() { if (!Screen.hasShiftDown()) { - if (pausedDuration > 0) { + if (this.pausedDuration > 0) { this.startTime += this.pausedDuration; this.pausedDuration = 0; } diff --git a/src/main/java/thedarkcolour/exdeorum/compat/jei/SieveCategory.java b/src/main/java/thedarkcolour/exdeorum/compat/jei/SieveCategory.java index 79d4f3e6..52adf0cc 100644 --- a/src/main/java/thedarkcolour/exdeorum/compat/jei/SieveCategory.java +++ b/src/main/java/thedarkcolour/exdeorum/compat/jei/SieveCategory.java @@ -75,7 +75,7 @@ class SieveCategory implements IRecipeCategory { @Override public int getHeight() { - return XeiUtil.SIEVE_ROW_START + XeiUtil.SIEVE_ROW_HEIGHT * rows.intValue(); + return XeiUtil.SIEVE_ROW_START + XeiUtil.SIEVE_ROW_HEIGHT * this.rows.intValue(); } @Override diff --git a/src/main/java/thedarkcolour/exdeorum/recipe/RecipeCaches.java b/src/main/java/thedarkcolour/exdeorum/recipe/RecipeCaches.java index 5fe7bb7f..5982d143 100644 --- a/src/main/java/thedarkcolour/exdeorum/recipe/RecipeCaches.java +++ b/src/main/java/thedarkcolour/exdeorum/recipe/RecipeCaches.java @@ -41,60 +41,60 @@ public class RecipeCaches { private CrucibleHeatRecipeCache crucibleHeatRecipeCache; public List getSieveRecipes(Item mesh, ItemStack item) { - return sieveRecipeCache.getRecipe(mesh, item); + return this.sieveRecipeCache.getRecipe(mesh, item); } public List getCompressedSieveRecipes(Item mesh, ItemStack item) { - return compressedSieveRecipeCache.getRecipe(mesh, item); + return this.compressedSieveRecipeCache.getRecipe(mesh, item); } @Nullable public CrucibleRecipe getLavaCrucibleRecipe(ItemStack item) { - return lavaCrucibleRecipeCache.getRecipe(item); + return this.lavaCrucibleRecipeCache.getRecipe(item); } @Nullable public CrucibleRecipe getWaterCrucibleRecipe(ItemStack item) { - return waterCrucibleRecipeCache.getRecipe(item); + return this.waterCrucibleRecipeCache.getRecipe(item); } @Nullable public BarrelCompostRecipe getBarrelCompostRecipe(ItemStack item) { - return barrelCompostRecipeCache.getRecipe(item); + return this.barrelCompostRecipeCache.getRecipe(item); } @Nullable public HammerRecipe getHammerRecipe(Item item) { - return hammerRecipeCache.getRecipe(item); + return this.hammerRecipeCache.getRecipe(item); } public Collection> getCachedHammerRecipes() { - return hammerRecipeCache.getAllRecipes(); + return this.hammerRecipeCache.getAllRecipes(); } @Nullable public CompressedHammerRecipe getCompressedHammerRecipe(Item item) { - return compressedHammerRecipeCache.getRecipe(item); + return this.compressedHammerRecipeCache.getRecipe(item); } public Collection> getCachedCompressedHammerRecipes() { - return compressedHammerRecipeCache.getAllRecipes(); + return this.compressedHammerRecipeCache.getAllRecipes(); } public List getCrookRecipes(BlockState state) { - return crookRecipeCache.getRecipes(state); + return this.crookRecipeCache.getRecipes(state); } public boolean isCompostable(ItemStack stack) { - return barrelCompostRecipeCache != null && barrelCompostRecipeCache.getRecipe(stack) != null; + return this.barrelCompostRecipeCache != null && this.barrelCompostRecipeCache.getRecipe(stack) != null; } public int getHeatValue(BlockState state) { - return crucibleHeatRecipeCache.getValue(state); + return this.crucibleHeatRecipeCache.getValue(state); } public ObjectSet> getHeatSources() { - return crucibleHeatRecipeCache.getEntries(); + return this.crucibleHeatRecipeCache.getEntries(); } // todo stop using the RecipeManager @@ -111,7 +111,7 @@ public class RecipeCaches { @Nullable public BarrelFluidMixingRecipe getFluidMixingRecipe(FluidStack base, Fluid additive) { - var recipe = barrelFluidMixingRecipeCache.getRecipe(base.getFluid(), additive); + var recipe = this.barrelFluidMixingRecipeCache.getRecipe(base.getFluid(), additive); if (recipe != null && base.getAmount() >= recipe.baseFluid().amount()) { return recipe; } else { @@ -122,37 +122,37 @@ public class RecipeCaches { @Nullable public FluidTransformationRecipe getFluidTransformationRecipe(Fluid baseFluid, BlockState catalystState) { if (baseFluid != Fluids.EMPTY) { - return fluidTransformationRecipeCache.getRecipe(baseFluid, catalystState); + return this.fluidTransformationRecipeCache.getRecipe(baseFluid, catalystState); } else { return null; } } public void reload(RecipeManager recipes) { - barrelCompostRecipeCache = new SingleIngredientRecipeCache<>(recipes, ERecipeTypes.BARREL_COMPOST); - lavaCrucibleRecipeCache = new SingleIngredientRecipeCache<>(recipes, ERecipeTypes.LAVA_CRUCIBLE); - waterCrucibleRecipeCache = new SingleIngredientRecipeCache<>(recipes, ERecipeTypes.WATER_CRUCIBLE); - hammerRecipeCache = new SingleIngredientRecipeCache<>(recipes, ERecipeTypes.HAMMER).trackAllRecipes(); - compressedHammerRecipeCache = new SingleIngredientRecipeCache<>(recipes, ERecipeTypes.COMPRESSED_HAMMER).trackAllRecipes(); - sieveRecipeCache = new SieveRecipeCache<>(recipes, ERecipeTypes.SIEVE); - compressedSieveRecipeCache = new SieveRecipeCache<>(recipes, ERecipeTypes.COMPRESSED_SIEVE); - barrelFluidMixingRecipeCache = new BarrelFluidMixingRecipeCache(recipes); - fluidTransformationRecipeCache = new FluidTransformationRecipeCache(recipes); - crookRecipeCache = new CrookRecipeCache(recipes); - crucibleHeatRecipeCache = new CrucibleHeatRecipeCache(recipes); + this.barrelCompostRecipeCache = new SingleIngredientRecipeCache<>(recipes, ERecipeTypes.BARREL_COMPOST); + this.lavaCrucibleRecipeCache = new SingleIngredientRecipeCache<>(recipes, ERecipeTypes.LAVA_CRUCIBLE); + this.waterCrucibleRecipeCache = new SingleIngredientRecipeCache<>(recipes, ERecipeTypes.WATER_CRUCIBLE); + this.hammerRecipeCache = new SingleIngredientRecipeCache<>(recipes, ERecipeTypes.HAMMER).trackAllRecipes(); + this.compressedHammerRecipeCache = new SingleIngredientRecipeCache<>(recipes, ERecipeTypes.COMPRESSED_HAMMER).trackAllRecipes(); + this.sieveRecipeCache = new SieveRecipeCache<>(recipes, ERecipeTypes.SIEVE); + this.compressedSieveRecipeCache = new SieveRecipeCache<>(recipes, ERecipeTypes.COMPRESSED_SIEVE); + this.barrelFluidMixingRecipeCache = new BarrelFluidMixingRecipeCache(recipes); + this.fluidTransformationRecipeCache = new FluidTransformationRecipeCache(recipes); + this.crookRecipeCache = new CrookRecipeCache(recipes); + this.crucibleHeatRecipeCache = new CrucibleHeatRecipeCache(recipes); } public void unload() { - barrelCompostRecipeCache = null; - lavaCrucibleRecipeCache = null; - waterCrucibleRecipeCache = null; - hammerRecipeCache = null; - compressedHammerRecipeCache = null; - sieveRecipeCache = null; - compressedSieveRecipeCache = null; - barrelFluidMixingRecipeCache = null; - fluidTransformationRecipeCache = null; - crookRecipeCache = null; - crucibleHeatRecipeCache = null; + this.barrelCompostRecipeCache = null; + this.lavaCrucibleRecipeCache = null; + this.waterCrucibleRecipeCache = null; + this.hammerRecipeCache = null; + this.compressedHammerRecipeCache = null; + this.sieveRecipeCache = null; + this.compressedSieveRecipeCache = null; + this.barrelFluidMixingRecipeCache = null; + this.fluidTransformationRecipeCache = null; + this.crookRecipeCache = null; + this.crucibleHeatRecipeCache = null; } }