-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7bee043
commit 024319d
Showing
6 changed files
with
96 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
src/main/java/io/github/teampropulsive/screen/BlueprintTableScreen.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package io.github.teampropulsive.screen; | ||
|
||
import io.github.teampropulsive.Propulsive; | ||
import net.minecraft.client.gui.DrawContext; | ||
import net.minecraft.client.gui.screen.ingame.HandledScreen; | ||
import net.minecraft.entity.player.PlayerInventory; | ||
import net.minecraft.text.Text; | ||
import net.minecraft.util.Identifier; | ||
|
||
public class BlueprintTableScreen extends HandledScreen<BlueprintTableScreenHandler> { | ||
private static final Identifier TEXTURE = Propulsive.id("textures/gui/blueprint_table.png"); | ||
|
||
public BlueprintTableScreen(BlueprintTableScreenHandler handler, PlayerInventory inventory, Text title) { | ||
super(handler, inventory, title); | ||
} | ||
|
||
@Override | ||
protected void drawBackground(DrawContext context, float delta, int mouseX, int mouseY) { | ||
context.drawTexture(TEXTURE, this.x, this.y, 0, 0, this.backgroundWidth, this.backgroundHeight); | ||
} | ||
} |
39 changes: 39 additions & 0 deletions
39
src/main/java/io/github/teampropulsive/screen/BlueprintTableScreenHandler.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package io.github.teampropulsive.screen; | ||
|
||
import io.github.teampropulsive.Propulsive; | ||
import net.minecraft.entity.player.PlayerEntity; | ||
import net.minecraft.entity.player.PlayerInventory; | ||
import net.minecraft.item.ItemStack; | ||
import net.minecraft.network.PacketByteBuf; | ||
import net.minecraft.screen.ScreenHandler; | ||
import net.minecraft.screen.slot.Slot; | ||
|
||
public class BlueprintTableScreenHandler extends ScreenHandler { | ||
public BlueprintTableScreenHandler(int syncId, PlayerInventory inventory, PacketByteBuf buf) { | ||
this(syncId, inventory); | ||
// read data from buf | ||
} | ||
|
||
public BlueprintTableScreenHandler(int syncId, PlayerInventory inventory) { | ||
super(Propulsive.BLUEPRINT_TABLE_SCREEN, syncId); | ||
|
||
for (int m = 0; m < 3; m++) { | ||
for (int l = 0; l < 9; l++) { | ||
this.addSlot(new Slot(inventory, l + m * 9 + 9, 8 + l * 18, 84 + m * 18)); | ||
} | ||
} | ||
for (int m = 0; m < 9; m++) { | ||
this.addSlot(new Slot(inventory, m, 8 + m * 18, 142)); | ||
} | ||
} | ||
|
||
@Override | ||
public ItemStack quickMove(PlayerEntity player, int slot) { | ||
return null; | ||
} | ||
|
||
@Override | ||
public boolean canUse(PlayerEntity player) { | ||
return true; | ||
} | ||
} |