Solar panels will work in Nether and The End. Closes #2105
This commit is contained in:
parent
2e67d56225
commit
fdc6f88dbc
1 changed files with 11 additions and 4 deletions
|
@ -63,10 +63,6 @@ public class SolarPanelBlockEntity extends PowerAcceptorBlockEntity implements I
|
|||
|
||||
private SolarPanels panel;
|
||||
|
||||
public SolarPanelBlockEntity() {
|
||||
super(TRBlockEntities.SOLAR_PANEL);
|
||||
}
|
||||
|
||||
public SolarPanelBlockEntity(SolarPanels panel) {
|
||||
super(TRBlockEntities.SOLAR_PANEL);
|
||||
this.panel = panel;
|
||||
|
@ -101,6 +97,9 @@ public class SolarPanelBlockEntity extends PowerAcceptorBlockEntity implements I
|
|||
}
|
||||
|
||||
private void updateState() {
|
||||
if (world == null) {
|
||||
return;
|
||||
}
|
||||
if (world.isSkyVisible(pos.up())) {
|
||||
this.setSunState(NIGHTGEN);
|
||||
|
||||
|
@ -110,6 +109,10 @@ public class SolarPanelBlockEntity extends PowerAcceptorBlockEntity implements I
|
|||
} else {
|
||||
this.setSunState(ZEROGEN);
|
||||
}
|
||||
// Nether and The End
|
||||
if (!world.dimension.hasSkyLight()) {
|
||||
this.setSunState(NIGHTGEN);
|
||||
}
|
||||
|
||||
if (prevState != this.getSunState()) {
|
||||
boolean isGenerating = getSunState() == DAYGEN;
|
||||
|
@ -141,6 +144,10 @@ public class SolarPanelBlockEntity extends PowerAcceptorBlockEntity implements I
|
|||
public void tick() {
|
||||
super.tick();
|
||||
|
||||
if (world == null){
|
||||
return;
|
||||
}
|
||||
|
||||
if (world.isClient) {
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue