Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
/commit
/lib/*

# ForgeGradle
/.gradle
/build
Expand All @@ -18,4 +21,4 @@

# Mac Stuff
.DS_Store
*.command
*.command
99 changes: 49 additions & 50 deletions build.gradle
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,49 +1,65 @@
Properties ver = new Properties()
File versionFile = new File('version.txt')

// build is to distinguish bugfix releases, as the fourth number in the mod version. Resets when any of the others increase.
ver.build = 0

// revision is used by liteloader, and is required to increase (by an arbitrary amount) with each public release
ver.revision = 0

ver.load(versionFile.newDataInputStream())

buildscript {
repositories {
mavenCentral()
maven {
name = "forge"
url = "http://files.minecraftforge.net/maven"
name = 'forge'
url = 'http://files.minecraftforge.net/maven'
}
maven {
name = "sonatype"
url = "https://oss.sonatype.org/content/repositories/snapshots/"
name = 'sonatype'
url = 'https://oss.sonatype.org/content/repositories/snapshots/'
}
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT'
classpath 'net.minecraftforge.gradle:ForgeGradle:2.1-SNAPSHOT'
}
}

apply plugin: 'forge'
apply plugin: 'net.minecraftforge.gradle.forge'
// apply plugin: 'liteloader'
apply plugin: 'curseforge'

version = "1.6.9.0"
group = "uristqwerty" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = "CraftGuide"
version = '1.6.9.' + ver.build
group = 'uristqwerty' // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = 'CraftGuide'

ext.llrevision = "03"
ext.llrevision = '03'

minecraft {
version = "1.8-11.14.3.1449"
runDir = "run"
version = "1.8.9-11.15.1.1808"
mappings = "stable_20"
runDir = 'run'

replaceIn 'CraftGuide_FML.java'
replaceIn 'LiteMod_CraftGuide.java'
replace '@MOD_VERSION@', project.version
}

replaceIn "CraftGuide_FML.java"
replaceIn "LiteMod_CraftGuide.java"
replace "@MOD_VERSION@", project.version
configurations {
compile.extendsFrom exportedCompile
}

repositories {
maven {
name = "Player's Repo"
url = "http://maven.ic2.player.to/"
name = 'Player\'s Repo'
url = 'http://maven.ic2.player.to/'
}
}

dependencies {
compile 'com.mod-buildcraft:buildcraft:6.0.17:dev'
compile 'net.industrial-craft:industrialcraft-2:2.2.760-experimental:dev'
// compile 'com.mod-buildcraft:buildcraft:7.2.5:dev'
compile 'net.industrial-craft:industrialcraft-2:2.3.262-ex18:dev'
compile fileTree(dir: 'lib', include: '*.jar')
}

task themeZip(type: Zip) {
Expand All @@ -55,18 +71,19 @@ task themeZip(type: Zip) {
processResources
{
// this will ensure that this task is redone when the versions change.
inputs.property "version", project.version
inputs.property "mcversion", project.minecraft.version
inputs.property 'version', project.version
inputs.property 'mcversion', project.minecraft.version
inputs.property 'revision', ver.revision

// replace stuff in mcmod.info, nothing else
from(sourceSets.main.resources.srcDirs) {
include 'mcmod.info'
include 'litemod.json'

// replace version and mcversion
expand 'version':project.version, 'mcversion':project.minecraft.version, 'llrevision':project.llrevision
expand 'version':project.version, 'mcversion':project.minecraft.version, 'llrevision':project.llrevision, 'revision':ver.revision
}

// copy everything else, thats not the mcmod.info
from(sourceSets.main.resources.srcDirs) {
exclude 'mcmod.info'
Expand Down Expand Up @@ -106,32 +123,14 @@ task sourcesJar(type: Jar) {
classifier = 'sources'
}

curse {
projectId = '75557'
apiKey = project.curseForgeApiKey
releaseType = 'release'

addGameVersion '1.7.10'
additionalArtifact deobfJar, apiJar, sourcesJar

changelog '''\
API changes
- Added interface allowing item filters to be combined

Additions:
- If shift or control is held when clicking an item, instead of outright setting the current filter, will try adding to or removing from it. Shift adds, control removes.

Other changes:
- Updated tooltip EU display to work with more recent IC2 versions
- A few bugfixes
'''

}

curse.dependsOn build

artifacts {
archives deobfJar
archives apiJar
archives sourcesJar
}
}

build.doLast {
ver.build++
ver.revision++
ver.store(versionFile.newWriter(), null)
}
7 changes: 7 additions & 0 deletions disabled-features
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
buildcraft recipes (causing build errors. But I don't have BC installed on my server anyway, so didn't fix that)

IC2 exp recycler recipes (it only produces scrap... and cause gameplay errors)

some liquid icons? (class Fluid doesn't have a getStillIcon() method... causing build errors.
didn't know why and coudn't find a replacement so I just disabled it (by setting the icon directly to 'null'))
(but i didn't find what's influenced in the gameplay)
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Wed Jul 02 15:54:47 CDT 2014
#Tue Feb 16 20:36:24 CET 2016
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.0-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-2.11-all.zip
30 changes: 28 additions & 2 deletions src/main/java/uristqwerty/CraftGuide/api/ChanceSlot.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,38 @@ public List<String> getTooltip(int x, int y, Object[] data, int dataIndex)
}

List<String> tooltip = implementation.getTooltip(this, stack(data, dataIndex));
double probability = ((Integer)((Object[])data[dataIndex])[1]) * 100 / (double)ratio;
double val = unboxToDouble(((Object[])data[dataIndex])[1]) * 100 / ratio;

tooltip.set(0, tooltip.get(0) + String.format(formatString, probability));
tooltip.set(0, tooltip.get(0) + String.format(formatString, val));
return tooltip;
}

private static double unboxToDouble(Object obj)
{
if(obj instanceof Double)
return (Double)obj;

else if(obj instanceof Float)
return (Float)obj;

else if(obj instanceof Long)
return (Long)obj;

else if(obj instanceof Integer)
return (Integer)obj;

else if(obj instanceof Short)
return (Short)obj;

else if(obj instanceof Character)
return (Character)obj;

else if(obj instanceof Byte)
return (Byte)obj;

return (Double)obj; // As instanceof Double was already checked, this will throw with a meaningful error message.
}

@Override
public boolean matches(ItemFilter search, Object[] data, int dataIndex, SlotType type)
{
Expand Down
5 changes: 3 additions & 2 deletions src/main/java/uristqwerty/CraftGuide/api/LiquidFilter.java
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,9 @@ public void draw(Renderer renderer, int x, int y)
TextureManager textureManager = Minecraft.getMinecraft().getTextureManager();

Fluid fluid = liquid.getFluid();
TextureAtlasSprite icon = fluid.getStillIcon();

//TextureAtlasSprite icon = fluid.getStillIcon();
TextureAtlasSprite icon = null;

if(icon != null)
{
textureManager.bindTexture(TextureMap.locationBlocksTexture);
Expand Down
5 changes: 3 additions & 2 deletions src/main/java/uristqwerty/CraftGuide/api/LiquidSlot.java
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,9 @@ public void draw(Renderer renderer, int recipeX, int recipeY, Object[] data, int
TextureManager textureManager = Minecraft.getMinecraft().getTextureManager();

Fluid fluid = liquid.getFluid();
TextureAtlasSprite icon = fluid.getStillIcon();

//TextureAtlasSprite icon = fluid.getStillIcon();
TextureAtlasSprite icon = null;

if(icon != null)
{
textureManager.bindTexture(TextureMap.locationBlocksTexture);
Expand Down
10 changes: 6 additions & 4 deletions src/main/java/uristqwerty/CraftGuide/client/ui/GuiRenderer.java
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ public void setTextureID(int textureID)
{
if(textureID != -1)
{
GlStateManager.func_179144_i(textureID);
GlStateManager.bindTexture(textureID);
//GL11.glBindTexture(GL11.GL_TEXTURE_2D, textureID);
}
}

Expand Down Expand Up @@ -95,7 +96,8 @@ public void drawText(String text, int x, int y)
@Override
public void drawTextWithShadow(String text, int x, int y)
{
Minecraft.getMinecraft().fontRendererObj.func_175063_a(text, x, y, currentColor());
//Minecraft.getMinecraft().fontRendererObj.func_175063_a(text, x, y, currentColor());
Minecraft.getMinecraft().fontRendererObj.drawStringWithShadow(text, x, y, currentColor());
}

private int currentColor()
Expand Down Expand Up @@ -254,12 +256,12 @@ private ItemStack renderItem(ItemStack itemStack, boolean renderOverlay)
}

RenderItem itemRenderer = Minecraft.getMinecraft().getRenderItem();
itemRenderer.func_180450_b(itemStack, 0, 0);
itemRenderer.renderItemAndEffectIntoGUI(itemStack, 0, 0);

if(renderOverlay)
{
String count = null; // TODO: arbitrary-text-for-stacksize looks interesting. Expose?
itemRenderer.func_180453_a(Minecraft.getMinecraft().fontRendererObj, itemStack, 0, 0, count);
itemRenderer.renderItemOverlayIntoGUI(Minecraft.getMinecraft().fontRendererObj, itemStack, 0, 0, count);
}

return itemStack;
Expand Down
27 changes: 19 additions & 8 deletions src/main/java/uristqwerty/CraftGuide/itemtype/ItemType.java
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public int compareTo(ItemTypeKey other)
private static Map<ItemTypeKey, ItemType> simpleItemStacks = new HashMap<ItemTypeKey, ItemType>();
private static Map<ItemTypeKey, List<ItemType>> nbtItemStacks = new HashMap<ItemTypeKey, List<ItemType>>();
private static Map<String, ItemType> oreDictionaryEntries = new HashMap<String, ItemType>();
private static Map<ArrayList, ItemType> generalArrayLists = new IdentityHashMap<ArrayList, ItemType>();
private static Map<ArrayList<ItemStack>, ItemType> generalArrayLists = new IdentityHashMap<ArrayList<ItemStack>, ItemType>();

private final ItemTypeKey key;
private final Item item;
Expand Down Expand Up @@ -132,22 +132,32 @@ public static ItemType getInstance(Object stack)
{
return getInstance((ItemStack)stack);
}
else if(stack instanceof ArrayList && ((ArrayList)stack).size() > 0)
else if(stack instanceof ArrayList<?> && ((ArrayList<?>)stack).size() > 0)
{
return getInstance((ArrayList)stack);
for(Object o: (ArrayList<?>)stack)
{
if(o != null && !(o instanceof ItemStack))
return errType_unknownType;
}

return getInstance((ArrayList<ItemStack>)stack);
}
else
{
return errType_unknownType;
}
}

private static ItemType getInstance(ArrayList stack)
private static ItemType getInstance(ArrayList<ItemStack> stack)
{
ItemType type = generalArrayLists.get(stack);

if(type == null)
{
if(stack.get(0) == null)
{
return errType_unknownType;
}
type = new ItemType(stack);
generalArrayLists.put(stack, type);
}
Expand Down Expand Up @@ -195,12 +205,13 @@ private static ItemType getInstance(ItemStack stack)
return type;
}

private static ItemType findMatchingNBT(List<ItemType> items, NBTTagCompound nbt) {
private static ItemType findMatchingNBT(List<ItemType> items, NBTTagCompound nbt)
{
for(ItemType type: items)
{
ItemStack stack = (ItemStack)type.stack;

if(stack.getTagCompound().equals(nbt))
if(nbt.equals(stack.getTagCompound()))
{
return type;
}
Expand Down Expand Up @@ -353,11 +364,11 @@ public ItemStack getDisplayStack()
}
else if(stack instanceof ArrayList)
{
return (ItemStack)((ArrayList)stack).get(0);
return ((ArrayList<ItemStack>)stack).get(0);
}
else
{
return null;
}
}
}
}
Loading