Skip to content

Commit

Permalink
Java 1.6 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
impiaaa committed Oct 23, 2014
1 parent 170875a commit ecc5c7d
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
6 changes: 6 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ minecraft {
assetDir = "eclipse/assets"
}

tasks.withType(JavaCompile) {
sourceCompatibility = "1.6"
targetCompatibility = "1.6"
options.deprecation = true
}

//curse {
// apiKey = project.curseforge_key
// projectId = "72733"
Expand Down
7 changes: 3 additions & 4 deletions src/main/java/net/boatcake/MyWorldGen/MyWorldGen.java
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ public Item getTabIconItem() {
log.fatal("Could not load configuration");
e.printStackTrace();
return;
} catch (ReflectiveOperationException e) {
} catch (Exception e) {
log.fatal("Self-reflection failed. Is the mod intact?");
e.printStackTrace();
return;
Expand Down Expand Up @@ -196,7 +196,7 @@ public Item getTabIconItem() {
private Block registerBlock(String name, Class<? extends Block> blockClass,
Class<? extends ItemBlock> itemBlockClass,
Class<? extends BlockAnchorLogic> matching)
throws RuntimeException, ReflectiveOperationException {
throws Exception {
Block block = null;
if (enableItemsAndBlocks) {
block = blockClass.getConstructor(Material.class).newInstance(
Expand All @@ -218,8 +218,7 @@ private Block registerBlock(String name, Class<? extends Block> blockClass,
}

private Item registerItem(String name, Class<? extends Item> itemClass,
Configuration cfg) throws RuntimeException,
ReflectiveOperationException {
Configuration cfg) throws Exception {
Item item = null;
if (enableItemsAndBlocks) {
item = itemClass.getConstructor().newInstance();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ public void onResourceManagerReload(IResourceManager manager) {
continue;
}
}
} catch (ReflectiveOperationException e) {
} catch (Exception e) {
e.printStackTrace();
}
// P.S.
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/net/boatcake/MyWorldGen/items/ItemWandSave.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ public ItemWandSave() {
}

@Override
public boolean hasEffect(ItemStack stack) {
return stack.hasTagCompound();
public boolean hasEffect(ItemStack stack, int pass) {
return stack.hasTagCompound() && (pass == 0);
}

@Override
Expand Down

0 comments on commit ecc5c7d

Please sign in to comment.