Skip to content

Commit

Permalink
Merge pull request #307 from GrowthcraftCE/development
Browse files Browse the repository at this point in the history
2.6.0 Changes
  • Loading branch information
Alatyami committed Jun 5, 2016
2 parents 31af5ba + 3c306e5 commit 7aa086b
Show file tree
Hide file tree
Showing 288 changed files with 8,003 additions and 2,415 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ deploy:
- "checksums.txt"
- "build/libs/growthcraft-*-complete.jar"
- "build/libs/growthcraft-*-api.jar"
- "build/libs/growthcraft-*-dev.jar"
- "build/libs/growthcraft-*-deobf.jar"
- "build/libs/growthcraft-*-javadoc.jar"
- "build/libs/growthcraft-*-sources.jar"
# separate jars
- "build/packages/growthcraft-*-complete-*.jar"
- "build/packages/growthcraft-*-dev-*.jar"
- "build/packages/growthcraft-*-deobf-*.jar"
skip_cleanup: true
on:
tags: true
1 change: 1 addition & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
## Code Monkeys
* Firedingo
* IceDragon
* Gilberreke

## The Idea Guys
* PitchBright
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Growthcraft
===========

[![Minecraft Version](http://img.shields.io/minecraft/1.7.10.png?color=green)](https://minecraft.net/)
[![Growthcraft Version](http://img.shields.io/growthcraft/2.5.1.png?color=green)](https://github.com/GrowthcraftCE/Growthcraft-1.7)
[![Growthcraft Version](http://img.shields.io/growthcraft/2.6.0.png?color=green)](https://github.com/GrowthcraftCE/Growthcraft-1.7)
[![Forge Version](http://img.shields.io/forge/10.13.4.1566.png?color=green)](http://files.minecraftforge.net/)
[![Java Version](http://img.shields.io/java/7.png?color=green)](https://www.java.com/en/)
[![Build Status](https://travis-ci.org/GrowthcraftCE/Growthcraft-1.7.svg?branch=master)](https://travis-ci.org/GrowthcraftCE/Growthcraft-1.7)
Expand Down
40 changes: 40 additions & 0 deletions api/buildcraft/api/tools/IToolWrench.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/**
* Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team
* http://www.mod-buildcraft.com
*
* The BuildCraft API is distributed under the terms of the MIT License.
* Please check the contents of the license, which should be located
* as "LICENSE.API" in the BuildCraft source code distribution.
*/
package buildcraft.api.tools;

import net.minecraft.entity.player.EntityPlayer;

/***
* Implement this interface on subclasses of Item to have that item work as a wrench for buildcraft
*/
public interface IToolWrench {

/***
* Called to ensure that the wrench can be used. To get the ItemStack that is used, check player.inventory.getCurrentItem()
*
* @param player
* - The player doing the wrenching
* @param x
* ,y,z - The coordinates for the block being wrenched
*
* @return true if wrenching is allowed, false if not
*/
boolean canWrench(EntityPlayer player, int x, int y, int z);

/***
* Callback after the wrench has been used. This can be used to decrease durability or for other purposes. To get the ItemStack that was used, check
* player.inventory.getCurrentItem()
*
* @param player
* - The player doing the wrenching
* @param x
* ,y,z - The coordinates of the block being wrenched
*/
void wrenchUsed(EntityPlayer player, int x, int y, int z);
}
12 changes: 12 additions & 0 deletions api/buildcraft/api/tools/package-info.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/**
* Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team
* http://www.mod-buildcraft.com
*
* The BuildCraft API is distributed under the terms of the MIT License.
* Please check the contents of the license, which should be located
* as "LICENSE.API" in the BuildCraft source code distribution.
*/
@API(apiVersion = "1.0", owner = "BuildCraftAPI|core", provides = "BuildCraftAPI|tools")
package buildcraft.api.tools;
import cpw.mods.fml.common.API;

21 changes: 21 additions & 0 deletions api/mcp/mobius/waila/api/ITaggedList.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package mcp.mobius.waila.api;

import java.util.Collection;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.Map.Entry;

public interface ITaggedList<E, T> extends List<E> {
public boolean add(E e, T tag);
public boolean add(E e, Collection<? extends T> taglst);
public Set<T> getTags(E e);
public Set<T> getTags(int index);
public void addTag(E e, T tag);
public void addTag(int index, T tag);
public void removeTag(E e, T tag);
public void removeTag(int index, T tag);
public Set<E> getEntries(T tag);
public void removeEntries(T tag);
public String getTagsAsString(E e);
}
34 changes: 34 additions & 0 deletions api/mcp/mobius/waila/api/IWailaBlock.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package mcp.mobius.waila.api;

import java.util.List;

import net.minecraft.item.ItemStack;

@Deprecated
public interface IWailaBlock {
/*
* Use this method to return an item stack in case the default lookup system fails.
* Return null if you want to use the default lookup system.
* You get the world, the player and the location of the block. With that, it is easy to gather information & tile entities
*/
ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config);

/* Waila HUD is divided into 3 zones. The head corresponds to the item name,
* body to where you mostly want to put informations, and I reserve the tail for modname display
*/

/* Those 2 methods works exactly the same way, except they are related to a different zone in Waila HUD.
* You get in input world, player and the block location. You also get the itemstack as returned by the default lookup system or getWailaStack().
* ConfigHandler provides the current Waila config state so you can show/hide elements depending on the configuration. Refer the ConfigHandler class for more info.
* currenttip represents the current list of text lines in the tooltip zone.
* For example, getWailaHead() will have the current item name as currenttip.
* You can modify the tips, add more, remove some, etc.
* When you are done, just returns the currenttip and it will display in Waila.
*
* Always return the currenttip is you don't want to modify the current zone.
*/

List<String> getWailaHead(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config);
List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config);
List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config);
}
24 changes: 24 additions & 0 deletions api/mcp/mobius/waila/api/IWailaBlockDecorator.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package mcp.mobius.waila.api;

import net.minecraft.item.ItemStack;

/**
* Callback class interface used to provide Block/TileEntity decorator.<br>
* All methods in this interface shouldn't to be called by the implementing mod. An instance of the class is to be
* registered to Waila via the {@link IWailaRegistrar} instance provided in the original registration callback method
* (cf. {@link IWailaRegistrar} documentation for more information).
* @author ProfMobius
*
*/
public interface IWailaBlockDecorator {

/**
* Callback for the decorator. It provides a standard GL stack positioned on the block.</br>
* Will be used if the implementing class is registered via {@link IWailaRegistrar}.{@link registerDecorator}.</br>
* @param itemStack Current block scanned, in ItemStack form.
* @param accessor Contains most of the relevant information about the current environment.
* @param config Current configuration of Waila.
*/
void decorateBlock(ItemStack itemStack, IWailaDataAccessor accessor, IWailaConfigHandler config);

}
37 changes: 37 additions & 0 deletions api/mcp/mobius/waila/api/IWailaCommonAccessor.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
package mcp.mobius.waila.api;

import net.minecraft.block.Block;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;

/**
* The Accessor is used to get some basic data out of the game without having to request direct access to the game engine.<br>
* It will also return things that are unmodified by the overriding systems (like getWailaStack).<br>
* Common accessor for both Entity and Block/TileEntity.<br>
* Available data depends on what it is called upon (ie : getEntity() will return null if looking at a block, etc).<br>
*
*/
public interface IWailaCommonAccessor {
World getWorld();
EntityPlayer getPlayer();
Block getBlock();
int getBlockID();
String getBlockQualifiedName();
int getMetadata();
TileEntity getTileEntity();
Entity getEntity();
MovingObjectPosition getPosition();
Vec3 getRenderingPosition();
NBTTagCompound getNBTData();
int getNBTInteger(NBTTagCompound tag, String keyname);
double getPartialFrame();
ForgeDirection getSide();
ItemStack getStack();
}
44 changes: 44 additions & 0 deletions api/mcp/mobius/waila/api/IWailaConfigHandler.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
package mcp.mobius.waila.api;

import java.util.HashMap;
import java.util.Set;

/**
* Read-only interface for Waila internal config storage.<br>
* An instance of this interface is passed to most of Waila callbacks as a way to change the behavior depending on client settings.
*
* @author ProfMobius
*
*/
public interface IWailaConfigHandler {
/** Returns a set of all the currently loaded modules in the config handler.
*
* @return
*/
public Set<String> getModuleNames();

/**
* Returns all the currently available options for a given module
*
* @param modName Module name
* @return
*/
public HashMap<String, String> getConfigKeys(String modName);

/**
* Returns the current value of an option (true/false) with a default value if not set.
*
* @param key Option to lookup
* @param defvalue Default values
* @return Value of the option or defvalue if not set.
*/
public boolean getConfig(String key, boolean defvalue);

/**
* Returns the current value of an option (true/false) with a default value true if not set
*
* @param key Option to lookup
* @return Value of the option or true if not set.
*/
public boolean getConfig(String key);
}
37 changes: 37 additions & 0 deletions api/mcp/mobius/waila/api/IWailaDataAccessor.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
package mcp.mobius.waila.api;

import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;

/**
* The Accessor is used to get some basic data out of the game without having to request direct access to the game engine.<br>
* It will also return things that are unmodified by the overriding systems (like getWailaStack).<br>
* An instance of this interface is passed to most of Waila Block/TileEntity callbacks.
* @author ProfMobius
*
*/

public interface IWailaDataAccessor{

World getWorld();
EntityPlayer getPlayer();
Block getBlock();
int getBlockID();
String getBlockQualifiedName();
int getMetadata();
TileEntity getTileEntity();
MovingObjectPosition getPosition();
Vec3 getRenderingPosition();
NBTTagCompound getNBTData();
int getNBTInteger(NBTTagCompound tag, String keyname);
double getPartialFrame();
ForgeDirection getSide();
ItemStack getStack();
}
83 changes: 83 additions & 0 deletions api/mcp/mobius/waila/api/IWailaDataProvider.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
package mcp.mobius.waila.api;

import java.util.List;

import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;

/**
* Callback class interface used to provide Block/TileEntity tooltip informations to Waila.<br>
* All methods in this interface shouldn't to be called by the implementing mod. An instance of the class is to be
* registered to Waila via the {@link IWailaRegistrar} instance provided in the original registration callback method
* (cf. {@link IWailaRegistrar} documentation for more information).
* @author ProfMobius
*
*/
public interface IWailaDataProvider{

/**
* Callback used to override the default Waila lookup system.</br>
* Will be used if the implementing class is registered via {@link IWailaRegistrar}.{@link registerStackProvider}.</br>
* @param accessor Contains most of the relevant information about the current environment.
* @param config Current configuration of Waila.
* @return null if override is not required, an ItemStack otherwise.
*/
ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config);

/**
* Callback used to add lines to one of the three sections of the tooltip (Head, Body, Tail).</br>
* Will be used if the implementing class is registered via {@link IWailaRegistrar}.{@link registerHeadProvider} client side.</br>
* You are supposed to always return the modified input currenttip.</br>
*
* @param itemStack Current block scanned, in ItemStack form.
* @param currenttip Current list of tooltip lines (might have been processed by other providers and might be processed by other providers).
* @param accessor Contains most of the relevant information about the current environment.
* @param config Current configuration of Waila.
* @return Modified input currenttip
*/
List<String> getWailaHead(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config);

/**
* Callback used to add lines to one of the three sections of the tooltip (Head, Body, Tail).</br>
* Will be used if the implementing class is registered via {@link IWailaRegistrar}.{@link registerBodyProvider} client side.</br>
* You are supposed to always return the modified input currenttip.</br>
*
* @param itemStack Current block scanned, in ItemStack form.
* @param currenttip Current list of tooltip lines (might have been processed by other providers and might be processed by other providers).
* @param accessor Contains most of the relevant information about the current environment.
* @param config Current configuration of Waila.
* @return Modified input currenttip
*/
List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config);

/**
* Callback used to add lines to one of the three sections of the tooltip (Head, Body, Tail).</br>
* Will be used if the implementing class is registered via {@link IWailaRegistrar}.{@link registerTailProvider} client side.</br>
* You are supposed to always return the modified input currenttip.</br>
*
* @param itemStack Current block scanned, in ItemStack form.
* @param currenttip Current list of tooltip lines (might have been processed by other providers and might be processed by other providers).
* @param accessor Contains most of the relevant information about the current environment.
* @param config Current configuration of Waila.
* @return Modified input currenttip
*/
List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config);

/**
* Callback used server side to return a custom synchronization NBTTagCompound.</br>
* Will be used if the implementing class is registered via {@link IWailaRegistrar}.{@link registerNBTProvider} server and client side.</br>
* You are supposed to always return the modified input NBTTagCompound tag.</br>
* @param player The player requesting data synchronization (The owner of the current connection).
* @param te The TileEntity targeted for synchronization.
* @param tag Current synchronization tag (might have been processed by other providers and might be processed by other providers).
* @param world TileEntity's World.
* @param x X position of the TileEntity.
* @param y Y position of the TileEntity.
* @param z Z position of the TileEntity.
* @return Modified input NBTTagCompound tag.
*/
NBTTagCompound getNBTData(EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, int x, int y, int z);
}
Loading

0 comments on commit 7aa086b

Please sign in to comment.