diff options
| author | shedaniel <daniel@shedaniel.me> | 2020-04-03 13:49:22 +0800 |
|---|---|---|
| committer | shedaniel <daniel@shedaniel.me> | 2020-04-03 13:49:22 +0800 |
| commit | 12d9839573e6a59fa1e2ca466722a3a8f43bb4f9 (patch) | |
| tree | c718f645d2c145435f2329f2be0365a7f680788e /src/main/java | |
| parent | 172897ef31c38871d0e0274bcd36db8f71254ba3 (diff) | |
| download | RoughlyEnoughItems-12d9839573e6a59fa1e2ca466722a3a8f43bb4f9.tar.gz RoughlyEnoughItems-12d9839573e6a59fa1e2ca466722a3a8f43bb4f9.tar.bz2 RoughlyEnoughItems-12d9839573e6a59fa1e2ca466722a3a8f43bb4f9.zip | |
4.1.4: Updates Auto Config & 20w14a
Signed-off-by: shedaniel <daniel@shedaniel.me>
Diffstat (limited to 'src/main/java')
8 files changed, 16 insertions, 20 deletions
diff --git a/src/main/java/me/shedaniel/rei/gui/ContainerScreenOverlay.java b/src/main/java/me/shedaniel/rei/gui/ContainerScreenOverlay.java index fc7f8f950..7137f0a04 100644 --- a/src/main/java/me/shedaniel/rei/gui/ContainerScreenOverlay.java +++ b/src/main/java/me/shedaniel/rei/gui/ContainerScreenOverlay.java @@ -54,7 +54,6 @@ import net.minecraft.client.resource.language.I18n; import net.minecraft.client.sound.PositionedSoundInstance; import net.minecraft.client.util.NarratorManager; import net.minecraft.client.util.Window; -import net.minecraft.client.util.math.Matrix4f; import net.minecraft.client.util.math.MatrixStack; import net.minecraft.client.world.ClientWorld; import net.minecraft.item.ItemStack; @@ -63,6 +62,7 @@ import net.minecraft.sound.SoundEvents; import net.minecraft.text.TranslatableText; import net.minecraft.util.ActionResult; import net.minecraft.util.Identifier; +import net.minecraft.util.math.Matrix4f; import net.minecraft.world.GameMode; import org.apache.logging.log4j.util.TriConsumer; import org.jetbrains.annotations.ApiStatus; diff --git a/src/main/java/me/shedaniel/rei/gui/RecipeViewingScreen.java b/src/main/java/me/shedaniel/rei/gui/RecipeViewingScreen.java index 756f89868..ffe5f9b19 100644 --- a/src/main/java/me/shedaniel/rei/gui/RecipeViewingScreen.java +++ b/src/main/java/me/shedaniel/rei/gui/RecipeViewingScreen.java @@ -52,13 +52,13 @@ import net.minecraft.client.resource.language.I18n; import net.minecraft.client.sound.PositionedSoundInstance; import net.minecraft.client.util.NarratorManager; import net.minecraft.client.util.Window; -import net.minecraft.client.util.math.Matrix4f; import net.minecraft.client.util.math.MatrixStack; import net.minecraft.sound.SoundEvents; import net.minecraft.text.TranslatableText; import net.minecraft.util.Formatting; import net.minecraft.util.Identifier; import net.minecraft.util.math.MathHelper; +import net.minecraft.util.math.Matrix4f; import org.jetbrains.annotations.ApiStatus; import org.jetbrains.annotations.Nullable; diff --git a/src/main/java/me/shedaniel/rei/gui/widget/EntryListWidget.java b/src/main/java/me/shedaniel/rei/gui/widget/EntryListWidget.java index 154671621..7dc7b5ce8 100644 --- a/src/main/java/me/shedaniel/rei/gui/widget/EntryListWidget.java +++ b/src/main/java/me/shedaniel/rei/gui/widget/EntryListWidget.java @@ -45,11 +45,11 @@ import net.minecraft.client.network.ClientPlayerEntity; import net.minecraft.client.render.Tessellator; import net.minecraft.client.render.VertexConsumerProvider; import net.minecraft.client.resource.language.I18n; -import net.minecraft.client.util.math.Matrix4f; import net.minecraft.client.util.math.MatrixStack; import net.minecraft.item.ItemGroup; import net.minecraft.util.ActionResult; import net.minecraft.util.math.MathHelper; +import net.minecraft.util.math.Matrix4f; import org.jetbrains.annotations.ApiStatus; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; diff --git a/src/main/java/me/shedaniel/rei/impl/ConfigManagerImpl.java b/src/main/java/me/shedaniel/rei/impl/ConfigManagerImpl.java index 95a0ce96d..41c2ba9f7 100644 --- a/src/main/java/me/shedaniel/rei/impl/ConfigManagerImpl.java +++ b/src/main/java/me/shedaniel/rei/impl/ConfigManagerImpl.java @@ -97,8 +97,6 @@ public class ConfigManagerImpl implements ConfigManager { return it instanceof String ? EntryStack.readFromJson(gson.fromJson((String) it, JsonElement.class)) : null; }).build())); GuiRegistry guiRegistry = AutoConfig.getGuiRegistry(ConfigObjectImpl.class); - //noinspection rawtypes - guiRegistry.registerAnnotationProvider((i13n, field, config, defaults, guiProvider) -> Collections.singletonList(ConfigEntryBuilder.create().startEnumSelector(i13n, (Class) field.getType(), getUnsafely(field, config, null)).setDefaultValue(() -> getUnsafely(field, defaults)).setSaveConsumer(newValue -> setUnsafely(field, config, newValue)).build()), field -> field.getType().isEnum(), ConfigObjectImpl.UseEnumSelectorInstead.class); guiRegistry.registerPredicateProvider((i13n, field, config, defaults, guiProvider) -> { if (field.isAnnotationPresent(ConfigEntry.Gui.Excluded.class)) return Collections.emptyList(); diff --git a/src/main/java/me/shedaniel/rei/impl/ConfigObjectImpl.java b/src/main/java/me/shedaniel/rei/impl/ConfigObjectImpl.java index f35536729..710c768f3 100644 --- a/src/main/java/me/shedaniel/rei/impl/ConfigObjectImpl.java +++ b/src/main/java/me/shedaniel/rei/impl/ConfigObjectImpl.java @@ -342,10 +342,6 @@ public class ConfigObjectImpl implements ConfigObject, ConfigData { @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.FIELD}) - @interface UseEnumSelectorInstead {} - - @Retention(RetentionPolicy.RUNTIME) - @Target({ElementType.FIELD}) @interface UseSpecialRecipeTypeScreen {} @Retention(RetentionPolicy.RUNTIME) @@ -379,15 +375,16 @@ public class ConfigObjectImpl implements ConfigObject, ConfigData { public static class Appearance { @UseSpecialRecipeTypeScreen private RecipeScreenType recipeScreenType = RecipeScreenType.UNSET; @Comment("Declares the appearance of REI windows.") private boolean darkTheme = false; - @Comment("The ordering of the items on the item panel.") @UseEnumSelectorInstead + @Comment("The ordering of the items on the item panel.") @ConfigEntry.Gui.EnumHandler(option = ConfigEntry.Gui.EnumHandler.EnumDisplayOption.BUTTON) private ItemListOrderingConfig itemListOrdering = ItemListOrderingConfig.REGISTRY_ASCENDING; - @Comment("Declares the position of the search field.") @UseEnumSelectorInstead + @Comment("Declares the position of the search field.") @ConfigEntry.Gui.EnumHandler(option = ConfigEntry.Gui.EnumHandler.EnumDisplayOption.BUTTON) private SearchFieldLocation searchFieldLocation = SearchFieldLocation.CENTER; @Comment("Declares the position of the item list panel.") private boolean mirrorItemPanel = false; @Comment("Declares the maximum amount of recipes displayed in a page if possible.") @ConfigEntry.BoundedDiscrete(min = 2, max = 99) private int maxRecipePerPage = 3; private boolean clickableRecipeArrows = true; - @Comment("Declares the appearance of recipe's border.") @UseEnumSelectorInstead private RecipeBorderType recipeBorder = RecipeBorderType.DEFAULT; + @Comment("Declares the appearance of recipe's border.") @ConfigEntry.Gui.EnumHandler(option = ConfigEntry.Gui.EnumHandler.EnumDisplayOption.BUTTON) + private RecipeBorderType recipeBorder = RecipeBorderType.DEFAULT; @Comment("Declares whether REI should append mod names to item stacks.") private boolean appendModNames = true; @Comment("Declares how the scrollbar in villager screen should act.") private boolean villagerScreenPermanentScrollBar = false; @Comment("Declares whether entry list widget is scrolled.") private boolean scrollingEntryListWidget = false; diff --git a/src/main/java/me/shedaniel/rei/impl/ItemEntryStack.java b/src/main/java/me/shedaniel/rei/impl/ItemEntryStack.java index 938c3b09c..cb65b0396 100644 --- a/src/main/java/me/shedaniel/rei/impl/ItemEntryStack.java +++ b/src/main/java/me/shedaniel/rei/impl/ItemEntryStack.java @@ -277,11 +277,11 @@ public class ItemEntryStack extends AbstractEntryStack implements OptimalEntrySt BakedModel model = getModelFromStack(stack); boolean bl = !IS_SIDE_LIT.test(model); if (bl) - GlStateManager.method_24221(); + GlStateManager.setupGuiFlatDiffuseLighting(); MinecraftClient.getInstance().getItemRenderer().renderItem(stack, ModelTransformation.Mode.GUI, false, MATRICES, immediate, 15728880, OverlayTexture.DEFAULT_UV, model); immediate.draw(); if (bl) - GlStateManager.method_24222(); + GlStateManager.setupGui3dDiffuseLighting(); MATRICES.pop(); ((ItemStackHook) (Object) stack).rei_setRenderEnchantmentGlint(false); } diff --git a/src/main/java/me/shedaniel/rei/plugin/information/DefaultInformationCategory.java b/src/main/java/me/shedaniel/rei/plugin/information/DefaultInformationCategory.java index 44c301ca4..9e552250f 100644 --- a/src/main/java/me/shedaniel/rei/plugin/information/DefaultInformationCategory.java +++ b/src/main/java/me/shedaniel/rei/plugin/information/DefaultInformationCategory.java @@ -47,9 +47,9 @@ import net.minecraft.client.render.Tessellator; import net.minecraft.client.render.VertexFormats; import net.minecraft.client.resource.language.I18n; import net.minecraft.client.util.Texts; -import net.minecraft.client.util.math.Matrix4f; import net.minecraft.text.Text; import net.minecraft.util.Identifier; +import net.minecraft.util.math.Matrix4f; import org.jetbrains.annotations.NotNull; import java.util.Collections; @@ -166,14 +166,14 @@ public class DefaultInformationCategory implements RecipeCategory<DefaultInforma } return false; } - + @Override public boolean mouseClicked(double mouseX, double mouseY, int button) { if (scrolling.updateDraggingState(mouseX, mouseY, button)) return true; return super.mouseClicked(mouseX, mouseY, button); } - + @Override public boolean mouseDragged(double mouseX, double mouseY, int button, double deltaX, double deltaY) { if (scrolling.mouseDragged(mouseX, mouseY, button, deltaX, deltaY)) diff --git a/src/main/java/me/shedaniel/rei/server/InputSlotCrafter.java b/src/main/java/me/shedaniel/rei/server/InputSlotCrafter.java index 65c7cd916..a24f72691 100644 --- a/src/main/java/me/shedaniel/rei/server/InputSlotCrafter.java +++ b/src/main/java/me/shedaniel/rei/server/InputSlotCrafter.java @@ -36,6 +36,7 @@ import net.minecraft.screen.slot.Slot; import net.minecraft.server.network.ServerPlayerEntity; import net.minecraft.util.Identifier; import net.minecraft.util.collection.DefaultedList; + import java.util.*; public class InputSlotCrafter<C extends Inventory> implements RecipeGridAligner<Integer> { @@ -96,12 +97,12 @@ public class InputSlotCrafter<C extends Inventory> implements RecipeGridAligner< protected void fillInputSlot(Slot slot_1, ItemStack itemStack_1) { int int_1 = this.inventory.method_7371(itemStack_1); if (int_1 != -1) { - ItemStack itemStack_2 = this.inventory.getInvStack(int_1).copy(); + ItemStack itemStack_2 = this.inventory.getStack(int_1).copy(); if (!itemStack_2.isEmpty()) { if (itemStack_2.getCount() > 1) { - this.inventory.takeInvStack(int_1, 1); + this.inventory.removeStack(int_1, 1); } else { - this.inventory.removeInvStack(int_1); + this.inventory.removeStack(int_1); } itemStack_2.setCount(1); |
