Skip to content

Commit

Permalink
Fix NullReferenceException at getCapacity->getBlockMetadata (#97)
Browse files Browse the repository at this point in the history
* fix NullReferenceException on getBlockMetadata

* oh no-no, please be static, it's your present! :)
  • Loading branch information
Pilzinsel64 authored Feb 10, 2023
1 parent 29b0d71 commit b5752a8
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ private int getCapacity() {
private static int getCapacity(TileEntitySolarPanel panel, int panelsCount) {
int capacity = ENERGY_PER;

if (panel != null) {
if (panel != null && panel.hasWorldObj()) {
int meta = panel.getBlockMetadata();
switch (meta) {
case 0: // Default
Expand Down

0 comments on commit b5752a8

Please sign in to comment.