Skip to content

Commit

Permalink
Fixes missing get calls on RegisterSupplier<Item>
Browse files Browse the repository at this point in the history
Fixes #446
  • Loading branch information
tyra314 committed Dec 4, 2022
1 parent 6bc38ec commit 6aa1010
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public void drawOverlay(MatrixStack matrices, VertexConsumerProvider vertexConsu
this.player = MinecraftClient.getInstance().player;
this.world = MinecraftClient.getInstance().world;

if (!atlas.isEmpty() && atlas.getItem() == RegistrarAntiqueAtlas.ATLAS.getOrNull()) {
if (!atlas.isEmpty() && atlas.getItem() == RegistrarAntiqueAtlas.ATLAS.get()) {
int atlasID = AtlasItem.getAtlasID(atlas);
drawMinimap(matrices, atlasID, vertexConsumer, light);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public TypedActionResult<ItemStack> use(World world, PlayerEntity player,
}

int atlasID = AntiqueAtlasMod.getGlobalAtlasData(world).getNextAtlasId();
ItemStack atlasStack = new ItemStack(RegistrarAntiqueAtlas.ATLAS.getOrNull());
ItemStack atlasStack = new ItemStack(RegistrarAntiqueAtlas.ATLAS.get());

atlasStack.getOrCreateTag().putInt("atlasID", atlasID);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ public boolean matches(CraftingInventory inv, World world) {
ItemStack stack = inv.getStack(j);

if (!stack.isEmpty()) {
if (stack.getItem() == RegistrarAntiqueAtlas.ATLAS) {
if (stack.getItem() == RegistrarAntiqueAtlas.ATLAS.get()) {
if (!filledAtlas.isEmpty()) {
return false;
}
filledAtlas = stack;
} else {
if (stack.getItem() != RegistrarAntiqueAtlas.EMPTY_ATLAS) {
if (stack.getItem() != RegistrarAntiqueAtlas.EMPTY_ATLAS.get()) {
return false;
}
i++;
Expand All @@ -59,13 +59,13 @@ public ItemStack craft(CraftingInventory inv) {
ItemStack stack = inv.getStack(j);

if (!stack.isEmpty()) {
if (stack.getItem() == RegistrarAntiqueAtlas.ATLAS) {
if (stack.getItem() == RegistrarAntiqueAtlas.ATLAS.get()) {
if (!filledAtlas.isEmpty()) {
return ItemStack.EMPTY;
}
filledAtlas = stack;
} else {
if (stack.getItem() != RegistrarAntiqueAtlas.EMPTY_ATLAS) {
if (stack.getItem() != RegistrarAntiqueAtlas.EMPTY_ATLAS.get()) {
return ItemStack.EMPTY;
}
i++;
Expand All @@ -74,7 +74,7 @@ public ItemStack craft(CraftingInventory inv) {
}

if (!filledAtlas.isEmpty() && i >= 1) {
ItemStack newAtlas = new ItemStack(RegistrarAntiqueAtlas.ATLAS.getOrNull(), i + 1);
ItemStack newAtlas = new ItemStack(RegistrarAntiqueAtlas.ATLAS.get(), i + 1);
newAtlas.getOrCreateTag().putInt("atlasID", AtlasItem.getAtlasID(filledAtlas));

if (filledAtlas.hasCustomName()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ private boolean matches(CraftingInventory inv) {
for (int i = 0; i < inv.size(); ++i) {
ItemStack stack = inv.getStack(i);
if (!stack.isEmpty()) {
if (stack.getItem() == RegistrarAntiqueAtlas.ATLAS) {
if (stack.getItem() == RegistrarAntiqueAtlas.ATLAS.get()) {
atlasesFound++;
}
}
Expand Down Expand Up @@ -82,7 +82,7 @@ public boolean fits(int width, int height) {

@Override
public ItemStack getOutput() {
return new ItemStack(RegistrarAntiqueAtlas.ATLAS.getOrNull());
return new ItemStack(RegistrarAntiqueAtlas.ATLAS.get());
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public abstract class HeldItemRendererMixin {

@Inject(method = "renderFirstPersonItem", at = @At(value = "INVOKE", target = "Lnet/minecraft/item/ItemStack;isEmpty()Z", ordinal = 0), locals = LocalCapture.CAPTURE_FAILHARD, cancellable = true)
private void renderAtlas(AbstractClientPlayerEntity player, float tickDelta, float pitch, Hand hand, float swingProgress, ItemStack item, float equipProgress, MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light, CallbackInfo ci, boolean bl, Arm arm) {
if (item.getItem() == RegistrarAntiqueAtlas.ATLAS.getOrNull()) {
if (item.getItem() == RegistrarAntiqueAtlas.ATLAS.get()) {
if (bl && this.offHand.isEmpty()) {
renderAtlasInBothHands(matrices, vertexConsumers, light, pitch, equipProgress, swingProgress);
} else {
Expand Down

0 comments on commit 6aa1010

Please sign in to comment.