diff options
| author | shedaniel <daniel@shedaniel.me> | 2021-04-09 12:23:16 +0800 |
|---|---|---|
| committer | shedaniel <daniel@shedaniel.me> | 2021-04-09 12:23:33 +0800 |
| commit | 718819763bbea23cc11f037b358647952ef23213 (patch) | |
| tree | 014c064b5311969888a12f11e6529e90c9382834 /default-plugin/src/main | |
| parent | 966bbd7fe43237f9b1aa6cfd94cf5e34a9bcfddf (diff) | |
| download | RoughlyEnoughItems-718819763bbea23cc11f037b358647952ef23213.tar.gz RoughlyEnoughItems-718819763bbea23cc11f037b358647952ef23213.tar.bz2 RoughlyEnoughItems-718819763bbea23cc11f037b358647952ef23213.zip | |
Fix draggable stacks & Fix stretched fluids & Fix #508
Signed-off-by: shedaniel <daniel@shedaniel.me>
Diffstat (limited to 'default-plugin/src/main')
3 files changed, 9 insertions, 15 deletions
diff --git a/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/DefaultClientPlugin.java b/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/DefaultClientPlugin.java index e28cc19e8..9e609e3ce 100644 --- a/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/DefaultClientPlugin.java +++ b/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/DefaultClientPlugin.java @@ -108,22 +108,14 @@ public class DefaultClientPlugin implements REIClientPlugin, BuiltinClientPlugin ClientInternals.attachInstance((Supplier<Object>) () -> this, "builtinClientPlugin"); } - public static void registerBrewingRecipe(BrewingRecipe recipe) { - DisplayRegistry.getInstance().registerDisplay(new DefaultBrewingDisplay(recipe.input, recipe.ingredient, recipe.output)); - } - - public static void registerInfoDisplay(DefaultInformationDisplay display) { - DisplayRegistry.getInstance().registerDisplay(display); - } - @Override public void registerBrewingRecipe(Ingredient input, Ingredient ingredient, ItemStack output) { - registerBrewingRecipe(new BrewingRecipe(input, ingredient, output)); + DisplayRegistry.getInstance().registerDisplay(new DefaultBrewingDisplay(new BrewingRecipe(input, ingredient, output))); } @Override public void registerInformation(EntryIngredient ingredient, Component name, UnaryOperator<List<Component>> textBuilder) { - registerInfoDisplay(DefaultInformationDisplay.createFromEntries(ingredient, name).lines(textBuilder.apply(Lists.newArrayList()))); + DisplayRegistry.getInstance().registerDisplay(DefaultInformationDisplay.createFromEntries(ingredient, name).lines(textBuilder.apply(Lists.newArrayList()))); } @Override @@ -228,6 +220,7 @@ public class DefaultClientPlugin implements REIClientPlugin, BuiltinClientPlugin registry.registerFiller(CampfireCookingRecipe.class, DefaultCampfireDisplay::new); registry.registerFiller(StonecutterRecipe.class, DefaultStoneCuttingDisplay::new); registry.registerFiller(UpgradeRecipe.class, DefaultSmithingDisplay::new); + registry.registerFiller(BrewingRecipe.class, DefaultBrewingDisplay::new); for (Map.Entry<Item, Integer> entry : AbstractFurnaceBlockEntity.getFuel().entrySet()) { registry.registerDisplay(new DefaultFuelDisplay(Collections.singletonList(EntryIngredients.of(entry.getKey())), Collections.emptyList(), entry.getValue())); } diff --git a/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/categories/DefaultInformationCategory.java b/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/categories/DefaultInformationCategory.java index 6dfc4e1b3..2d61b4d3c 100644 --- a/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/categories/DefaultInformationCategory.java +++ b/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/categories/DefaultInformationCategory.java @@ -114,9 +114,8 @@ public class DefaultInformationCategory implements DisplayCategory<DefaultInform @Override public List<Widget> setupDisplay(DefaultInformationDisplay display, Rectangle bounds) { List<Widget> widgets = Lists.newArrayList(); - widgets.add(Widgets.createLabel(new Point(bounds.getCenterX(), bounds.y + 3), display.getName()).noShadow().color(0xFF404040, 0xFFBBBBBB)); - widgets.add(Widgets.createSlot(new Point(bounds.getCenterX() - 8, bounds.y + 15)).entries(display.getEntryStacks())); - Rectangle rectangle = new Rectangle(bounds.getCenterX() - (bounds.width / 2), bounds.y + 35, bounds.width, bounds.height - 40); + widgets.add(Widgets.createSlot(new Point(bounds.getCenterX() - 8, bounds.y + 15 - 9)).entries(display.getEntryStacks())); + Rectangle rectangle = new Rectangle(bounds.getCenterX() - (bounds.width / 2), bounds.y + 35 - 9, bounds.width, bounds.height - 40 + 9); widgets.add(Widgets.createSlotBase(rectangle)); widgets.add(new ScrollableTextWidget(rectangle, display.getTexts())); return widgets; diff --git a/default-plugin/src/main/java/me/shedaniel/rei/plugin/common/displays/brewing/DefaultBrewingDisplay.java b/default-plugin/src/main/java/me/shedaniel/rei/plugin/common/displays/brewing/DefaultBrewingDisplay.java index 6abff9561..f0ad587e8 100644 --- a/default-plugin/src/main/java/me/shedaniel/rei/plugin/common/displays/brewing/DefaultBrewingDisplay.java +++ b/default-plugin/src/main/java/me/shedaniel/rei/plugin/common/displays/brewing/DefaultBrewingDisplay.java @@ -51,12 +51,14 @@ public class DefaultBrewingDisplay implements Display { private EntryStack<?> output; private EntryIngredient reactant, input; - @ApiStatus.Internal + public DefaultBrewingDisplay(BrewingRecipe recipe) { + this(recipe.input, recipe.ingredient, recipe.output); + } + public DefaultBrewingDisplay(Ingredient input, Ingredient reactant, ItemStack output) { this(EntryIngredients.ofIngredient(input), EntryIngredients.ofIngredient(reactant), EntryStacks.of(output)); } - @ApiStatus.Internal public DefaultBrewingDisplay(EntryIngredient input, EntryIngredient reactant, EntryStack<?> output) { this.input = input.map(stack -> stack.copy().tooltip(new TranslatableComponent("category.rei.brewing.input").withStyle(ChatFormatting.YELLOW))); this.reactant = reactant.map(stack -> stack.copy().tooltip(new TranslatableComponent("category.rei.brewing.reactant").withStyle(ChatFormatting.YELLOW))); |
