Style fixes
This commit is contained in:
parent
bec66622a0
commit
a5d25a09f7
|
|
@ -229,7 +229,7 @@ public class MechanicalHammerBlockEntity extends AbstractMachineBlockEntity<Mech
|
|||
@Override
|
||||
public boolean isItemValid(int slot, ItemStack stack) {
|
||||
if (slot == INPUT_SLOT) {
|
||||
return hammer.getRecipeCaches().getHammerRecipe(stack.getItem()) != null;
|
||||
return this.hammer.getRecipeCaches().getHammerRecipe(stack.getItem()) != null;
|
||||
} else if (slot == HAMMER_SLOT) {
|
||||
return stack.is(EItemTags.HAMMERS);
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -184,7 +184,7 @@ public class MechanicalSieveBlockEntity extends AbstractMachineBlockEntity<Mecha
|
|||
@Override
|
||||
public boolean isItemValid(int slot, ItemStack stack) {
|
||||
if (slot == INPUT_SLOT) {
|
||||
return !sieve.getRecipeCaches().getSieveRecipes(getStackInSlot(1).getItem(), stack).isEmpty();
|
||||
return !this.sieve.getRecipeCaches().getSieveRecipes(getStackInSlot(1).getItem(), stack).isEmpty();
|
||||
} else if (slot == MESH_SLOT) {
|
||||
return stack.is(EItemTags.SIEVE_MESHES);
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
package thedarkcolour.exdeorum.blockentity.logic;
|
||||
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import thedarkcolour.exdeorum.recipe.RecipeUtil;
|
||||
import thedarkcolour.exdeorum.recipe.sieve.SieveRecipe;
|
||||
|
||||
import java.util.List;
|
||||
|
|
@ -13,6 +12,6 @@ public class CompressedSieveLogic extends SieveLogic {
|
|||
|
||||
@Override
|
||||
protected List<? extends SieveRecipe> getDropsFor(ItemStack contents) {
|
||||
return owner.getRecipeCaches().getCompressedSieveRecipes(this.mesh.getItem(), contents);
|
||||
return this.owner.getRecipeCaches().getCompressedSieveRecipes(this.mesh.getItem(), contents);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -130,7 +130,7 @@ public class SieveLogic {
|
|||
}
|
||||
|
||||
protected List<? extends SieveRecipe> 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) {
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ class SieveCategory implements IRecipeCategory<XeiSieveRecipe> {
|
|||
|
||||
@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
|
||||
|
|
|
|||
|
|
@ -41,60 +41,60 @@ public class RecipeCaches {
|
|||
private CrucibleHeatRecipeCache crucibleHeatRecipeCache;
|
||||
|
||||
public List<SieveRecipe> getSieveRecipes(Item mesh, ItemStack item) {
|
||||
return sieveRecipeCache.getRecipe(mesh, item);
|
||||
return this.sieveRecipeCache.getRecipe(mesh, item);
|
||||
}
|
||||
|
||||
public List<CompressedSieveRecipe> 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<RecipeHolder<HammerRecipe>> 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<RecipeHolder<CompressedHammerRecipe>> getCachedCompressedHammerRecipes() {
|
||||
return compressedHammerRecipeCache.getAllRecipes();
|
||||
return this.compressedHammerRecipeCache.getAllRecipes();
|
||||
}
|
||||
|
||||
public List<CrookRecipe> 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<Object2IntMap.Entry<BlockState>> 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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user