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
5 changes: 4 additions & 1 deletion src/main/java/com/cleanroommc/modularui/factory/GuiData.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;

import org.jetbrains.annotations.NotNull;

import java.util.Objects;

/**
Expand All @@ -20,10 +22,11 @@ public class GuiData {

private final EntityPlayer player;

public GuiData(EntityPlayer player) {
public GuiData(@NotNull EntityPlayer player) {
this.player = Objects.requireNonNull(player);
}

@NotNull
public EntityPlayer getPlayer() {
return this.player;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,20 @@
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;

import org.jetbrains.annotations.NotNull;

public class PlayerInventoryGuiData extends GuiData {

private final InventoryType inventoryType;
private final int slotIndex;

public PlayerInventoryGuiData(EntityPlayer player, InventoryType inventoryType, int slotIndex) {
public PlayerInventoryGuiData(@NotNull EntityPlayer player, @NotNull InventoryType inventoryType, int slotIndex) {
super(player);
this.inventoryType = inventoryType;
this.slotIndex = slotIndex;
}

@NotNull
public InventoryType getInventoryType() {
return inventoryType;
}
Expand Down
14 changes: 13 additions & 1 deletion src/main/java/com/cleanroommc/modularui/factory/PosGuiData.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.math.BlockPos;

import org.jetbrains.annotations.NotNull;

import java.util.Objects;

/**
* See {@link GuiData} for an explanation for what this is for.
*/
Expand All @@ -14,13 +18,21 @@ public class PosGuiData extends GuiData {

private final int x, y, z;

public PosGuiData(EntityPlayer player, int x, int y, int z) {
public PosGuiData(@NotNull EntityPlayer player, int x, int y, int z) {
super(player);
this.x = x;
this.y = y;
this.z = z;
}

public PosGuiData(@NotNull EntityPlayer player, @NotNull BlockPos pos) {
super(player);
Objects.requireNonNull(pos);
this.x = pos.getX();
this.y = pos.getY();
this.z = pos.getZ();
}

public int getX() {
return this.x;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,23 @@
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.EnumFacing;

import org.jetbrains.annotations.NotNull;

import java.util.Objects;

/**
* See {@link GuiData} for an explanation for what this is for.
*/
public class SidedPosGuiData extends PosGuiData {

private final EnumFacing side;

public SidedPosGuiData(EntityPlayer player, int x, int y, int z, EnumFacing side) {
public SidedPosGuiData(@NotNull EntityPlayer player, int x, int y, int z, @NotNull EnumFacing side) {
super(player, x, y, z);
this.side = side;
this.side = Objects.requireNonNull(side);
}

@NotNull
public EnumFacing getSide() {
return this.side;
}
Expand Down