port to forestry 4.2

This commit is contained in:
marcin212 committed 2016-10-20 02:56:31 +02:00
1 parent dbc5c1a564
commit f969f63b66
3697 files changed
+78372

No files matched your search

@@ -0,0 +1,46 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.core.resource;
import binnie.core.BinnieCore;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.renderer.texture.IIconRegister;
import binnie.Binnie;
import binnie.core.AbstractMod;
import net.minecraft.util.IIcon;
public class BinnieIcon extends BinnieResource
{
private int textureSheet;
private IIcon icon;
public BinnieIcon(final AbstractMod mod, final ResourceType type, final String path) {
super(mod, type, path);
this.textureSheet = 0;
this.icon = null;
this.textureSheet = ((type != ResourceType.Block) ? 1 : 0);
Binnie.Resource.registerIcon(this);
}
public IIcon getIcon() {
return this.icon;
}
@SideOnly(Side.CLIENT)
public IIcon getIcon(final IIconRegister register) {
this.registerIcon(register);
return this.icon;
}
@SideOnly(Side.CLIENT)
public void registerIcon(final IIconRegister register) {
this.icon = BinnieCore.proxy.getIcon(register, this.mod, this.path);
}
public int getTextureSheet() {
return this.textureSheet;
}
}
@@ -0,0 +1,37 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.core.resource;
import net.minecraft.util.ResourceLocation;
import binnie.core.AbstractMod;
public class BinnieResource
{
String mod;
private ResourceType type;
String path;
public BinnieResource(final AbstractMod mod, final ResourceType type, final String path) {
this(mod.getModID(), type, path);
}
public BinnieResource(final String modid, final ResourceType type, final String path) {
this.mod = modid;
this.type = type;
this.path = path;
}
public String getFullPath() {
return "/assets/" + this.mod + "/textures/" + this.type.toString() + "/" + this.path;
}
public ResourceLocation getResourceLocation() {
return new ResourceLocation(this.mod, "textures/" + this.type.toString() + "/" + this.path);
}
public String getShortPath() {
return "textures/" + this.type.toString() + "/" + this.path;
}
}
@@ -0,0 +1,10 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.core.resource;
public interface IBinnieTexture
{
BinnieResource getTexture();
}
@@ -0,0 +1,50 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.core.resource;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.renderer.texture.IIconRegister;
import binnie.core.AbstractMod;
import java.util.ArrayList;
import java.util.List;
public class ManagerResource
{
private List<BinnieIcon> icons;
public ManagerResource() {
this.icons = new ArrayList<BinnieIcon>();
}
public BinnieResource getPNG(final AbstractMod mod, final ResourceType type, final String path) {
return this.getFile(mod, type, path + ".png");
}
public BinnieResource getFile(final AbstractMod mod, final ResourceType type, final String path) {
return new BinnieResource(mod, type, path);
}
public void registerIcon(final BinnieIcon binnieIcon) {
this.icons.add(binnieIcon);
}
public BinnieIcon getItemIcon(final AbstractMod mod, final String iconFile) {
return new BinnieIcon(mod, ResourceType.Item, iconFile);
}
public BinnieIcon getBlockIcon(final AbstractMod mod, final String iconFile) {
return new BinnieIcon(mod, ResourceType.Block, iconFile);
}
@SideOnly(Side.CLIENT)
public void registerIcons(final IIconRegister register, final int type) {
for (final BinnieIcon icon : this.icons) {
if (icon.getTextureSheet() == type) {
icon.registerIcon(register);
}
}
}
}
@@ -0,0 +1,26 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.core.resource;
public enum ResourceType
{
Item("items"),
Block("blocks"),
Tile("tile"),
GUI("gui"),
FX("fx"),
Entity("entities");
String name;
private ResourceType(final String name) {
this.name = name;
}
@Override
public String toString() {
return this.name;
}
}