Skip to content

Commit

Permalink
Nullcheck - should resolve #256
Browse files Browse the repository at this point in the history
  • Loading branch information
Direwolf20-MC committed Jul 28, 2024
1 parent a04d47a commit 236fa49
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ minecraft_version=1.21
# as they do not follow standard versioning conventions.
minecraft_version_range=[1.21,1.22)
# The Neo version must agree with the Minecraft version to get a valid artifact
neo_version=21.0.117-beta
neo_version=21.0.139-beta
# The Neo version range can use any version of Neo as bounds
neo_version_range=[21.0,)
# The loader version range can only use the major version of FML as bounds
Expand Down
1 change: 1 addition & 0 deletions src/main/java/com/direwolf20/laserio/common/LaserIO.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ public LaserIO(IEventBus eventBus, ModContainer container) {
}

private void registerCapabilities(RegisterCapabilitiesEvent event) {
//TODO 1.22 REMOVE
event.registerBlock(Capabilities.ItemHandler.BLOCK,
(level, pos, state, be, side) -> {
if (side != null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2189,6 +2189,7 @@ public IFluidHandler getAttachedFluidTankNoCache(Direction direction, Byte sneak

public LaserNodeEnergyHandler getLaserNodeHandlerEnergy(InserterCardCache inserterCardCache) {
if (!inserterCardCache.cardType.equals(BaseCard.CardType.ENERGY)) return null;
if (level == null) return null;
GlobalPos nodeWorldPos = new GlobalPos(MiscTools.getLevel(level.getServer(), inserterCardCache.relativePos).dimension(), getWorldPos(inserterCardCache.relativePos.pos()));
if (!chunksLoaded(nodeWorldPos, nodeWorldPos.pos().relative(inserterCardCache.direction))) return null;
LaserNodeBE be = getNodeAt(new GlobalPos(MiscTools.getLevel(level.getServer(), inserterCardCache.relativePos).dimension(), getWorldPos(inserterCardCache.relativePos.pos())));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public InteractionResultHolder<ItemStack> use(Level level, Player player, Intera
return new InteractionResultHolder<>(InteractionResult.PASS, itemstack);
}

//TODO: 1.22 Consider setting default to 8
public static byte setItemExtractAmt(ItemStack card, byte itemextractamt) {
if (itemextractamt == 1)
card.remove(LaserIODataComponents.ITEM_CARD_EXTRACT_AMT);
Expand Down

0 comments on commit 236fa49

Please sign in to comment.