mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-28 15:36:18 +00:00
Add climate data
This commit is contained in:
1 parent
212f857692
commit
6c869cab98
18 files changed
+125
-215
No files matched your search
@@ -7,20 +7,16 @@ package forestry.api.climate;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
public class BlankClimateModifier implements IClimateModifier {
|
||||
@Override
|
||||
public IClimateState modifyTarget(IClimateContainer container, IClimateState newState, ImmutableClimateState oldState, NBTTagCompound data) {
|
||||
return newState;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addTableEntries(IClimateContainer container, IClimateState climateState, NBTTagCompound data, ClimateType tableType, IClimateTable table) {
|
||||
public void addData(IClimateContainer container, IClimateState climateState, NBTTagCompound nbtData, IClimateData data) {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getPriority() {
|
||||
return 0;
|
||||
|
||||
@@ -56,9 +56,9 @@ public interface IClimateContainer extends INbtReadable, INbtWritable, IClimateS
|
||||
ImmutableClimateState getTargetedState();
|
||||
|
||||
void setTargetedState(ImmutableClimateState state);
|
||||
|
||||
|
||||
@Nullable
|
||||
@SideOnly(Side.CLIENT)
|
||||
IClimateTable getTable(IClimateTableHelper helper, ClimateType type, boolean withTitle);
|
||||
IClimateData getData();
|
||||
|
||||
}
|
||||
@@ -5,7 +5,11 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.climate;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public interface IClimateData {
|
||||
|
||||
void addData(ClimateType type, float value);
|
||||
IClimateData addData(ClimateType type, String displayName, float value);
|
||||
|
||||
Map<String, Float> getData(ClimateType type);
|
||||
}
|
||||
@@ -21,13 +21,13 @@ public interface IClimateModifier {
|
||||
* @param container the climate container
|
||||
* @param newState the new climate state
|
||||
* @param oldState the climate static of the previous modification.
|
||||
* @param data A {@link NBTTagCompound} that can be used to save custom data or to send it to the client to show it in the {@link IClimateTable}.
|
||||
* @param data A {@link NBTTagCompound} that can be used to save custom data or to send it to the client to add it to the {@link IClimateData}.
|
||||
* @return a modify newState or the newState.
|
||||
*/
|
||||
IClimateState modifyTarget(IClimateContainer container, IClimateState newState, ImmutableClimateState oldState, NBTTagCompound data);
|
||||
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
void addTableEntries(IClimateContainer container, IClimateState climateState, NBTTagCompound data, ClimateType tableType, IClimateTable table);
|
||||
void addData(IClimateContainer container, IClimateState climateState, NBTTagCompound nbtData, IClimateData data);
|
||||
|
||||
/**
|
||||
* @return The priority of this modifier. The modifier with the highest priority is called first and the modifier with the lowest at last.
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
/*******************************************************************************
|
||||
* Copyright 2011-2014 SirSengir
|
||||
*
|
||||
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
|
||||
******************************************************************************/
|
||||
package forestry.api.climate;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public interface IClimateTable {
|
||||
|
||||
IClimateTable addValueEntry(String textKey, String value);
|
||||
|
||||
IClimateTable addCenteredEntry(String textKey);
|
||||
|
||||
IClimateTable addEmptyEntry();
|
||||
|
||||
IClimateTable addEntry(IClimateTableEntry entry);
|
||||
|
||||
int getHeight();
|
||||
|
||||
int getLineWidth();
|
||||
|
||||
Collection<IClimateTableEntry> getEntrys();
|
||||
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
/*******************************************************************************
|
||||
* Copyright 2011-2014 SirSengir
|
||||
*
|
||||
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
|
||||
******************************************************************************/
|
||||
package forestry.api.climate;
|
||||
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public interface IClimateTableEntry {
|
||||
|
||||
void draw(FontRenderer fontRenderer, int x, int y, int lineWidth, int lineStart, int lineEnd, int rowTopY, int rowBottomY, int fontColor, boolean drawBackground);
|
||||
|
||||
int getHeight(FontRenderer fontRenderer);
|
||||
|
||||
int getLineWidth(FontRenderer fontRenderer);
|
||||
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
/*******************************************************************************
|
||||
* Copyright 2011-2014 SirSengir
|
||||
*
|
||||
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
|
||||
******************************************************************************/
|
||||
package forestry.api.climate;
|
||||
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public interface IClimateTableHelper {
|
||||
|
||||
IClimateTable createTable(String titleKey);
|
||||
|
||||
void drawTable(IClimateTable table, int x, int y, int fontColor, boolean drawBackground);
|
||||
}
|
||||
Reference in new issue
Block a user