Code style changes, entities fixes

This commit is contained in:
paulevsGitch 2021-07-08 00:21:47 +03:00
parent 9d604b2d25
commit 44962e18b6
377 changed files with 5038 additions and 4914 deletions

View file

@ -2,7 +2,6 @@ package ru.betterend.client.gui;
import com.mojang.blaze3d.systems.RenderSystem;
import com.mojang.blaze3d.vertex.PoseStack;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.client.gui.components.ImageButton;
@ -21,15 +20,15 @@ public class EndStoneSmelterScreen extends AbstractContainerScreen<EndStoneSmelt
private final static ResourceLocation RECIPE_BUTTON_TEXTURE = new ResourceLocation("textures/gui/recipe_button.png");
private final static ResourceLocation BACKGROUND_TEXTURE = BetterEnd.makeID("textures/gui/smelter_gui.png");
public final EndStoneSmelterRecipeBookScreen recipeBook;
private boolean narrow;
public EndStoneSmelterScreen(EndStoneSmelterScreenHandler handler, Inventory inventory, Component title) {
super(handler, inventory, title);
recipeBook = new EndStoneSmelterRecipeBookScreen();
}
public void init() {
super.init();
//TODO: test in 1.17
@ -39,7 +38,7 @@ public class EndStoneSmelterScreen extends AbstractContainerScreen<EndStoneSmelt
addRenderableWidget(new ImageButton(leftPos + 20, height / 2 - 49, 20, 18, 0, 0, 19, RECIPE_BUTTON_TEXTURE, (buttonWidget) -> {
recipeBook.initVisuals();
recipeBook.toggleVisibility();
leftPos = recipeBook.updateScreenPosition( width, imageWidth);
leftPos = recipeBook.updateScreenPosition(width, imageWidth);
((ImageButton) buttonWidget).setPosition(leftPos + 20, height / 2 - 49);
}));
titleLabelX = (imageWidth - font.width(title)) / 2;
@ -57,7 +56,8 @@ public class EndStoneSmelterScreen extends AbstractContainerScreen<EndStoneSmelt
if (recipeBook.isVisible() && narrow) {
renderBg(matrices, delta, mouseX, mouseY);
recipeBook.render(matrices, mouseX, mouseY, delta);
} else {
}
else {
recipeBook.render(matrices, mouseX, mouseY, delta);
super.render(matrices, mouseX, mouseY, delta);
recipeBook.renderGhostRecipe(matrices, leftPos, topPos, true, delta);
@ -70,7 +70,8 @@ public class EndStoneSmelterScreen extends AbstractContainerScreen<EndStoneSmelt
public boolean mouseClicked(double mouseX, double mouseY, int button) {
if (this.recipeBook.mouseClicked(mouseX, mouseY, button)) {
return true;
} else {
}
else {
return narrow && recipeBook.isVisible() || super.mouseClicked(mouseX, mouseY, button);
}
}