mirror of
https://github.com/GTNewHorizons/Chisel.git
synced 2026-11-18 19:49:12 +00:00
sync with server
This commit is contained in:
1 parent
8c82d0fa41
commit
3ae2128564
5 files changed
+51
-9
No files matched your search
@@ -163,11 +163,7 @@ public class GuiChisel extends GuiContainer {
|
||||
@Override
|
||||
protected void mouseClicked(int xCoord, int yCoord, int btn) {
|
||||
if (scrollBar != null) {
|
||||
int currentScroll = scrollBar.getCurrentScroll();
|
||||
scrollBar.click(xCoord - guiLeft, yCoord - guiTop);
|
||||
if (currentScroll != scrollBar.getCurrentScroll()) {
|
||||
menu.updateItems();
|
||||
}
|
||||
}
|
||||
super.mouseClicked(xCoord, yCoord, btn);
|
||||
}
|
||||
@@ -178,11 +174,7 @@ public class GuiChisel extends GuiContainer {
|
||||
|
||||
int i = Mouse.getEventDWheel();
|
||||
if (i != 0 && scrollBar != null) {
|
||||
int currentScroll = scrollBar.getCurrentScroll();
|
||||
scrollBar.wheel(i);
|
||||
if (currentScroll != scrollBar.getCurrentScroll()) {
|
||||
menu.updateItems();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,6 +3,8 @@ package team.chisel.client.gui;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import team.chisel.inventory.ContainerChisel;
|
||||
import team.chisel.network.PacketHandler;
|
||||
import team.chisel.network.message.MessageScrollUpdate;
|
||||
|
||||
public class GuiScrollbar {
|
||||
public static final ResourceLocation TEXTURE_RESOURCE_LOCATION = new ResourceLocation("minecraft", "textures/gui/container/creative_inventory/tabs.png");
|
||||
@@ -62,6 +64,7 @@ public class GuiScrollbar {
|
||||
|
||||
private void setCurrentScroll(int scroll) {
|
||||
container.inventory.setCurrentScroll(scroll * rowSize);
|
||||
PacketHandler.INSTANCE.sendToServer(new MessageScrollUpdate(scroll * rowSize));
|
||||
}
|
||||
|
||||
private int applyRange(int scroll) {
|
||||
|
||||
Reference in new issue
Block a user