-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#change "Fixed issue where weight breaks the game" #change "Added equ…
…ation functionality through java API" #change "made panorama screenshot text have an underline, like normal screenshot text" #change "Bump version" #release beta
- Loading branch information
Showing
13 changed files
with
266 additions
and
156 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
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 |
---|---|---|
|
@@ -4,4 +4,5 @@ | |
|
||
public interface MinecraftClientAccess { | ||
void setClientPanorama(Panorama pan); | ||
Panorama getClientPanorama(); | ||
} |
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
88 changes: 44 additions & 44 deletions
88
src/main/java/com/terraformersmc/vistas/api/panorama/Panoramas.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,53 +1,53 @@ | ||
package com.terraformersmc.vistas.api.panorama; | ||
|
||
import java.util.Random; | ||
|
||
import com.terraformersmc.vistas.Vistas; | ||
import com.terraformersmc.vistas.access.MinecraftClientAccess; | ||
import com.terraformersmc.vistas.config.PanoramaConfig; | ||
import me.sargunvohra.mcmods.autoconfig1u.AutoConfig; | ||
import net.minecraft.client.MinecraftClient; | ||
|
||
import java.util.Random; | ||
import net.minecraft.client.MinecraftClient; | ||
|
||
public class Panoramas { | ||
public static Panorama getCurrent() { | ||
|
||
Panorama pickedPanorama = null; | ||
|
||
if (AutoConfig.getConfigHolder(PanoramaConfig.class) != null) { | ||
pickedPanorama = Vistas.panoramas.get(PanoramaConfig.getInstance().panorama); | ||
} else { | ||
Vistas.LOGGER.warn("Config not registered while trying for panorama"); | ||
} | ||
|
||
if (pickedPanorama == null) { | ||
Vistas.LOGGER.warn("Config panorama null"); | ||
} | ||
|
||
return pickedPanorama; | ||
} | ||
|
||
public static Panorama getRandom() { | ||
return Vistas.panoramas.values().toArray(new Panorama[0])[new Random().nextInt(Vistas.panoramas.size())]; | ||
} | ||
|
||
public static void setRandom() { | ||
if (!PanoramaConfig.getInstance().forcePanorama) { | ||
if (Vistas.panoramas.size() >= 1) { | ||
Panorama pan = getRandom(); | ||
PanoramaConfig.getInstance().panorama = pan.getName(); | ||
((MinecraftClientAccess) MinecraftClient.getInstance()).setClientPanorama(pan); | ||
} | ||
} | ||
} | ||
|
||
public static void reload() { | ||
Vistas.panoramas.clear(); | ||
Vistas.panoramas.putAll(Vistas.builtinPanoramas); | ||
Vistas.panoramas.putAll(Vistas.resourcePanoramas); | ||
setRandom(); | ||
} | ||
|
||
public static void add(Panorama panorama) { | ||
Vistas.addBuiltInPanorama(panorama); | ||
} | ||
|
||
public static Panorama getCurrent() { | ||
|
||
Panorama pickedPanorama = Vistas.panoramas.get(PanoramaConfig.getInstance().panorama + "_0"); | ||
|
||
if (pickedPanorama == null) { | ||
Vistas.LOGGER.warn("Config panorama null, trying client"); | ||
pickedPanorama = ((MinecraftClientAccess) MinecraftClient.getInstance()).getClientPanorama(); | ||
} | ||
|
||
if (pickedPanorama == null) { | ||
Vistas.LOGGER.warn("Client panorama null"); | ||
} | ||
|
||
return pickedPanorama; | ||
} | ||
|
||
public static Panorama getRandom() { | ||
return Vistas.panoramas.values().toArray(new Panorama[0])[new Random().nextInt(Vistas.panoramas.size())]; | ||
} | ||
|
||
public static void setRandom() { | ||
if (!PanoramaConfig.getInstance().forcePanorama) { | ||
if (Vistas.panoramas.size() >= 1) { | ||
Panorama pan = getRandom(); | ||
PanoramaConfig.getInstance().panorama = pan.getName(); | ||
((MinecraftClientAccess) MinecraftClient.getInstance()).setClientPanorama(pan); | ||
} | ||
} | ||
} | ||
|
||
public static void reload() { | ||
Vistas.panoramas.clear(); | ||
Vistas.panoramas.putAll(Vistas.builtinPanoramas); | ||
Vistas.panoramas.putAll(Vistas.resourcePanoramas); | ||
setRandom(); | ||
} | ||
|
||
public static void add(Panorama panorama) { | ||
Vistas.addBuiltInPanorama(panorama); | ||
} | ||
} |
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
Oops, something went wrong.