-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated Tombstone XP drop and made big changes to Spike item
- Loading branch information
1 parent
f60d646
commit 4b433d7
Showing
37 changed files
with
545 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
src/main/java/com/stek101/projectzulu/common/UpdateEventHandler.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package com.stek101.projectzulu.common; | ||
|
||
import net.minecraft.util.ChatComponentText; | ||
import cpw.mods.fml.common.eventhandler.SubscribeEvent; | ||
import cpw.mods.fml.common.gameevent.PlayerEvent; | ||
|
||
public class UpdateEventHandler { | ||
|
||
@SubscribeEvent | ||
public void checkForUpdate(PlayerEvent.PlayerLoggedInEvent event) | ||
{ | ||
if(ProjectZulu_Core.modOutDated) | ||
{ | ||
event.player.addChatComponentMessage(new ChatComponentText("Attention : Your copy of the Project Zulu mod for MC 1.7.10 is Outdated. Please visit the Project Zulu for MC 1.7.10 thread in the Minecraft Forums to get the latest copy.")); | ||
//event.player.addChatComponentMessage(new ChatComponentText("Changelog: http://www.yahoo.com")); | ||
//event.player.addChatComponentMessage(new ChatComponentText(updates)); | ||
} | ||
} | ||
} |
98 changes: 98 additions & 0 deletions
98
src/main/java/com/stek101/projectzulu/common/UpdateMonitor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
package com.stek101.projectzulu.common; | ||
|
||
import java.io.BufferedReader; | ||
import java.io.IOException; | ||
import java.io.InputStream; | ||
import java.io.InputStreamReader; | ||
import java.net.HttpURLConnection; | ||
import java.net.URL; | ||
|
||
import com.stek101.projectzulu.common.core.DefaultProps; | ||
|
||
public class UpdateMonitor { | ||
|
||
|
||
public static void checkForUpdates() | ||
{ | ||
int currentVersion = DefaultProps.Version_Code; | ||
int nextVersion = getLatest(); | ||
if (currentVersion < nextVersion) | ||
{ | ||
//ProjectZulu_Core.Updates = getUpdate(nextVersion); | ||
ProjectZulu_Core.modOutDated = true; | ||
} | ||
else | ||
{ | ||
ProjectZulu_Core.modOutDated = false; | ||
} | ||
} | ||
|
||
public static int getLatest() | ||
{ | ||
try | ||
{ | ||
URL url = new URL("http://soultek101.weebly.com/uploads/4/1/2/0/41209035/versioncontrol.txt"); | ||
HttpURLConnection connection = (HttpURLConnection) url.openConnection(); | ||
connection.setRequestMethod("GET"); | ||
connection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded"); | ||
connection.setRequestProperty("Content-Language", "en-US"); | ||
connection.setRequestProperty("User-Agent", "Mozilla/5.0 (Windows NT 5.1) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.56 Safari/535.11"); | ||
connection.setUseCaches(false); | ||
connection.setDoInput(true); | ||
connection.setDoOutput(true); | ||
|
||
InputStream is = connection.getInputStream(); | ||
|
||
BufferedReader br = new BufferedReader(new InputStreamReader(is)); | ||
String line; | ||
StringBuffer response = new StringBuffer(); | ||
|
||
while ((line = br.readLine()) != null) | ||
{ | ||
response.append(line); | ||
} | ||
br.close(); | ||
return Integer.parseInt(response.toString()); | ||
} | ||
catch (IOException e) | ||
{ | ||
e.printStackTrace(); | ||
} | ||
return -1; | ||
} | ||
|
||
/* private static String getUpdate(int version) | ||
{ | ||
try | ||
{ | ||
URL url = new URL("http://soultek101.weebly.com/uploads/4/1/2/0/41209035/versioncontrol.txt"); | ||
HttpURLConnection connection = (HttpURLConnection) url.openConnection(); | ||
connection.setRequestMethod("POST"); | ||
connection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded"); | ||
connection.setRequestProperty("Content-Language", "en-US"); | ||
connection.setRequestProperty("User-Agent", "Mozilla/5.0 (Windows NT 5.1) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.56 Safari/535.11"); | ||
connection.setUseCaches(false); | ||
connection.setDoInput(true); | ||
connection.setDoOutput(true); | ||
InputStream is = connection.getInputStream(); | ||
BufferedReader br = new BufferedReader(new InputStreamReader(is)); | ||
String line; | ||
StringBuffer response = new StringBuffer(); | ||
while ((line = br.readLine()) != null) | ||
{ | ||
response.append(line); | ||
} | ||
br.close(); | ||
return response.toString(); | ||
} | ||
catch (IOException e) | ||
{ | ||
e.printStackTrace(); | ||
} | ||
return "Error"; | ||
} */ | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
66 changes: 66 additions & 0 deletions
66
src/main/java/com/stek101/projectzulu/common/blocks/ItemXPGem.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
package com.stek101.projectzulu.common.blocks; | ||
|
||
import net.minecraft.entity.player.EntityPlayer; | ||
import net.minecraft.item.Item; | ||
import net.minecraft.item.ItemStack; | ||
import net.minecraft.world.World; | ||
|
||
import com.stek101.projectzulu.common.ProjectZulu_Core; | ||
import com.stek101.projectzulu.common.core.DefaultProps; | ||
|
||
public class ItemXPGem extends Item { | ||
private int storedXP; | ||
private String playerName; | ||
|
||
public ItemXPGem(boolean full3D, String name, int xpAmount) { | ||
/*maxStackSize = 64; | ||
setMaxDamage(10); | ||
setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); | ||
bFull3D = full3D; | ||
setHasSubtypes(true); | ||
setUnlocalizedName(name); | ||
setTextureName(DefaultProps.blockKey + ":" + name); | ||
this.storedXP = xpAmount;*/ | ||
this(full3D, name, xpAmount, ""); | ||
} | ||
|
||
public ItemXPGem(boolean full3D, String name, int xpAmount, String playerName) { | ||
super(); | ||
maxStackSize = 1; | ||
setMaxDamage(10); | ||
setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); | ||
bFull3D = full3D; | ||
setHasSubtypes(true); | ||
setUnlocalizedName(name); | ||
setTextureName(DefaultProps.blockKey + ":" + name); | ||
this.storedXP = xpAmount; | ||
this.playerName = playerName; | ||
} | ||
|
||
public void setStoredXP(int xpAmount){ | ||
storedXP = xpAmount; | ||
} | ||
|
||
@Override | ||
public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer player) { | ||
if (this.playerName != "") { | ||
if (player.getDisplayName() == this.playerName) | ||
{ | ||
player.addExperience(this.storedXP); | ||
itemstack.damageItem(10, player); | ||
} | ||
else | ||
{ | ||
System.out.println("Your are not the owner of this XP Gem. BEGONE!!!!"); | ||
} | ||
} | ||
else{ | ||
itemstack.damageItem(10, player); | ||
} | ||
return itemstack; | ||
} | ||
|
||
|
||
|
||
|
||
} |
3 changes: 2 additions & 1 deletion
3
src/main/java/com/stek101/projectzulu/common/blocks/PZFuelHandler.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.