-
Notifications
You must be signed in to change notification settings - Fork 47
Fixed Issues & Extra details #1576
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
Changes from all commits
0272304
292178e
cec5384
a56249a
ef5bd24
daf511a
9616a08
5ce43af
f7bc75d
20b7aa4
d4ad050
b168924
4078dd3
8f89832
5e26bd2
416a9a5
4ba44d9
ef2cb77
3b6f409
e965b1a
b23b575
e1ff153
0acd23c
e839b98
3b93774
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| fff27e0d7ae0c68144403d5c1abee224 | ||
| fce3db3665c838dddd2ee7d5d8bae949 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| 2ff003f7f3970778df4663f653addcbca05b2436 | ||
| dae01136496d17e71cfdce997fb3fde1bfbc487c |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| 6dee6aa09748cee00cf95e083e350e34c92158f025ef17a678bd901e8f2ba0d3 | ||
| b7736c92fd24fcb1ff254c17edb15a5b12c86be2809de48bb48ed617e206e8a6 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| 975a307243179d593332897ffca2e626c8b53ad638277a16d80c5b23e909c7f176371a1d2d78e4fa0b77e87336d402eb1a5444aa1dbb30a92f8c13b3f92bd306 | ||
| 0d33f144f82836fa278fad18d6477d8ad65cda37a9aa26a4bc1ae355a1d9958832f8226383bfc981cc2c60e7a95974ab11a7de39814f5b920f7fa8a3143c6654 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| 2279401ea52d170347e8b704e867cda1 | ||
| 18805301af5d583f22c957da7549025f |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| 86df9c3267c56a304d407617e43467a53009e093 | ||
| 5bb28b3294425a3a695493583fbad0f9da23a1ba |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| 0bb8a61e1f51c37211d2631c5f85f1cfe53cdea2fb53703b0988d0cf27967ccd | ||
| 9d84813198a7a80225c82966f9d290c457f97a25bcf9f327e74f02ba9ae4817b |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| d344aa159574bd0b06e5d19710adfa7b4bc24cfbf68b4984f0450c53645dbf71df4d0ad05f401695abd6728a94b7411659847e7fd28e90c75244b916ee3bcd91 | ||
| fb009d0f3dc21ba051d94674f2d09984471f0edc3ef654becd4eb0e5c09a59591297d199cadc29433f2d74f2146765c6aab4743f2f4f0a5be2ff0605ace548c5 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -22,6 +22,7 @@ | |
| import net.minecraft.util.Mth; | ||
| import net.minecraft.world.entity.player.Inventory; | ||
| import net.minecraftforge.network.PacketDistributor; | ||
| import org.jetbrains.annotations.NotNull; | ||
|
|
||
| public class InfuserScreen extends AbstractContainerScreen<InfuserMenu> implements RecipeUpdateListener { | ||
| public static class Switch extends AbstractButton { | ||
|
|
@@ -57,22 +58,21 @@ public Switch(AbstractContainerScreen<?> container, ResourceLocation name, | |
| } | ||
|
|
||
| public void renderWidget(GuiGraphics graphics, int p_93844_, int p_93845_, float p_93846_) { | ||
| super.renderWidget(graphics, p_93844_, p_93845_, p_93846_); | ||
| Minecraft minecraft = Minecraft.getInstance(); | ||
| RenderSystem.setShaderTexture(0, sheet); | ||
| RenderSystem.enableDepthTest(); | ||
| Font font = minecraft.font; | ||
| graphics.setColor(1.0F, 1.0F, 1.0F, this.alpha); | ||
| graphics.setColor(1.0F, 1.0F, 1.0F, 1.0f); | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i change that to use a preset alpha because for some reason it was affecting the render, it may is because of my device soo idk |
||
| RenderSystem.enableBlend(); | ||
| RenderSystem.defaultBlendFunc(); | ||
| RenderSystem.enableDepthTest(); | ||
| RenderSystem.blendFunc(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA); | ||
| int switchX = this.isHoveredOrFocused() ? this.width : 0; | ||
| int switchY = this.disabled ? this.height * 2 : (this.toggle ? this.height : 0); | ||
| graphics.blit(sheet, this.getX(), this.getY(), switchX, switchY, this.width, this.height, this.width * 2, this.height * 3); | ||
| super.renderWidget(graphics, p_93844_, p_93845_, p_93846_); | ||
| } | ||
|
|
||
| @Override | ||
| protected void updateWidgetNarration(NarrationElementOutput p_259858_) { | ||
| protected void updateWidgetNarration(@NotNull NarrationElementOutput p_259858_) { | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. inteliJ auto did that |
||
| this.defaultButtonNarrationText(p_259858_); | ||
| } | ||
|
|
||
|
|
@@ -98,15 +98,16 @@ protected void init() { | |
| this.widthTooNarrow = this.width < 379; | ||
| this.recipeBookComponent.init(this.width, this.height, this.minecraft, this.widthTooNarrow, this.menu); | ||
| this.leftPos = this.recipeBookComponent.updateScreenPosition(this.width, this.imageWidth); | ||
| this.addRenderableWidget(new ImageButton(this.leftPos + 16, this.height / 2 - 25, 20, 18, 0, 0, 19, RECIPE_BUTTON_LOCATION, (p_98484_) -> { | ||
| this.addRenderableWidget(new ImageButton(this.leftPos + 16, this.height / 2 - 30, 20, 18, 0, 0, 19, RECIPE_BUTTON_LOCATION, (p_98484_) -> { | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i added a simple offset into the recipe book because it had a very odd position, being inside of the "player inventory label text" |
||
| this.recipeBookComponent.toggleVisibility(); | ||
| this.leftPos = this.recipeBookComponent.updateScreenPosition(this.width, this.imageWidth); | ||
| ((ImageButton)p_98484_).setPosition(this.leftPos + 16, this.height / 2 - 25); | ||
| p_98484_.setPosition(this.leftPos + 16, this.height / 2 - 30); | ||
| maleFemaleSwitch.setPosition(this.leftPos + 135, this.topPos + 61); | ||
| })); | ||
| this.addWidget(this.recipeBookComponent); | ||
| this.setInitialFocus(this.recipeBookComponent); | ||
| this.titleLabelX = 29; | ||
| this.titleLabelX = 5; | ||
| this.titleLabelY = 5; | ||
|
|
||
| maleFemaleSwitch = new Switch(this, Changed.modResource("male_female_switch"), this.leftPos + 135, this.topPos + 61, 20, 10, Component.empty(), false, | ||
| GENDER_SWITCH_LOCATION); | ||
|
|
@@ -116,12 +117,9 @@ protected void init() { | |
| private static final ResourceLocation texture = Changed.modResource("textures/gui/infuser.png"); | ||
|
|
||
| @Override | ||
| public void render(GuiGraphics graphics, int p_98480_, int p_98481_, float p_98482_) { | ||
| public void render(@NotNull GuiGraphics graphics, int p_98480_, int p_98481_, float p_98482_) { | ||
| var variant = Syringe.getVariant(menu.getResultSlot().getItem()); | ||
| if (variant != null && !variant.isGendered()) | ||
| maleFemaleSwitch.disabled = true; | ||
| else | ||
| maleFemaleSwitch.disabled = false; | ||
| maleFemaleSwitch.disabled = variant != null && !variant.isGendered(); | ||
|
|
||
| this.renderBackground(graphics); | ||
| if (this.recipeBookComponent.isVisible() && this.widthTooNarrow) { | ||
|
|
@@ -170,7 +168,7 @@ public void recipesUpdated() { | |
| } | ||
|
|
||
| @Override | ||
| public RecipeBookComponent getRecipeBookComponent() { | ||
| public @NotNull RecipeBookComponent getRecipeBookComponent() { | ||
| return this.recipeBookComponent; | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| package net.ltxprogrammer.changed.mixin.entity; | ||
|
|
||
| import net.ltxprogrammer.changed.init.ChangedLatexTypes; | ||
| import net.ltxprogrammer.changed.world.LatexCoverState; | ||
| import net.minecraft.core.BlockPos; | ||
| import net.minecraft.world.entity.Entity; | ||
| import net.minecraft.world.entity.EntityType; | ||
| import net.minecraft.world.entity.LightningBolt; | ||
| import net.minecraft.world.level.Level; | ||
| import net.minecraft.world.level.block.Blocks; | ||
| import net.minecraft.world.level.block.LightningRodBlock; | ||
| import net.minecraft.world.level.block.state.BlockState; | ||
| import org.spongepowered.asm.mixin.Mixin; | ||
| import org.spongepowered.asm.mixin.Shadow; | ||
| import org.spongepowered.asm.mixin.injection.At; | ||
| import org.spongepowered.asm.mixin.injection.Inject; | ||
| import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | ||
|
|
||
| @Mixin(LightningBolt.class) | ||
| public abstract class LightingBoltMixin extends Entity { | ||
| @Shadow protected abstract BlockPos getStrikePosition(); | ||
|
|
||
| public LightingBoltMixin(EntityType<?> entityType, Level level) { | ||
| super(entityType, level); | ||
| } | ||
|
|
||
| @Inject(method = "spawnFire", at = @At("HEAD"), cancellable = true) // This trigger is better | ||
| private void latexCoverIsStruckByLighting(CallbackInfo ci) { | ||
| BlockPos strikePosition = this.getStrikePosition(); | ||
| Level level = level(); | ||
| LatexCoverState strikePositionCoverState = LatexCoverState.getAt(level, strikePosition); | ||
| LightningBolt self = (LightningBolt) (Object) this; | ||
| if (!strikePositionCoverState.isAir()) { | ||
| ci.cancel(); | ||
| strikePositionCoverState.onStruckByLighting(level, strikePosition, self); | ||
| } | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the widgets don't go well with stacks... and the "text" of the switch button was going in the way of the button switch
to be safe i just move the render to before the button render