Merge remote-tracking branch 'remotes/origin/1.15' into 1.16

# Conflicts:
#	build.gradle
#	src/main/java/techreborn/init/ModLoot.java
This commit is contained in:
modmuss50 2020-06-01 22:25:00 +01:00
commit bbc4b2b765
4 changed files with 39 additions and 12 deletions

View file

@ -65,10 +65,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;
@ -103,6 +99,9 @@ public class SolarPanelBlockEntity extends PowerAcceptorBlockEntity implements I
}
private void updateState() {
if (world == null) {
return;
}
if (world.isSkyVisible(pos.up())) {
this.setSunState(NIGHTGEN);
@ -112,6 +111,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;
@ -143,6 +146,10 @@ public class SolarPanelBlockEntity extends PowerAcceptorBlockEntity implements I
public void tick() {
super.tick();
if (world == null){
return;
}
if (world.isClient) {
return;
}