forked from OreCruncher/BetterRain
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update lotr biome detection to more elegant version
- Loading branch information
Showing
7 changed files
with
54 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,6 @@ | |
|
||
public interface ILOTRProxy { | ||
String getSeason(); | ||
|
||
void registerLOTRBiomes(); | ||
} |
17 changes: 17 additions & 0 deletions
17
src/main/java/org/blockartistry/mod/DynSurround/compat/LotrProxy.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,27 @@ | ||
package org.blockartistry.mod.DynSurround.compat; | ||
|
||
import lotr.common.LOTRDate; | ||
import lotr.common.LOTRDimension; | ||
import org.blockartistry.mod.DynSurround.data.BiomeRegistry; | ||
|
||
import java.util.Arrays; | ||
import java.util.Objects; | ||
import java.util.stream.Stream; | ||
|
||
public class LotrProxy implements ILOTRProxy { | ||
|
||
@Override | ||
public String getSeason() { | ||
return LOTRDate.ShireReckoning.getSeason().name(); | ||
} | ||
|
||
@Override | ||
public void registerLOTRBiomes() { | ||
Stream.concat( | ||
Arrays.stream(LOTRDimension.MIDDLE_EARTH.biomeList), | ||
Arrays.stream(LOTRDimension.UTUMNO.biomeList)) | ||
.filter(Objects::nonNull) | ||
.forEach(lotrBiome -> BiomeRegistry.registry.put(lotrBiome.biomeName, new BiomeRegistry.BiomeRegistryEntry(lotrBiome))); | ||
} | ||
|
||
} |
8 changes: 7 additions & 1 deletion
8
src/main/java/org/blockartistry/mod/DynSurround/compat/NoLotrProxy.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,14 @@ | ||
package org.blockartistry.mod.DynSurround.compat; | ||
|
||
public class NoLotrProxy implements ILOTRProxy{ | ||
public class NoLotrProxy implements ILOTRProxy { | ||
@Override | ||
public String getSeason() { | ||
return "noseason"; | ||
} | ||
|
||
@Override | ||
public void registerLOTRBiomes() { | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters