Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes lots of issues #2404

Merged
merged 15 commits into from
Jul 28, 2024
Merged

Conversation

PocketSizedWeeb
Copy link
Contributor

@PocketSizedWeeb PocketSizedWeeb commented Apr 20, 2024

JEI Changes:

  • Fixes issue Solidifier doesn't show liquid requirements #2369
  • Made the JEI category for the Melter more closely match the Melter's GUI
  • Moved the JEI "Show Recipe" area for the machines line up with the progress bar
  • Moved the JEI "Show Recipe" area for the generators line up with the generator name
  • Every applicable JEI Category got an energy bar added to show max consumed/produced RF
  • Every applicable JEI Category got a progress bar to show how long the machine will run for
  • Edited the Melter category texture to add space for energy bar
  • Possibly fixed HashMap memory leak #2383 by caching an instance of Minecraft instead of grabbing it when needed in the Packager's JEI Category

Dry Peat:

Solidifier/Melter:

  • Fully fixes desync issue by making all of the processing server sided.

Crushing Macerator:

Evaporation Generator:

  • Removed tank tooltip from before it was rotated
  • Fixes Evaporation Generator 1.19.2 #2322 by implementing a workaround since the fluid portion of FluidTagIngredient was defaulting to empty which was not allowing tagged fluids in the generator

Auto Crafter:

Wireless Transmitter:

@Lothrazar I also have a working JEI Category for the Combustion Generator and Devouring Generator if you want me to make a pull request for it.

- Fixes issue Lothrazar#2369
- Made some JEI category changes to make it look a bit better
- Fixed issue Lothrazar#2399 by allowing water-logged blocks to hydrate the peat
- Makes all of the recipe process server only instead of just part of it
- Fixes issue Lothrazar#2343
- Player can no longer put items in the output slot
- Made the JEI category more closely resemble the Melter gui.
- For some reason the time remaining tooltip and the show recipes
tooltip clashed, so I moved the click area the the title string for the
generators.
- Added the onRemove method to the Wireless Transmitter
- Checks the input before any processing happens
- Recipe preview now updates when recipe grid changes instead of when
it's done processing
- The fluid portion of the FluidTagIngredient is empty, so I made a work
around until it is fixed in FLib.
@Lothrazar Lothrazar self-assigned this Jul 28, 2024
@Lothrazar Lothrazar added the 1.20 label Jul 28, 2024
Copy link
Owner

@Lothrazar Lothrazar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great work and thanks for your patience! i tested everything and reviewed all the code and the fixes look good, they address the issues as stated

}

@Override
public void setRecipe(IRecipeLayoutBuilder builder, RecipeMelter recipe, IFocusGroup focuses) {
builder.addSlot(RecipeIngredientRole.INPUT, 4, 19).addIngredients(recipe.at(0));
builder.addSlot(RecipeIngredientRole.INPUT, 22, 19).addIngredients(recipe.at(1));
List<FluidStack> matchingFluids = List.of(recipe.getRecipeFluid());
builder.addSlot(RecipeIngredientRole.OUTPUT, 140, 19).addIngredients(ForgeTypes.FLUID_STACK, matchingFluids);
builder.addSlot(RecipeIngredientRole.OUTPUT, 132, 19).addIngredients(ForgeTypes.FLUID_STACK, matchingFluids).setFluidRenderer(4000, false, 16, 16);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sweet i never knew jei had a fluid renderer like this

gui = helper.drawableBuilder(new ResourceLocation(ModCyclic.MODID, "textures/jei/melter_recipe.png"), 0, 0, 169, 69).setTextureSize(169, 69).build();
icon = helper.createDrawableIngredient(VanillaTypes.ITEM_STACK, new ItemStack(BlockRegistry.MELTER.get()));
bar = new EnergyBar(font, TileSolidifier.MAX);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ha why didnt i think of that. i made the bars module but never thought to re use them into the jei component. smart

@@ -44,4 +45,18 @@ public <T extends BlockEntity> BlockEntityTicker<T> getTicker(Level world, Block
protected void createBlockStateDefinition(StateDefinition.Builder<Block, BlockState> builder) {
builder.add(POWERED);
}

@Override // was onReplaced
public void onRemove(BlockState state, Level worldIn, BlockPos pos, BlockState newState, boolean isMoving) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch

//Fixes sync issue entirely
if(level.isClientSide()) return;
//Checks if there is space in the output slot
if(this.outputSlots.getStackInSlot(0).getCount() > 64 - currentRecipe.getResultItem(level.registryAccess()).getCount()) return;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we assume the max is always 64? what if its an ender pearl and 16 is the max. well we can check that later, still a good fix

@@ -67,6 +67,8 @@ public void tick() {
if (currentRecipe == null) {
return;
}
//Fixes sync issue entirely
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

noice

return;
}
//Checks if there is space in the output slots before processing
if(outputSlots.getStackInSlot(0).getCount() > 64 - currentRecipe.getResultItem(level.registryAccess()).copy().getCount()) return;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix looks good! the hardcoded 64 can be an issue, for example if i have a recipe that outputs 3 ender pearls, that has a max stack size of 16 so it has that issue. i can change it later you just do it something like this

var result = currentRecipe.getResultItem(level.registryAccess()).copy();
var max = result.getMaxStackSize();

gridStacks.add(gridHandler.getStackInSlot(i).copy());
}
for(ItemStack stack : inputStacks) {
List<ItemStack> lolbit = new ArrayList<ItemStack>();
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

aha so lolbit are the matches so we know what to clear out when we are removingall i got it. works in my testing 👍

@Lothrazar
Copy link
Owner

And yeah for "I also have a working JEI Category for the Combustion Generator and Devouring Generator if you want me to make a pull request for it." yeah i would merge it. i figured people would just know what is edible or what is furnace fuel (coal and lava) but it would be nice for lots of players

@Lothrazar Lothrazar merged commit 02cfd51 into Lothrazar:trunk/1.20.1 Jul 28, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment