Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
+ return false;
+ }
+ BlockState state = level.getBlockState(pos);
+ return state.ignitedByLava();
+ return state.ignitedByLava(level, pos, face);
+ }
+
@Nullable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,31 @@
import com.mojang.blaze3d.vertex.VertexFormat;
import java.util.Collections;
import java.util.List;
import java.util.function.Consumer;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiGraphics;
import net.minecraft.client.gui.components.AbstractWidget;
import net.minecraft.client.gui.components.Renderable;
import net.minecraft.client.gui.components.events.AbstractContainerEventHandler;
import net.minecraft.client.gui.components.events.GuiEventListener;
import net.minecraft.client.gui.layouts.LayoutElement;
import net.minecraft.client.gui.narration.NarratableEntry;
import net.minecraft.client.gui.narration.NarrationElementOutput;
import net.minecraft.client.gui.navigation.ScreenRectangle;
import net.minecraft.client.gui.screens.Screen;
import net.minecraft.client.renderer.GameRenderer;

/**
* Abstract scroll panel class.
*/
public abstract class ScrollPanel extends AbstractContainerEventHandler implements Renderable, NarratableEntry {
public abstract class ScrollPanel extends AbstractContainerEventHandler implements Renderable, NarratableEntry, LayoutElement {
private final Minecraft client;
protected final int width;
protected final int height;
protected final int top;
protected final int bottom;
protected final int right;
protected final int left;
protected int width;
protected int height;
protected int top;
protected int bottom;
protected int right;
protected int left;
private boolean scrolling;
protected float scrollDistance;
protected boolean captureMouse = true;
Expand Down Expand Up @@ -173,6 +178,11 @@ public boolean isMouseOver(double mouseX, double mouseY) {
mouseY >= this.top && mouseY < this.bottom;
}

@Override
public ScreenRectangle getRectangle() {
return super.getRectangle();
}

@Override
public boolean mouseClicked(double mouseX, double mouseY, int button) {
if (super.mouseClicked(mouseX, mouseY, button))
Expand Down Expand Up @@ -295,4 +305,47 @@ protected void drawGradientRect(GuiGraphics guiGraphics, int left, int top, int
public List<? extends GuiEventListener> children() {
return Collections.emptyList();
}

@Override
public void setX(int p_265236_) {
this.left = p_265236_;
this.right = p_265236_ + width;
}

@Override
public void setY(int p_265404_) {
this.top = p_265404_;
this.bottom = p_265404_ + height;
}

@Override
public int getX() {
return this.left;
}

@Override
public int getY() {
return this.top;
}

@Override
public int getWidth() {
return this.width;
}

@Override
public int getHeight() {
return this.height;
}

@Override
public void visitWidgets(Consumer<AbstractWidget> p_265082_) {}

@Override
public NarrationPriority narrationPriority() {
return null;
}

@Override
public void updateNarration(NarrationElementOutput p_169152_) {}
}
Loading