diff options
| author | bculkin2442 <bjculkin@mix.wvu.edu> | 2018-05-24 16:03:42 -0400 |
|---|---|---|
| committer | bculkin2442 <bjculkin@mix.wvu.edu> | 2018-05-24 16:03:42 -0400 |
| commit | 9a4d1e95ea7784f0f98ea2913701a3a3c28aefaa (patch) | |
| tree | b4307f58fe2197d2215707bb3f44cf8952229c6d | |
| parent | 4f7ad220df0438b6f3382110577b53f29da46453 (diff) | |
Formatting pass
176 files changed, 8963 insertions, 5366 deletions
diff --git a/src/main/java/com/pau101/util/BezierUtils.java b/src/main/java/com/pau101/util/BezierUtils.java index bdaca5c..27b82d5 100755 --- a/src/main/java/com/pau101/util/BezierUtils.java +++ b/src/main/java/com/pau101/util/BezierUtils.java @@ -11,11 +11,11 @@ public final class BezierUtils { * Compute the value of all nth degree Bernstein polynomials. * * @param curveDegree - * : degree of curve + * : degree of curve * @param t - * : curve parameter on interval [0,1] + * : curve parameter on interval [0,1] * @param scalars - * : curveDegree + 1 Bernstein values. + * : curveDegree + 1 Bernstein values. */ public static void allBernstein(int curveDegree, float t, float scalars[]) { @@ -38,13 +38,13 @@ public final class BezierUtils { * Compute point of nth degree Bezier curve. * * @param controlPoints - * : curveDegree + 1 control points + * : curveDegree + 1 control points * @param curveDegree - * : degree of curve + * : degree of curve * @param t - * : curve parameter on interval [0,1] + * : curve parameter on interval [0,1] * @param point - * : resulting point + * : resulting point */ public static void pointOnBezierCurve(float controlPoints[][], int curveDegree, float t, float point[]) { @@ -60,20 +60,24 @@ public final class BezierUtils { } /** - * Compute an approximate length of a Bezier curve given the control - * points. + * Compute an approximate length of a Bezier curve given the + * control points. * * @param controlPoints - * : control points of a Bezier curve + * : control points of a Bezier curve * @return the approximate length */ public static float approximateLength(float controlPoints[][]) { float length = 0; for (int i = 0; i < controlPoints.length - 1; i++) { - float xDif = controlPoints[i + 1][0] - controlPoints[i][0]; - float yDif = controlPoints[i + 1][1] - controlPoints[i][1]; - float zDif = controlPoints[i + 1][2] - controlPoints[i][2]; - length += Math.sqrt(xDif * xDif + yDif * yDif + zDif * zDif); + float xDif = controlPoints[i + 1][0] + - controlPoints[i][0]; + float yDif = controlPoints[i + 1][1] + - controlPoints[i][1]; + float zDif = controlPoints[i + 1][2] + - controlPoints[i][2]; + length += Math.sqrt(xDif * xDif + yDif * yDif + + zDif * zDif); } return length; } @@ -82,22 +86,24 @@ public final class BezierUtils { float scale) { float noLessThan = 10 * scale; float segs = length * scale / 30F; - return (int) Math.ceil( - Math.sqrt(segs * segs * 0.6 + noLessThan * noLessThan)); + return (int) Math.ceil(Math.sqrt(segs * segs * 0.6 + + noLessThan * noLessThan)); } public static float[][] curve(float controlPoints[][]) { return curve(controlPoints, 1); } - public static float[][] curve(float controlPoints[][], float scale) { + public static float[][] curve(float controlPoints[][], + float scale) { int count = tesselationSegementsForLength( approximateLength(controlPoints), scale); float[][] points = new float[count][3]; for (int i = 0; i < count; i++) { float t = i / (float) (count - 1); float[] point = new float[3]; - pointOnBezierCurve(controlPoints, controlPoints.length - 1, t, + pointOnBezierCurve(controlPoints, + controlPoints.length - 1, t, point); points[i] = point; } diff --git a/src/main/java/com/pau101/util/CubicBezier.java b/src/main/java/com/pau101/util/CubicBezier.java index 7071994..b681517 100755 --- a/src/main/java/com/pau101/util/CubicBezier.java +++ b/src/main/java/com/pau101/util/CubicBezier.java @@ -8,10 +8,18 @@ public class CubicBezier { public CubicBezier(float a1, float b1, float a2, float b2) { controlPoints = new float[4][]; - controlPoints[0] = new float[] { 0, 0 }; - controlPoints[1] = new float[] { a1, b1 }; - controlPoints[2] = new float[] { a2, b2 }; - controlPoints[3] = new float[] { 1, 1 }; + controlPoints[0] = new float[] { + 0, 0 + }; + controlPoints[1] = new float[] { + a1, b1 + }; + controlPoints[2] = new float[] { + a2, b2 + }; + controlPoints[3] = new float[] { + 1, 1 + }; } public float eval(float t) { diff --git a/src/main/java/darkknight/jewelrycraft/CreativeTabLiquids.java b/src/main/java/darkknight/jewelrycraft/CreativeTabLiquids.java index eadeb4a..e272b51 100755 --- a/src/main/java/darkknight/jewelrycraft/CreativeTabLiquids.java +++ b/src/main/java/darkknight/jewelrycraft/CreativeTabLiquids.java @@ -15,7 +15,7 @@ public class CreativeTabLiquids extends CreativeTabs { * Instantiates a new creative tab liquids.
*
* @param name
- * the name
+ * the name
*/
public CreativeTabLiquids(String name) {
super(name);
@@ -36,7 +36,7 @@ public class CreativeTabLiquids extends CreativeTabs { /**
* @param list
- * List of items to display
+ * List of items to display
*/
@Override
public void displayAllReleventItems(List list) {
diff --git a/src/main/java/darkknight/jewelrycraft/JewelrycraftMod.java b/src/main/java/darkknight/jewelrycraft/JewelrycraftMod.java index 574d163..182cbb6 100755 --- a/src/main/java/darkknight/jewelrycraft/JewelrycraftMod.java +++ b/src/main/java/darkknight/jewelrycraft/JewelrycraftMod.java @@ -45,9 +45,7 @@ import net.minecraft.item.crafting.FurnaceRecipes; import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.oredict.OreDictionary.OreRegisterEvent;
-@Mod(modid = Variables.MODID, name = Variables.MODNAME,
- version = Variables.VERSION, guiFactory = Variables.CONFIG_GUI,
- acceptedMinecraftVersions = "[1.7.10,1.8)")
+@Mod(modid = Variables.MODID, name = Variables.MODNAME, version = Variables.VERSION, guiFactory = Variables.CONFIG_GUI, acceptedMinecraftVersions = "[1.7.10,1.8)")
public class JewelrycraftMod {
private static final class CreativeTabJewleryCraft
extends CreativeTabs {
@@ -57,41 +55,42 @@ public class JewelrycraftMod { @Override
public Item getTabIconItem() {
- return Item.getItemFromBlock(BlockList.jewelCraftingTable);
+ return Item.getItemFromBlock(
+ BlockList.jewelCraftingTable);
}
}
@Instance(Variables.MODID)
- public static JewelrycraftMod instance;
+ public static JewelrycraftMod instance;
- @SidedProxy(clientSide = Variables.CLIENT_PROXY,
- serverSide = Variables.SERVER_PROXY)
- public static CommonProxy proxy;
+ @SidedProxy(clientSide = Variables.CLIENT_PROXY, serverSide = Variables.SERVER_PROXY)
+ public static CommonProxy proxy;
- public static Logger logger;
+ public static Logger logger;
- public static File dir;
+ public static File dir;
- public static CreativeTabs jewelrycraft =
- new CreativeTabJewleryCraft(Variables.MODID);
- public static CreativeTabs liquids =
- new CreativeTabLiquids("Liquids")
- .setBackgroundImageName("item_search.png");
+ public static CreativeTabs jewelrycraft = new CreativeTabJewleryCraft(
+ Variables.MODID);
+ public static CreativeTabs liquids = new CreativeTabLiquids(
+ "Liquids").setBackgroundImageName(
+ "item_search.png");
- public static SimpleNetworkWrapper netWrapper;
+ public static SimpleNetworkWrapper netWrapper;
- public static boolean fancyRender = false;
+ public static boolean fancyRender = false;
/**
* Pre initialization of mod stuff.
*
* @param e
- * FMLPreInitializationEvent
+ * FMLPreInitializationEvent
* @throws IOException
- * Signals that an I/O exception has occurred.
+ * Signals that an I/O exception has occurred.
*/
@EventHandler
- public void preInit(FMLPreInitializationEvent e) throws IOException {
+ public void preInit(FMLPreInitializationEvent e)
+ throws IOException {
dir = e.getModConfigurationDirectory();
logger = e.getModLog();
ConfigHandler.INSTANCE.loadConfig(e);
@@ -118,7 +117,7 @@ public class JewelrycraftMod { ThirdPartyManager.instance().preInit();
logger.log(Level.INFO, "Adding Dungeons loot");
ChestGeneration.preInit(e);
-
+
MinecraftForge.EVENT_BUS.register(this);
}
@@ -160,24 +159,27 @@ public class JewelrycraftMod { + imcMessage.getStringValue());
}
}
-
+
@SubscribeEvent
public void oredictRegistered(OreRegisterEvent orev) {
- if(orev.Name.startsWith("ingot") || orev.Name.startsWith("alloy")) {
- if(!JewelrycraftUtil.metal.contains(orev.Ore)) {
+ if (orev.Name.startsWith("ingot")
+ || orev.Name.startsWith("alloy")) {
+ if (!JewelrycraftUtil.metal.contains(orev.Ore)) {
JewelrycraftUtil.metal.add(orev.Ore);
}
}
-
- if(orev.Name.startsWith("ore")) {
- if(!JewelrycraftUtil.ores.contains(orev.Ore)) {
+
+ if (orev.Name.startsWith("ore")) {
+ if (!JewelrycraftUtil.ores.contains(orev.Ore)) {
JewelrycraftUtil.metal.add(orev.Ore);
}
-
- ItemStack ingot = FurnaceRecipes.smelting().getSmeltingResult(orev.Ore);
-
- if(ingot != null) {
- JewelrycraftUtil.oreToIngot.put(orev.Ore, ingot);
+
+ ItemStack ingot = FurnaceRecipes.smelting()
+ .getSmeltingResult(orev.Ore);
+
+ if (ingot != null) {
+ JewelrycraftUtil.oreToIngot.put(orev.Ore,
+ ingot);
}
}
}
diff --git a/src/main/java/darkknight/jewelrycraft/achievements/AchievementsList.java b/src/main/java/darkknight/jewelrycraft/achievements/AchievementsList.java index b62fe1d..6ef1f19 100755 --- a/src/main/java/darkknight/jewelrycraft/achievements/AchievementsList.java +++ b/src/main/java/darkknight/jewelrycraft/achievements/AchievementsList.java @@ -6,26 +6,27 @@ import net.minecraft.stats.Achievement; import net.minecraftforge.common.AchievementPage;
public class AchievementsList {
- public static AchievementPage jewelrycraft;
+ public static AchievementPage jewelrycraft;
// Achievements
- public static final Achievement openGuide =
- new Achievement("achievement.jewelrycraft.openGuide",
- "jewelrycraft.openGuide", 0, 0, ItemList.guide,
- (Achievement) null).initIndependentStat();
+ public static final Achievement openGuide = new Achievement(
+ "achievement.jewelrycraft.openGuide",
+ "jewelrycraft.openGuide", 0, 0, ItemList.guide,
+ (Achievement) null).initIndependentStat();
// Challenges
- public static final Achievement pentagram =
- new Achievement("achievement.jewelrycraft.pentagram",
- "jewelrycraft.pentagram", -3, -2, Items.ender_eye,
- (Achievement) null).initIndependentStat().setSpecial();
+ public static final Achievement pentagram = new Achievement(
+ "achievement.jewelrycraft.pentagram",
+ "jewelrycraft.pentagram", -3, -2, Items.ender_eye,
+ (Achievement) null).initIndependentStat()
+ .setSpecial();
public static void addAchievements() {
openGuide.registerStat();
pentagram.registerStat();
- jewelrycraft = new AchievementPage("Jewelrycraft 2", openGuide,
- pentagram);
+ jewelrycraft = new AchievementPage("Jewelrycraft 2",
+ openGuide, pentagram);
AchievementPage.registerAchievementPage(jewelrycraft);
}
diff --git a/src/main/java/darkknight/jewelrycraft/api/Curse.java b/src/main/java/darkknight/jewelrycraft/api/Curse.java index 1cd0288..c3af0f0 100755 --- a/src/main/java/darkknight/jewelrycraft/api/Curse.java +++ b/src/main/java/darkknight/jewelrycraft/api/Curse.java @@ -19,19 +19,19 @@ import net.minecraftforge.event.entity.player.PlayerSleepInBedEvent; import net.minecraftforge.event.world.BlockEvent;
public abstract class Curse {
- protected int textureID, ticksActive;
- protected String name, description, texturePackName;
- protected Random rand = new Random();
- private static ArrayList<Curse> curses = new ArrayList<>();
+ protected int textureID, ticksActive;
+ protected String name, description, texturePackName;
+ protected Random rand = new Random();
+ private static ArrayList<Curse> curses = new ArrayList<>();
public static ArrayList<Curse> availableCurses = new ArrayList<>();
/**
* @param name
- * The name of the curse
+ * The name of the curse
* @param txtID
- * The texture ID of it
+ * The texture ID of it
* @param texturepack
- * The texturepack location
+ * The texturepack location
*/
protected Curse(String name, int txtID, String texturepack) {
this.name = name;
@@ -60,7 +60,7 @@ public abstract class Curse { /**
* @param desc
- * description of the curse
+ * description of the curse
* @return The class
*/
public Curse setDescription(String desc) {
@@ -86,9 +86,9 @@ public abstract class Curse { * This runs every tick
*
* @param world
- * The worldthe player is in
+ * The worldthe player is in
* @param player
- * The cursed player
+ * The cursed player
*/
public void action(World world, EntityPlayer player) {
ticksActive++;
@@ -106,11 +106,11 @@ public abstract class Curse { * This runs when the player dies
*
* @param world
- * The world the player is in
+ * The world the player is in
* @param player
- * The cursed player
+ * The cursed player
* @param event
- * The thing that killed the player
+ * The thing that killed the player
*/
public void playerDeathAction(World world, EntityPlayer player,
LivingDeathEvent event) {
@@ -121,11 +121,11 @@ public abstract class Curse { * This runs when the player is healed
*
* @param world
- * The world the player is in
+ * The world the player is in
* @param player
- * The cursed player
+ * The cursed player
* @param event
- * The event that the player is healing from
+ * The event that the player is healing from
*/
public void playerHealAction(World world, EntityPlayer player,
LivingHealEvent event) {
@@ -137,11 +137,11 @@ public abstract class Curse { * causes)
*
* @param world
- * The world the player is in
+ * The world the player is in
* @param target
- * The entity that died
+ * The entity that died
* @param player
- * The cursed player
+ * The cursed player
*/
public void entityDeathAction(World world, EntityLivingBase target,
EntityPlayer player) {
@@ -152,25 +152,26 @@ public abstract class Curse { * This runs when the player respawns
*
* @param world
- * The world the player is in
+ * The world the player is in
* @param player
- * The cursed player
+ * The cursed player
*/
public void respawnAction(World world, EntityPlayer player) {
// Do nothing
}
/**
- * This runs when a player gets attacked by anything but another player
+ * This runs when a player gets attacked by anything but another
+ * player
*
* @param world
- * The world the player is in
+ * The world the player is in
* @param player
- * The cursed player
+ * The cursed player
* @param event
- * The event that attacked the player
+ * The event that attacked the player
* @param attacker
- * The entity that attacked the player
+ * The entity that attacked the player
*/
public void attackedAction(World world, EntityPlayer player,
LivingAttackEvent event, Entity attacker) {
@@ -184,11 +185,11 @@ public abstract class Curse { * @param event
*
* @param world
- * The world the player is in
+ * The world the player is in
* @param player
- * The player that caused the damage
+ * The player that caused the damage
* @param target
- * The entity damaged
+ * The entity damaged
*/
public void attackedByPlayerAction(LivingAttackEvent event,
World world, EntityPlayer player, Entity target) {
@@ -202,16 +203,16 @@ public abstract class Curse { * @param event
*
* @param world
- * The world the player is in
+ * The world the player is in
* @param player
- * The player that caused the damage
+ * The player that caused the damage
* @param target
- * The entity damaged
+ * The entity damaged
* @return Whether or not to cancel the event
*/
public boolean attackedByPlayerActionCancelable(
- LivingAttackEvent event, World world, EntityPlayer player,
- Entity target) {
+ LivingAttackEvent event, World world,
+ EntityPlayer player, Entity target) {
return false;
}
@@ -219,11 +220,11 @@ public abstract class Curse { * This runs when an item is dropped by an entity
*
* @param player
- * The cursed player
+ * The cursed player
* @param target
- * The entity that drops the item
+ * The entity that drops the item
* @param drops
- * An array list containing the dropped items
+ * An array list containing the dropped items
*/
public void entityDropItems(EntityPlayer player, Entity target,
ArrayList<EntityItem> drops) {
@@ -232,13 +233,13 @@ public abstract class Curse { /**
* This is for rendering special things on the player in 3rd person
- * (meaning you won't see this render); This will also render in the
- * inventory.
+ * (meaning you won't see this render); This will also render in
+ * the inventory.
*
* @param player
- * The cursed player
+ * The cursed player
* @param event
- * The event used for this
+ * The event used for this
*/
@SideOnly(Side.CLIENT)
public void playerRender(EntityPlayer player,
@@ -247,13 +248,13 @@ public abstract class Curse { }
/**
- * This is for rendering special things on the player in 1st and 3rd
- * person, but not in the player inventory.
+ * This is for rendering special things on the player in 1st and
+ * 3rd person, but not in the player inventory.
*
* @param player
- * The cursed player
+ * The cursed player
* @param event
- * The event used for this
+ * The event used for this
*/
@SideOnly(Side.CLIENT)
public void playerHandRender(EntityPlayer player,
@@ -262,14 +263,14 @@ public abstract class Curse { }
/**
- * This runs when a block drops an item (such as breaking a block and
- * dropping itself, or breaking like a Diamond ore and dropping
+ * This runs when a block drops an item (such as breaking a block
+ * and dropping itself, or breaking like a Diamond ore and dropping
* diamonds)
*
* @param player
- * The cursed player
+ * The cursed player
* @param event
- * The BlockEvent that triggers this
+ * The BlockEvent that triggers this
*/
public void onBlockItemsDrop(EntityPlayer player,
BlockEvent.HarvestDropsEvent event) {
@@ -280,9 +281,9 @@ public abstract class Curse { * This runs when a block is destroyed
*
* @param player
- * The cursed player
+ * The cursed player
* @param event
- * The BlockEvent that runs this
+ * The BlockEvent that runs this
*/
public void onBlockDestroyed(EntityPlayer player,
BlockEvent.BreakEvent event) {
@@ -300,11 +301,11 @@ public abstract class Curse { }
/**
- * This controls whether a curse can be activated or not (makes it easy
- * to do things like disable certain curses if in hardcore)
+ * This controls whether a curse can be activated or not (makes it
+ * easy to do things like disable certain curses if in hardcore)
*
* @param world
- * The world the player is in
+ * The world the player is in
* @return True for curses to be used; False otherwise (by default
* true)
*/
@@ -313,8 +314,8 @@ public abstract class Curse { }
/**
- * This controls whether a curse can be activated or not (makes it easy
- * to do things like disable certain curses if in hardcore)
+ * This controls whether a curse can be activated or not (makes it
+ * easy to do things like disable certain curses if in hardcore)
*
* @return True for curses to be used; False otherwise (by default
* true)
@@ -333,19 +334,20 @@ public abstract class Curse { }
/**
- * This is the weight of the curse when it chooses it. The lower the
- * value, the less it gets chosen; the higher the value, the higher the
- * chance of it getting picked.
+ * This is the weight of the curse when it chooses it. The lower
+ * the value, the less it gets chosen; the higher the value, the
+ * higher the chance of it getting picked.
*
* @param world
- * The world the player is currently in
+ * The world the player is currently in
* @param player
- * The cursed player
+ * The cursed player
* @param random
- * A random class
+ * A random class
* @return The weight of the curse (by default 10)
*/
- public int weight(World world, EntityPlayer player, Random random) {
+ public int weight(World world, EntityPlayer player,
+ Random random) {
return 10;
}
@@ -360,12 +362,15 @@ public abstract class Curse { /**
* This event is called whenever the player attempts to sleep.
*
- * @param worldObj the world
- * @param player the cursed player
- * @param event the sleeping event
+ * @param worldObj
+ * the world
+ * @param player
+ * the cursed player
+ * @param event
+ * the sleeping event
*/
public void playerSleepAction(World worldObj, EntityPlayer player,
PlayerSleepInBedEvent event) {
-
+
}
}
diff --git a/src/main/java/darkknight/jewelrycraft/api/IJewelryItem.java b/src/main/java/darkknight/jewelrycraft/api/IJewelryItem.java index c4a2c7a..ad15c7a 100755 --- a/src/main/java/darkknight/jewelrycraft/api/IJewelryItem.java +++ b/src/main/java/darkknight/jewelrycraft/api/IJewelryItem.java @@ -24,57 +24,59 @@ public interface IJewelryItem { * This is the action performed each player tick
*
* @param item
- * The item stack of the item (allows for fine item search,
- * like metadata and nbt)
+ * The item stack of the item (allows for fine item
+ * search, like metadata and nbt)
* @param player
- * The player wearing the jewelry
+ * The player wearing the jewelry
*/
public void onWearAction(ItemStack item, EntityPlayer player);
/**
- * This performs an action whenever a player gets attacked by an entity
- * besides another Player
+ * This performs an action whenever a player gets attacked by an
+ * entity besides another Player
*
* @param item
- * The item stack of the item (allows for fine item search,
- * like metadata and nbt)
+ * The item stack of the item (allows for fine item
+ * search, like metadata and nbt)
* @param player
- * The player that was attacked
+ * The player that was attacked
* @param source
- * Source of the damage
+ * Source of the damage
* @param amount
- * The amount of damage taken
+ * The amount of damage taken
*/
- public void onPlayerAttackedAction(ItemStack item, EntityPlayer player,
- DamageSource source, float amount);
+ public void onPlayerAttackedAction(ItemStack item,
+ EntityPlayer player, DamageSource source,
+ float amount);
/**
- * This does an action whenever an Entity gets attacked by a player,
- * this includes other Players
+ * This does an action whenever an Entity gets attacked by a
+ * player, this includes other Players
*
* @param item
- * The item stack of the item (allows for fine item search,
- * like metadata and nbt)
+ * The item stack of the item (allows for fine item
+ * search, like metadata and nbt)
* @param player
- * The attacking player
+ * The attacking player
* @param entity
- * The target entity
+ * The target entity
* @param amount
- * The amount of damage dealt
+ * The amount of damage dealt
*/
public void onEntityAttackedByPlayer(ItemStack item,
- EntityPlayer player, EntityLivingBase entity, float amount);
+ EntityPlayer player, EntityLivingBase entity,
+ float amount);
/**
* This runs whenever a player dies
*
* @param item
- * The item stack of the item (allows for fine item search,
- * like metadata and nbt)
+ * The item stack of the item (allows for fine item
+ * search, like metadata and nbt)
* @param player
- * The player that died
+ * The player that died
* @param source
- * The damage source that caused the death
+ * The damage source that caused the death
*/
public void onPlayerDeadAction(ItemStack item, EntityPlayer player,
DamageSource source);
@@ -84,11 +86,12 @@ public interface IJewelryItem { * respawns)
*
* @param item
- * The item stack of the item (allows for fine item search,
- * like metadata and nbt)
+ * The item stack of the item (allows for fine item
+ * search, like metadata and nbt)
* @param event
- * The clone event that runs whenever a player respawns,
- * either because he died or switched dimensions
+ * The clone event that runs whenever a player
+ * respawns, either because he died or switched
+ * dimensions
*/
public void onPlayerRespawnAction(ItemStack item,
PlayerEvent.Clone event);
@@ -97,8 +100,8 @@ public interface IJewelryItem { * This runs when the item is equipped
*
* @param item
- * The item stack of the item (allows for fine item search,
- * like metadata and nbt)
+ * The item stack of the item (allows for fine item
+ * search, like metadata and nbt)
*/
public void onJewelryEquipped(ItemStack item);
@@ -106,8 +109,8 @@ public interface IJewelryItem { * This runs when the item is unequipped
*
* @param item
- * The item stack of the item (allows for fine item search,
- * like metadata and nbt)
+ * The item stack of the item (allows for fine item
+ * search, like metadata and nbt)
*/
public void onJewelryUnequipped(ItemStack item);
}
diff --git a/src/main/java/darkknight/jewelrycraft/api/ModifierEffects.java b/src/main/java/darkknight/jewelrycraft/api/ModifierEffects.java index 05fee9d..389bafc 100755 --- a/src/main/java/darkknight/jewelrycraft/api/ModifierEffects.java +++ b/src/main/java/darkknight/jewelrycraft/api/ModifierEffects.java @@ -11,14 +11,13 @@ import net.minecraft.util.DamageSource; import net.minecraftforge.event.entity.player.PlayerEvent;
public class ModifierEffects {
- protected ItemStack modifier;
- protected Random rand = new Random();
- protected static ArrayList<ModifierEffects> effects =
- new ArrayList<>();
+ protected ItemStack modifier;
+ protected Random rand = new Random();
+ protected static ArrayList<ModifierEffects> effects = new ArrayList<>();
/**
* @param modifier
- * The item to use as modifier
+ * The item to use as modifier
*/
public ModifierEffects(ItemStack modifier) {
this.modifier = modifier;
@@ -43,35 +42,38 @@ public class ModifierEffects { * This runs every tick
*
* @param item
- * The ItemStack representing the jewelry that runs the
- * effect
+ * The ItemStack representing the jewelry that runs
+ * the effect
* @param player
- * The player wearing the jewelry wearing a jewelry with
- * this modifier on it
+ * The player wearing the jewelry wearing a jewelry
+ * with this modifier on it
* @param jewelry
- * The actual jewelry item (used by me to determine the type
- * of jewelry so I don't have to call item.getItem() blah
- * blah blah)
+ * The actual jewelry item (used by me to determine
+ * the type of jewelry so I don't have to call
+ * item.getItem() blah blah blah)
*/
- public void action(ItemStack item, EntityPlayer player, Item jewelry) {
+ public void action(ItemStack item, EntityPlayer player,
+ Item jewelry) {
// Do nothing
};
/**
- * This runs when an entity is attacked. This event can be canceled.
+ * This runs when an entity is attacked. This event can be
+ * canceled.
*
* @param item
- * The ItemStack representing the jewelry that runs the
- * effect
+ * The ItemStack representing the jewelry that runs
+ * the effect
* @param player
- * The player wearing the jewelry wearing a jewelry with
- * this modifier on it
+ * The player wearing the jewelry wearing a jewelry
+ * with this modifier on it
* @param target
- * The attacked entity
+ * The attacked entity
* @param jewelry
- * The actual jewelry item (aka item.getItem(), almost)
+ * The actual jewelry item (aka item.getItem(),
+ * almost)
* @param amount
- * The amount of damage the entity took
+ * The amount of damage the entity took
* @return The state of the event (true to cancel it, false to not)
*/
public boolean onEntityAttackedCancellable(ItemStack item,
@@ -81,45 +83,48 @@ public class ModifierEffects { }
/**
- * This runs when a player gets damaged. This event can be canceled.
+ * This runs when a player gets damaged. This event can be
+ * canceled.
*
* @param item
- * The ItemStack representing the jewelry that runs the
- * effect
+ * The ItemStack representing the jewelry that runs
+ * the effect
* @param player
- * The attacked player wearing a jewelry with this modifier
- * on it
+ * The attacked player wearing a jewelry with this
+ * modifier on it
* @param source
- * The source of the damage
+ * The source of the damage
* @param jewelry
- * The actual jewelry item (aka item.getItem(), almost)
+ * The actual jewelry item (aka item.getItem(),
+ * almost)
* @param amount
- * The amount of damage the player took
+ * The amount of damage the player took
* @return The state of the event (true to cancel it, false to not)
*/
public boolean onPlayerAttackedCancellable(ItemStack item,
- EntityPlayer player, DamageSource source, Item jewelry,
- float amount) {
+ EntityPlayer player, DamageSource source,
+ Item jewelry, float amount) {
return false;
}
/**
- * This is the same as onEntityAttackedCacellable, but this can not be
- * canceled. I recommend using this over onEntityAttackedCacellable, as
- * it is more reliable.
+ * This is the same as onEntityAttackedCacellable, but this can not
+ * be canceled. I recommend using this over
+ * onEntityAttackedCacellable, as it is more reliable.
*
* @param item
- * The ItemStack representing the jewelry that runs the
- * effect
+ * The ItemStack representing the jewelry that runs
+ * the effect
* @param player
- * The player wearing the jewelry wearing a jewelry with
- * this modifier on it
+ * The player wearing the jewelry wearing a jewelry
+ * with this modifier on it
* @param target
- * The attacked entity
+ * The attacked entity
* @param jewelry
- * The actual jewelry item (aka item.getItem(), almost)
+ * The actual jewelry item (aka item.getItem(),
+ * almost)
* @param amount
- * The amount of damage the entity took
+ * The amount of damage the entity took
*/
public void onEntityAttacked(ItemStack item, EntityPlayer player,
Entity target, Item jewelry, float amount) {
@@ -127,22 +132,23 @@ public class ModifierEffects { }
/**
- * This is just like onPlayerAttackedCacellable, only that this can not
- * be canceled. I recommend using this over onPlayerAttackedCacellable,
- * as it is more reliable.
+ * This is just like onPlayerAttackedCacellable, only that this can
+ * not be canceled. I recommend using this over
+ * onPlayerAttackedCacellable, as it is more reliable.
*
* @param item
- * The ItemStack representing the jewelry that runs the
- * effect
+ * The ItemStack representing the jewelry that runs
+ * the effect
* @param player
- * The attacked player wearing a jewelry with this modifier
- * on it
+ * The attacked player wearing a jewelry with this
+ * modifier on it
* @param source
- * The source of the damage
+ * The source of the damage
* @param jewelry
- * The actual jewelry item (aka item.getItem(), almost)
+ * The actual jewelry item (aka item.getItem(),
+ * almost)
* @param amount
- * The amount of damage the player took
+ * The amount of damage the player took
*/
public void onPlayerAttacked(ItemStack item, EntityPlayer player,
DamageSource source, Item jewelry, float amount) {
@@ -153,15 +159,16 @@ public class ModifierEffects { * This runs when the player dies
*
* @param item
- * The ItemStack representing the jewelry that runs the
- * effect
+ * The ItemStack representing the jewelry that runs
+ * the effect
* @param player
- * The player that died wearing a jewelry with this modifier
- * on it
+ * The player that died wearing a jewelry with this
+ * modifier on it
* @param source
- * The source of the killing blow
+ * The source of the killing blow
* @param jewelry
- * The actual jewelry item (aka item.getItem(), almost)
+ * The actual jewelry item (aka item.getItem(),
+ * almost)
*/
public void onPlayerDead(ItemStack item, EntityPlayer player,
DamageSource source, Item jewelry) {
@@ -172,16 +179,18 @@ public class ModifierEffects { * This runs when the player respawns
*
* @param item
- * The ItemStack representing the jewelry that runs the
- * effect
+ * The ItemStack representing the jewelry that runs
+ * the effect
* @param event
- * The PlayerEvent that runs when the player respawns (this
- * is also called when a player moves between dimensions)
+ * The PlayerEvent that runs when the player
+ * respawns (this is also called when a player moves
+ * between dimensions)
* @param jewelry
- * The actual jewelry item (aka item.getItem(), almost)
+ * The actual jewelry item (aka item.getItem(),
+ * almost)
*/
- public void onPlayerRespawn(ItemStack item, PlayerEvent.Clone event,
- Item jewelry) {
+ public void onPlayerRespawn(ItemStack item,
+ PlayerEvent.Clone event, Item jewelry) {
// Do nothing
}
@@ -189,10 +198,11 @@ public class ModifierEffects { * This runs when the item containing this modifier is equipped
*
* @param item
- * The ItemStack representing the jewelry that runs the
- * effect
+ * The ItemStack representing the jewelry that runs
+ * the effect
* @param jewelry
- * The actual jewelry item (aka item.getItem(), almost)
+ * The actual jewelry item (aka item.getItem(),
+ * almost)
*/
public void onJewelryEquipped(ItemStack item, Item jewelry) {
// Do nothing
@@ -202,10 +212,11 @@ public class ModifierEffects { * This runs when the item containing this modifier is unquipped
*
* @param item
- * The ItemStack representing the jewelry that runs the
- * effect
+ * The ItemStack representing the jewelry that runs
+ * the effect
* @param jewelry
- * The actual jewelry item (aka item.getItem(), almost)
+ * The actual jewelry item (aka item.getItem(),
+ * almost)
*/
public void onJewelryUnequipped(ItemStack item, Item jewelry) {
// Do nothing
diff --git a/src/main/java/darkknight/jewelrycraft/block/BlockCrystal.java b/src/main/java/darkknight/jewelrycraft/block/BlockCrystal.java index 3ecbcd6..98416c2 100755 --- a/src/main/java/darkknight/jewelrycraft/block/BlockCrystal.java +++ b/src/main/java/darkknight/jewelrycraft/block/BlockCrystal.java @@ -26,9 +26,12 @@ import net.minecraft.world.World; *
*/
public class BlockCrystal extends Block implements ITileEntityProvider {
- public static int[] colors = { 1973019, 11743532, 3887386, 5320730,
- 2437522, 8073150, 2651799, 11250603, 4408131, 14188952,
- 4312372, 14602026, 6719955, 12801229, 15435844, 15790320 };
+ public static int[] colors = {
+ 1973019, 11743532, 3887386, 5320730, 2437522,
+ 8073150, 2651799, 11250603, 4408131, 14188952,
+ 4312372, 14602026, 6719955, 12801229, 15435844,
+ 15790320
+ };
protected BlockCrystal() {
super(Material.glass);
@@ -72,7 +75,8 @@ public class BlockCrystal extends Block implements ITileEntityProvider { @Override
@SideOnly(Side.CLIENT)
- public int colorMultiplier(IBlockAccess world, int i, int j, int k) {
+ public int colorMultiplier(IBlockAccess world, int i, int j,
+ int k) {
return colors[world.getBlockMetadata(i, j, k)];
}
@@ -82,19 +86,21 @@ public class BlockCrystal extends Block implements ITileEntityProvider { }
@Override
- public void breakBlock(World world, int x, int y, int z, Block block,
- int meta) {
+ public void breakBlock(World world, int x, int y, int z,
+ Block block, int meta) {
super.breakBlock(world, x, y, z, block, meta);
world.removeTileEntity(x, y, z);
}
@Override
- public boolean onBlockEventReceived(World world, int x, int y, int z,
- int eventNo, int arg) {
+ public boolean onBlockEventReceived(World world, int x, int y,
+ int z, int eventNo, int arg) {
super.onBlockEventReceived(world, x, y, z, eventNo, arg);
TileEntity tileentity = world.getTileEntity(x, y, z);
return tileentity != null
- ? tileentity.receiveClientEvent(eventNo, arg) : false;
+ ? tileentity.receiveClientEvent(eventNo,
+ arg)
+ : false;
}
@Override
@@ -102,8 +108,10 @@ public class BlockCrystal extends Block implements ITileEntityProvider { public void randomDisplayTick(World world, int x, int y, int z,
Random rand) {
if (ConfigHandler.CRYSTAL_PARTICLES)
- world.spawnParticle("instantSpell", x + rand.nextFloat(),
- y + rand.nextFloat(), z + rand.nextFloat(), 0.0D,
- -1.0D, 0.0D);
+ world.spawnParticle("instantSpell",
+ x + rand.nextFloat(),
+ y + rand.nextFloat(),
+ z + rand.nextFloat(), 0.0D, -1.0D,
+ 0.0D);
}
}
diff --git a/src/main/java/darkknight/jewelrycraft/block/BlockDisplayer.java b/src/main/java/darkknight/jewelrycraft/block/BlockDisplayer.java index eff1f6d..d84cbf7 100755 --- a/src/main/java/darkknight/jewelrycraft/block/BlockDisplayer.java +++ b/src/main/java/darkknight/jewelrycraft/block/BlockDisplayer.java @@ -54,8 +54,8 @@ public class BlockDisplayer extends BlockContainer { * @return whether to render the specified side
*/
@Override
- public boolean shouldSideBeRendered(IBlockAccess iblockaccess, int i,
- int j, int k, int l) {
+ public boolean shouldSideBeRendered(IBlockAccess iblockaccess,
+ int i, int j, int k, int l) {
return false;
}
@@ -89,14 +89,14 @@ public class BlockDisplayer extends BlockContainer { */
@Override
public boolean onBlockActivated(World world, int i, int j, int k,
- EntityPlayer entityPlayer, int par6, float par7, float par8,
- float par9) {
- TileEntityDisplayer te =
- (TileEntityDisplayer) world.getTileEntity(i, j, k);
+ EntityPlayer entityPlayer, int par6, float par7,
+ float par8, float par9) {
+ TileEntityDisplayer te = (TileEntityDisplayer) world
+ .getTileEntity(i, j, k);
ItemStack item = entityPlayer.inventory.getCurrentItem();
if (te != null) {
- if (item != null
- && item != new ItemStack(Item.getItemById(0), 0, 0)
+ if (item != null && item != new ItemStack(
+ Item.getItemById(0), 0, 0)
&& !world.isRemote) {
if (!te.hasObject) {
te.object = item.copy();
@@ -104,68 +104,82 @@ public class BlockDisplayer extends BlockContainer { te.object.stackSize = 1;
te.hasObject = true;
if (!entityPlayer.capabilities.isCreativeMode)
- entityPlayer.inventory.decrStackSize(
- entityPlayer.inventory.currentItem,
- item.stackSize);
+ entityPlayer.inventory
+ .decrStackSize(entityPlayer.inventory.currentItem,
+ item.stackSize);
te.isDirty = true;
- } else if (te.object.getItem() == item.getItem()
+ } else if (te.object.getItem() == item
+ .getItem()
&& te.object != null
- && te.object != new ItemStack(Item.getItemById(0),
+ && te.object != new ItemStack(
+ Item.getItemById(
+ 0),
0, 0)
&& te.object.getItemDamage() == item
.getItemDamage())
- if (te.object.hasTagCompound() && item.hasTagCompound()
+ if (te.object.hasTagCompound()
+ && item.hasTagCompound()
&& te.object.getTagCompound()
.equals(item.getTagCompound())) {
te.quantity += item.stackSize;
if (!entityPlayer.capabilities.isCreativeMode)
- entityPlayer.inventory.decrStackSize(
- entityPlayer.inventory.currentItem,
- item.stackSize);
+ entityPlayer.inventory
+ .decrStackSize(entityPlayer.inventory.currentItem,
+ item.stackSize);
te.isDirty = true;
- } else if (!te.object.hasTagCompound()
+ } else if (!te.object
+ .hasTagCompound()
&& !item.hasTagCompound()) {
te.quantity += item.stackSize;
if (!entityPlayer.capabilities.isCreativeMode)
- entityPlayer.inventory.decrStackSize(
- entityPlayer.inventory.currentItem,
- item.stackSize);
+ entityPlayer.inventory
+ .decrStackSize(entityPlayer.inventory.currentItem,
+ item.stackSize);
te.isDirty = true;
}
- } else if (item == null
- || item == new ItemStack(Item.getItemById(0), 0, 0))
+ } else if (item == null || item == new ItemStack(
+ Item.getItemById(0), 0, 0))
if (!entityPlayer.capabilities.isCreativeMode)
for (int inv = 0; inv < entityPlayer.inventory
.getSizeInventory(); inv++) {
- item = entityPlayer.inventory.getStackInSlot(inv);
- if (item != null
- && te.object.getItem() == item.getItem()
+ item = entityPlayer.inventory
+ .getStackInSlot(inv);
+ if (item != null && te.object
+ .getItem() == item
+ .getItem()
&& te.object != null
&& te.object != new ItemStack(
- Item.getItemById(0), 0, 0)
+ Item.getItemById(
+ 0),
+ 0,
+ 0)
&& te.object.getItemDamage() == item
.getItemDamage())
if (te.object.hasTagCompound()
&& item.hasTagCompound()
- && te.object.getTagCompound().equals(
- item.getTagCompound())) {
+ && te.object.getTagCompound()
+ .equals(item.getTagCompound())) {
te.quantity += item.stackSize;
if (!entityPlayer.capabilities.isCreativeMode)
- entityPlayer.inventory.decrStackSize(
- inv, item.stackSize);
+ entityPlayer.inventory
+ .decrStackSize(inv,
+ item.stackSize);
te.isDirty = true;
te.markDirty();
- } else if (!te.object.hasTagCompound()
+ } else if (!te.object
+ .hasTagCompound()
&& !item.hasTagCompound()) {
te.quantity += item.stackSize;
if (!entityPlayer.capabilities.isCreativeMode)
- entityPlayer.inventory.decrStackSize(
- inv, item.stackSize);
+ entityPlayer.inventory
+ .decrStackSize(inv,
+ item.stackSize);
te.isDirty = true;
}
}
else if (entityPlayer.capabilities.isCreativeMode
- && te.hasObject && te.object.getItem() != null) {
+ && te.hasObject
+ && te.object.getItem() != null) {
te.quantity += 64;
te.isDirty = true;
}
@@ -184,47 +198,59 @@ public class BlockDisplayer extends BlockContainer { @Override
public void onBlockClicked(World world, int i, int j, int k,
EntityPlayer player) {
- TileEntityDisplayer te =
- (TileEntityDisplayer) world.getTileEntity(i, j, k);
+ TileEntityDisplayer te = (TileEntityDisplayer) world
+ .getTileEntity(i, j, k);
if (te != null && !world.isRemote)
if (te.hasObject && te.object != null
- && te.object != new ItemStack(Item.getItemById(0), 0,
- 0)
- && player.inventory.addItemStackToInventory(te.object))
+ && te.object != new ItemStack(
+ Item.getItemById(
+ 0),
+ 0, 0)
+ && player.inventory
+ .addItemStackToInventory(
+ te.object))
if (!player.isSneaking()) {
- if (te.quantity > te.object.getMaxStackSize()) {
- te.object.stackSize =
- te.object.getMaxStackSize() - 1;
- player.inventory
- .addItemStackToInventory(te.object);
+ if (te.quantity > te.object
+ .getMaxStackSize()) {
+ te.object.stackSize = te.object
+ .getMaxStackSize()
+ - 1;
+ player.inventory.addItemStackToInventory(
+ te.object);
te.object.stackSize = 1;
- te.quantity -= te.object.getMaxStackSize();
+ te.quantity -= te.object
+ .getMaxStackSize();
te.isDirty = true;
} else {
- te.object.stackSize = te.quantity - 1;
- player.inventory
- .addItemStackToInventory(te.object);
+ te.object.stackSize = te.quantity
+ - 1;
+ player.inventory.addItemStackToInventory(
+ te.object);
te.hasObject = false;
- te.object =
- new ItemStack(Item.getItemById(0), 0, 0);
+ te.object = new ItemStack(
+ Item.getItemById(
+ 0),
+ 0, 0);
te.quantity = 0;
te.isDirty = true;
}
te.isDirty = true;
} else {
if (te.quantity >= 2) {
- player.inventory
- .addItemStackToInventory(te.object);
+ player.inventory.addItemStackToInventory(
+ te.object);
te.object.stackSize = 1;
te.quantity--;
te.isDirty = true;
} else {
- player.inventory
- .addItemStackToInventory(te.object);
+ player.inventory.addItemStackToInventory(
+ te.object);
te.object.stackSize = 1;
te.hasObject = false;
- te.object =
- new ItemStack(Item.getItemById(0), 0, 0);
+ te.object = new ItemStack(
+ Item.getItemById(
+ 0),
+ 0, 0);
te.quantity = 0;
te.isDirty = true;
}
@@ -241,8 +267,8 @@ public class BlockDisplayer extends BlockContainer { */
public void dropItem(World world, double x, double y, double z,
ItemStack stack) {
- EntityItem entityitem =
- new EntityItem(world, x + 0.5D, y + 1.5D, z + 0.5D, stack);
+ EntityItem entityitem = new EntityItem(world, x + 0.5D,
+ y + 1.5D, z + 0.5D, stack);
entityitem.motionX = 0;
entityitem.motionZ = 0;
entityitem.motionY = 0.11000000298023224D;
@@ -258,14 +284,14 @@ public class BlockDisplayer extends BlockContainer { * @param par6
*/
@Override
- public void breakBlock(World world, int i, int j, int k, Block block,
- int par6) {
- TileEntityDisplayer te =
- (TileEntityDisplayer) world.getTileEntity(i, j, k);
+ public void breakBlock(World world, int i, int j, int k,
+ Block block, int par6) {
+ TileEntityDisplayer te = (TileEntityDisplayer) world
+ .getTileEntity(i, j, k);
if (te != null && te.hasObject) {
te.object.stackSize = te.quantity;
- dropItem(te.getWorldObj(), te.xCoord, te.yCoord, te.zCoord,
- te.object);
+ dropItem(te.getWorldObj(), te.xCoord, te.yCoord,
+ te.zCoord, te.object);
world.removeTileEntity(i, j, k);
}
super.breakBlock(world, i, j, k, block, par6);
@@ -281,9 +307,12 @@ public class BlockDisplayer extends BlockContainer { */
@Override
public void onBlockPlacedBy(World world, int i, int j, int k,
- EntityLivingBase entityLiving, ItemStack par6ItemStack) {
- int rotation = MathHelper.floor_double(
- entityLiving.rotationYaw * 4.0F / 360.0F + 0.5D) & 3;
+ EntityLivingBase entityLiving,
+ ItemStack par6ItemStack) {
+ int rotation = MathHelper
+ .floor_double(entityLiving.rotationYaw
+ * 4.0F / 360.0F + 0.5D)
+ & 3;
world.setBlockMetadataWithNotify(i, j, k, rotation, 2);
}
diff --git a/src/main/java/darkknight/jewelrycraft/block/BlockHandPedestal.java b/src/main/java/darkknight/jewelrycraft/block/BlockHandPedestal.java index e4b8efc..2cfe437 100755 --- a/src/main/java/darkknight/jewelrycraft/block/BlockHandPedestal.java +++ b/src/main/java/darkknight/jewelrycraft/block/BlockHandPedestal.java @@ -51,8 +51,8 @@ public class BlockHandPedestal extends BlockContainer { * @return
*/
@Override
- public boolean shouldSideBeRendered(IBlockAccess iblockaccess, int i,
- int j, int k, int l) {
+ public boolean shouldSideBeRendered(IBlockAccess iblockaccess,
+ int i, int j, int k, int l) {
return false;
}
@@ -86,13 +86,14 @@ public class BlockHandPedestal extends BlockContainer { */
@Override
public boolean onBlockActivated(World world, int i, int j, int k,
- EntityPlayer entityPlayer, int par6, float par7, float par8,
- float par9) {
- TileEntityHandPedestal te =
- (TileEntityHandPedestal) world.getTileEntity(i, j, k);
+ EntityPlayer entityPlayer, int par6, float par7,
+ float par8, float par9) {
+ TileEntityHandPedestal te = (TileEntityHandPedestal) world
+ .getTileEntity(i, j, k);
ItemStack item = entityPlayer.inventory.getCurrentItem();
if (te != null) {
- if (!world.isRemote && te.getHeldItemStack() == null
+ if (!world.isRemote
+ && te.getHeldItemStack() == null
&& item != null) {
te.setHeldItemStack(item.copy());
if (!entityPlayer.capabilities.isCreativeMode)
@@ -100,7 +101,8 @@ public class BlockHandPedestal extends BlockContainer { te.markDirty();
} else if (entityPlayer.isSneaking())
if (entityPlayer.inventory
- .addItemStackToInventory(te.getHeldItemStack())) {
+ .addItemStackToInventory(te
+ .getHeldItemStack())) {
te.removeHeldItemStack();
}
te.markDirty();
@@ -117,8 +119,8 @@ public class BlockHandPedestal extends BlockContainer { */
public void dropItem(World world, double x, double y, double z,
ItemStack stack) {
- EntityItem entityitem =
- new EntityItem(world, x + 0.5, y + 1.5, z + 0.5, stack);
+ EntityItem entityitem = new EntityItem(world, x + 0.5,
+ y + 1.5, z + 0.5, stack);
entityitem.motionX = 0;
entityitem.motionZ = 0;
entityitem.motionY = 0.11000000298023224D;
@@ -134,13 +136,13 @@ public class BlockHandPedestal extends BlockContainer { * @param par6
*/
@Override
- public void breakBlock(World world, int i, int j, int k, Block block,
- int par6) {
- TileEntityHandPedestal te =
- (TileEntityHandPedestal) world.getTileEntity(i, j, k);
+ public void breakBlock(World world, int i, int j, int k,
+ Block block, int par6) {
+ TileEntityHandPedestal te = (TileEntityHandPedestal) world
+ .getTileEntity(i, j, k);
if (te != null && te.getHeldItemStack() != null) {
- dropItem(te.getWorldObj(), te.xCoord, te.yCoord, te.zCoord,
- te.getHeldItemStack());
+ dropItem(te.getWorldObj(), te.xCoord, te.yCoord,
+ te.zCoord, te.getHeldItemStack());
world.removeTileEntity(i, j, k);
}
super.breakBlock(world, i, j, k, block, par6);
@@ -156,9 +158,11 @@ public class BlockHandPedestal extends BlockContainer { */
@Override
public void onBlockPlacedBy(World world, int i, int j, int k,
- EntityLivingBase entityLiving, ItemStack par6ItemStack) {
+ EntityLivingBase entityLiving,
+ ItemStack par6ItemStack) {
int rotation = MathHelper.floor_double(
- entityLiving.rotationYaw * 8 / 360 + 0.5) & 7;
+ entityLiving.rotationYaw * 8 / 360 + 0.5)
+ & 7;
world.setBlockMetadataWithNotify(i, j, k, rotation, 2);
}
diff --git a/src/main/java/darkknight/jewelrycraft/block/BlockItemCrystal.java b/src/main/java/darkknight/jewelrycraft/block/BlockItemCrystal.java index 6a82701..2b76784 100755 --- a/src/main/java/darkknight/jewelrycraft/block/BlockItemCrystal.java +++ b/src/main/java/darkknight/jewelrycraft/block/BlockItemCrystal.java @@ -19,14 +19,17 @@ public class BlockItemCrystal extends ItemBlock { @Override
public String getUnlocalizedName(ItemStack itemstack) {
- return getUnlocalizedName() + "." + itemstack.getItemDamage();
+ return getUnlocalizedName() + "."
+ + itemstack.getItemDamage();
}
@Override
@SideOnly(Side.CLIENT)
public int getColorFromItemStack(ItemStack stack, int pass) {
return stack.getItemDamage() < 16
- ? BlockCrystal.colors[stack.getItemDamage()] : 0;
+ ? BlockCrystal.colors[stack
+ .getItemDamage()]
+ : 0;
}
}
\ No newline at end of file diff --git a/src/main/java/darkknight/jewelrycraft/block/BlockJewelersCraftingTable.java b/src/main/java/darkknight/jewelrycraft/block/BlockJewelersCraftingTable.java index e8a1431..2bd78ac 100755 --- a/src/main/java/darkknight/jewelrycraft/block/BlockJewelersCraftingTable.java +++ b/src/main/java/darkknight/jewelrycraft/block/BlockJewelersCraftingTable.java @@ -41,19 +41,21 @@ public class BlockJewelersCraftingTable extends BlockContainer { @Override
public boolean onBlockActivated(World world, int i, int j, int k,
- EntityPlayer entityPlayer, int par6, float par7, float par8,
- float par9) {
- TileEntityJewelrsCraftingTable te =
- (TileEntityJewelrsCraftingTable) world.getTileEntity(i, j,
- k);
+ EntityPlayer entityPlayer, int par6, float par7,
+ float par8, float par9) {
+ TileEntityJewelrsCraftingTable te = (TileEntityJewelrsCraftingTable) world
+ .getTileEntity(i, j, k);
ItemStack item = entityPlayer.inventory.getCurrentItem();
if (te != null && !world.isRemote) {
if (te.hasEndItem && item != null)
- entityPlayer.addChatMessage(new ChatComponentText(
- StatCollector.translateToLocal("chatmessage."
- + Variables.MODID + ".table.hasenditem")));
- if (!te.hasEndItem && !te.hasJewelry && item != null
- && JewelrycraftUtil.isJewelry(item)) {
+ entityPlayer.addChatMessage(
+ new ChatComponentText(
+ StatCollector.translateToLocal(
+ "chatmessage." + Variables.MODID
+ + ".table.hasenditem")));
+ if (!te.hasEndItem && !te.hasJewelry
+ && item != null && JewelrycraftUtil
+ .isJewelry(item)) {
te.setJewelryItemStack(item);
if (!entityPlayer.capabilities.isCreativeMode)
--item.stackSize;
@@ -73,8 +75,8 @@ public class BlockJewelersCraftingTable extends BlockContainer { public void dropItem(World world, double x, double y, double z,
ItemStack stack) {
- EntityItem entityitem =
- new EntityItem(world, x + 0.5D, y + 1D, z + 0.5D, stack);
+ EntityItem entityitem = new EntityItem(world, x + 0.5D,
+ y + 1D, z + 0.5D, stack);
entityitem.motionX = 0;
entityitem.motionZ = 0;
entityitem.motionY = 0.21000000298023224D;
@@ -82,20 +84,21 @@ public class BlockJewelersCraftingTable extends BlockContainer { }
@Override
- public void breakBlock(World world, int i, int j, int k, Block par5,
- int par6) {
- TileEntityJewelrsCraftingTable te =
- (TileEntityJewelrsCraftingTable) world.getTileEntity(i, j,
- k);
+ public void breakBlock(World world, int i, int j, int k,
+ Block par5, int par6) {
+ TileEntityJewelrsCraftingTable te = (TileEntityJewelrsCraftingTable) world
+ .getTileEntity(i, j, k);
if (te != null) {
if (te.hasJewelry)
- dropItem(world, te.xCoord, te.yCoord, te.zCoord,
+ dropItem(world, te.xCoord, te.yCoord,
+ te.zCoord,
te.jewelry.copy());
if (te.hasGem)
- dropItem(world, te.xCoord, te.yCoord, te.zCoord,
- te.gem.copy());
+ dropItem(world, te.xCoord, te.yCoord,
+ te.zCoord, te.gem.copy());
if (te.hasEndItem)
- dropItem(te.getWorldObj(), te.xCoord, te.yCoord, te.zCoord,
+ dropItem(te.getWorldObj(), te.xCoord,
+ te.yCoord, te.zCoord,
te.endItem.copy());
world.removeTileEntity(i, j, k);
}
@@ -104,18 +107,20 @@ public class BlockJewelersCraftingTable extends BlockContainer { @Override
public void onBlockPlacedBy(World world, int i, int j, int k,
- EntityLivingBase entityLiving, ItemStack par6ItemStack) {
- int rotation = MathHelper.floor_double(
- entityLiving.rotationYaw * 4.0F / 360.0F + 0.5D) & 3;
+ EntityLivingBase entityLiving,
+ ItemStack par6ItemStack) {
+ int rotation = MathHelper
+ .floor_double(entityLiving.rotationYaw
+ * 4.0F / 360.0F + 0.5D)
+ & 3;
world.setBlockMetadataWithNotify(i, j, k, rotation, 2);
}
@Override
public void onBlockClicked(World world, int i, int j, int k,
EntityPlayer player) {
- TileEntityJewelrsCraftingTable te =
- (TileEntityJewelrsCraftingTable) world.getTileEntity(i, j,
- k);
+ TileEntityJewelrsCraftingTable te = (TileEntityJewelrsCraftingTable) world
+ .getTileEntity(i, j, k);
if (te != null && !world.isRemote)
if (player.isSneaking()) {
if (te.hasJewelry)
@@ -124,30 +129,38 @@ public class BlockJewelersCraftingTable extends BlockContainer { te.removeGem();
} else if (te.hasEndItem)
te.removeResult();
- else if (te.hasJewelry && te.hasGem && te.carving > 0
+ else if (te.hasJewelry && te.hasGem
+ && te.carving > 0
&& te.jewelry != null)
- player.addChatMessage(new ChatComponentText(StatCollector
- .translateToLocalFormatted(
- "chatmessage." + Variables.MODID
- + ".table.iscrafting",
- te.jewelry.getDisplayName())
- + " ("
- + (ConfigHandler.GEM_PLACEMENT_TIME - te.carving)
- * 100 / ConfigHandler.GEM_PLACEMENT_TIME
- + "%)"));
+ player.addChatMessage(
+ new ChatComponentText(
+ StatCollector.translateToLocalFormatted(
+ "chatmessage." + Variables.MODID
+ + ".table.iscrafting",
+ te.jewelry.getDisplayName())
+ + " ("
+ + (ConfigHandler.GEM_PLACEMENT_TIME
+ - te.carving)
+ * 100
+ / ConfigHandler.GEM_PLACEMENT_TIME
+ + "%)"));
else if (!te.hasGem)
- player.addChatMessage(new ChatComponentText(
- StatCollector.translateToLocal("chatmessage."
- + Variables.MODID + ".table.missinggem")));
+ player.addChatMessage(
+ new ChatComponentText(
+ StatCollector.translateToLocal(
+ "chatmessage." + Variables.MODID
+ + ".table.missinggem")));
else if (!te.hasJewelry)
- player.addChatMessage(new ChatComponentText(StatCollector
- .translateToLocal("chatmessage." + Variables.MODID
- + ".table.missingjewelry")));
+ player.addChatMessage(
+ new ChatComponentText(
+ StatCollector.translateToLocal(
+ "chatmessage." + Variables.MODID
+ + ".table.missingjewelry")));
}
@Override
- public boolean shouldSideBeRendered(IBlockAccess iblockaccess, int i,
- int j, int k, int l) {
+ public boolean shouldSideBeRendered(IBlockAccess iblockaccess,
+ int i, int j, int k, int l) {
return false;
}
diff --git a/src/main/java/darkknight/jewelrycraft/block/BlockList.java b/src/main/java/darkknight/jewelrycraft/block/BlockList.java index cd928b8..5fe71d5 100755 --- a/src/main/java/darkknight/jewelrycraft/block/BlockList.java +++ b/src/main/java/darkknight/jewelrycraft/block/BlockList.java @@ -23,70 +23,92 @@ import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.oredict.OreDictionary;
public class BlockList {
- public static Block shadowOre, smelter, molder, displayer,
- jewelCraftingTable, shadowBlock, shadowEye, handPedestal,
- shadowHand, midasTouchBlock, crystal;
+ public static Block shadowOre, smelter, molder,
+ displayer, jewelCraftingTable, shadowBlock,
+ shadowEye, handPedestal, shadowHand,
+ midasTouchBlock, crystal;
public static BlockMoltenMetal moltenMetal;
- public static Fluid moltenMetalFluid;
+ public static Fluid moltenMetalFluid;
- public static void preInit(
- FMLPreInitializationEvent e) {
- shadowOre = new BlockJCOre().setHardness(3.0F).setResistance(5.0F)
+ public static void preInit(FMLPreInitializationEvent e) {
+ shadowOre = new BlockJCOre().setHardness(3.0F)
+ .setResistance(5.0F)
.setStepSound(Block.soundTypePiston)
- .setBlockTextureName(Variables.MODID + ":oreShadow")
- .setBlockName(Variables.MODID + ".oreShadow")
+ .setBlockTextureName(Variables.MODID
+ + ":oreShadow")
+ .setBlockName(Variables.MODID
+ + ".oreShadow")
.setCreativeTab(JewelrycraftMod.jewelrycraft);
- smelter = new BlockSmelter().setHardness(5.0F).setResistance(6.0F)
+ smelter = new BlockSmelter().setHardness(5.0F)
+ .setResistance(6.0F)
.setStepSound(Block.soundTypePiston)
.setBlockName(Variables.MODID + ".smelter")
.setCreativeTab(JewelrycraftMod.jewelrycraft);
molder = new BlockMolder(Material.rock).setHardness(5.0F)
- .setResistance(6.0F).setStepSound(Block.soundTypePiston)
+ .setResistance(6.0F)
+ .setStepSound(Block.soundTypePiston)
.setBlockName(Variables.MODID + ".molder")
.setCreativeTab(JewelrycraftMod.jewelrycraft);
- displayer = new BlockDisplayer(Material.iron).setHardness(5.0F)
- .setResistance(6.0F).setStepSound(Block.soundTypeMetal)
- .setBlockName(Variables.MODID + ".displayer")
- .setCreativeTab(JewelrycraftMod.jewelrycraft);
- jewelCraftingTable = new BlockJewelersCraftingTable(Material.rock)
- .setHardness(3.0F).setResistance(5.0F)
- .setStepSound(Block.soundTypePiston)
- .setBlockName(Variables.MODID + ".jewelCraftingTable")
+ displayer = new BlockDisplayer(Material.iron)
+ .setHardness(5.0F).setResistance(6.0F)
+ .setStepSound(Block.soundTypeMetal)
+ .setBlockName(Variables.MODID
+ + ".displayer")
.setCreativeTab(JewelrycraftMod.jewelrycraft);
+ jewelCraftingTable = new BlockJewelersCraftingTable(
+ Material.rock).setHardness(3.0F)
+ .setResistance(5.0F)
+ .setStepSound(Block.soundTypePiston)
+ .setBlockName(Variables.MODID
+ + ".jewelCraftingTable")
+ .setCreativeTab(JewelrycraftMod.jewelrycraft);
shadowBlock = new BlockShadow().setHardness(5.0F)
- .setResistance(7.0F).setStepSound(Block.soundTypeMetal)
- .setBlockTextureName(Variables.MODID + ":blockShadow")
- .setBlockName(Variables.MODID + ".blockShadow")
+ .setResistance(7.0F)
+ .setStepSound(Block.soundTypeMetal)
+ .setBlockTextureName(Variables.MODID
+ + ":blockShadow")
+ .setBlockName(Variables.MODID
+ + ".blockShadow")
.setCreativeTab(JewelrycraftMod.jewelrycraft);
shadowEye = new BlockShadowEye().setHardness(5.0F)
- .setResistance(6.0F).setStepSound(Block.soundTypePiston)
- .setBlockName(Variables.MODID + ".shadowEye")
+ .setResistance(6.0F)
+ .setStepSound(Block.soundTypePiston)
+ .setBlockName(Variables.MODID
+ + ".shadowEye")
.setCreativeTab(JewelrycraftMod.jewelrycraft);
handPedestal = new BlockHandPedestal(Material.rock)
.setHardness(5.0F).setResistance(6.0F)
.setStepSound(Block.soundTypePiston)
- .setBlockName(Variables.MODID + ".handPedestal")
+ .setBlockName(Variables.MODID
+ + ".handPedestal")
.setCreativeTab(JewelrycraftMod.jewelrycraft);
shadowHand = new BlockShadowHand(Material.rock)
.setStepSound(Block.soundTypePiston)
- .setBlockName(Variables.MODID + ".shadowHand")
+ .setBlockName(Variables.MODID
+ + ".shadowHand")
.setCreativeTab(JewelrycraftMod.jewelrycraft)
.setBlockUnbreakable();
midasTouchBlock = new BlockMidasTouch(Material.iron)
.setHardness(3.0F).setResistance(10.0F)
.setStepSound(Block.soundTypeMetal)
- .setBlockName(Variables.MODID + ".midasTouchBlock");
- moltenMetalFluid = new Fluid("metal.molten").setLuminosity(15)
- .setDensity(3000).setTemperature(2000).setViscosity(6000);
+ .setBlockName(Variables.MODID
+ + ".midasTouchBlock");
+ moltenMetalFluid = new Fluid("metal.molten")
+ .setLuminosity(15).setDensity(3000)
+ .setTemperature(2000).setViscosity(6000);
if (!FluidRegistry.registerFluid(moltenMetalFluid))
- moltenMetalFluid = FluidRegistry.getFluid("metal.molten");
- moltenMetal =
- new BlockMoltenMetal(moltenMetalFluid, Material.lava);
+ moltenMetalFluid = FluidRegistry
+ .getFluid("metal.molten");
+ moltenMetal = new BlockMoltenMetal(moltenMetalFluid,
+ Material.lava);
moltenMetalFluid.setBlock(moltenMetal);
- crystal = new BlockCrystal().setHardness(2.0F).setResistance(5.0F)
+ crystal = new BlockCrystal().setHardness(2.0F)
+ .setResistance(5.0F)
.setStepSound(Block.soundTypeGlass)
- .setBlockTextureName(Variables.MODID + ":blockCrystal")
- .setBlockName(Variables.MODID + ".blockCrystal")
+ .setBlockTextureName(Variables.MODID
+ + ":blockCrystal")
+ .setBlockName(Variables.MODID
+ + ".blockCrystal")
.setCreativeTab(JewelrycraftMod.jewelrycraft);
GameRegistry.registerBlock(shadowOre, "shadowOre");
@@ -97,10 +119,13 @@ public class BlockList { "jewelCraftingTable");
GameRegistry.registerBlock(displayer, "Displayer");
GameRegistry.registerBlock(shadowEye, "Shadow Eye");
- GameRegistry.registerBlock(handPedestal, "Stone Bricks Pedestal");
+ GameRegistry.registerBlock(handPedestal,
+ "Stone Bricks Pedestal");
GameRegistry.registerBlock(shadowHand, "Shadow Hand");
- GameRegistry.registerBlock(midasTouchBlock, "Midas Touch Block");
- GameRegistry.registerBlock(moltenMetal, "moltenMetalLiquid");
+ GameRegistry.registerBlock(midasTouchBlock,
+ "Midas Touch Block");
+ GameRegistry.registerBlock(moltenMetal,
+ "moltenMetalLiquid");
GameRegistry.registerBlock(crystal, BlockItemCrystal.class,
"crystalBlock");
@@ -113,11 +138,13 @@ public class BlockList { Variables.MODID + ":table");
GameRegistry.registerTileEntity(TileEntityDisplayer.class,
Variables.MODID + ":displayer");
- GameRegistry.registerTileEntity(TileEntityBlockShadow.class,
+ GameRegistry.registerTileEntity(
+ TileEntityBlockShadow.class,
Variables.MODID + ":blockShadow");
GameRegistry.registerTileEntity(TileEntityShadowEye.class,
Variables.MODID + ":shadowEye");
- GameRegistry.registerTileEntity(TileEntityHandPedestal.class,
+ GameRegistry.registerTileEntity(
+ TileEntityHandPedestal.class,
Variables.MODID + ":handPedestal");
GameRegistry.registerTileEntity(TileEntityShadowHand.class,
Variables.MODID + ":shadowHand");
@@ -125,7 +152,8 @@ public class BlockList { Variables.MODID + ":midsaTouch");
GameRegistry.registerTileEntity(TileEntityCrystal.class,
Variables.MODID + ":crystalBlock");
- GameRegistry.registerTileEntity(TileEntityMoltenMetal.class,
+ GameRegistry.registerTileEntity(
+ TileEntityMoltenMetal.class,
Variables.MODID + ":moltenMetalTE");
OreDictionary.registerOre("oreShadow",
diff --git a/src/main/java/darkknight/jewelrycraft/block/BlockMidasTouch.java b/src/main/java/darkknight/jewelrycraft/block/BlockMidasTouch.java index 19e0190..8713796 100755 --- a/src/main/java/darkknight/jewelrycraft/block/BlockMidasTouch.java +++ b/src/main/java/darkknight/jewelrycraft/block/BlockMidasTouch.java @@ -30,8 +30,8 @@ public class BlockMidasTouch extends BlockContainer { }
@Override
- public boolean shouldSideBeRendered(IBlockAccess iblockaccess, int i,
- int j, int k, int l) {
+ public boolean shouldSideBeRendered(IBlockAccess iblockaccess,
+ int i, int j, int k, int l) {
return false;
}
@@ -66,13 +66,17 @@ public class BlockMidasTouch extends BlockContainer { int y, int z) {
TileEntity tile = world.getTileEntity(x, y, z);
if (((TileEntityMidasTouch) tile).target != null)
- this.setBlockBounds(
- 0.5f - ((TileEntityMidasTouch) tile).target.width / 2,
+ this.setBlockBounds(0.5f
+ - ((TileEntityMidasTouch) tile).target.width
+ / 2,
0F,
- 0.5f - ((TileEntityMidasTouch) tile).target.width / 2,
- 0.5f + ((TileEntityMidasTouch) tile).target.width / 2,
+ 0.5f - ((TileEntityMidasTouch) tile).target.width
+ / 2,
+ 0.5f + ((TileEntityMidasTouch) tile).target.width
+ / 2,
((TileEntityMidasTouch) tile).target.height,
- 0.5f + ((TileEntityMidasTouch) tile).target.width / 2);
+ 0.5f + ((TileEntityMidasTouch) tile).target.width
+ / 2);
}
@Override
diff --git a/src/main/java/darkknight/jewelrycraft/block/BlockMolder.java b/src/main/java/darkknight/jewelrycraft/block/BlockMolder.java index 7d7b34d..4f763ad 100755 --- a/src/main/java/darkknight/jewelrycraft/block/BlockMolder.java +++ b/src/main/java/darkknight/jewelrycraft/block/BlockMolder.java @@ -42,45 +42,48 @@ public class BlockMolder extends BlockContainer { @Override
public boolean onBlockActivated(World world, int i, int j, int k,
- EntityPlayer entityPlayer, int par6, float par7, float par8,
- float par9) {
- TileEntityMolder te =
- (TileEntityMolder) world.getTileEntity(i, j, k);
+ EntityPlayer entityPlayer, int par6, float par7,
+ float par8, float par9) {
+ TileEntityMolder te = (TileEntityMolder) world
+ .getTileEntity(i, j, k);
ItemStack item = entityPlayer.inventory.getCurrentItem();
if (te != null && !world.isRemote) {
- if (item != null && !te.hasMold
- && item.getItem() == ItemList.molds) {
+ if (item != null && !te.hasMold && item
+ .getItem() == ItemList.molds) {
te.mold = item.copy();
te.hasMold = true;
if (!entityPlayer.capabilities.isCreativeMode)
--item.stackSize;
- entityPlayer.addChatMessage(new ChatComponentText(
- StatCollector.translateToLocalFormatted(
- "chatmessage." + Variables.MODID
- + ".molder.addedmold",
- te.mold.getDisplayName())));
+ entityPlayer.addChatMessage(
+ new ChatComponentText(
+ StatCollector.translateToLocalFormatted(
+ "chatmessage." + Variables.MODID
+ + ".molder.addedmold",
+ te.mold.getDisplayName())));
te.isDirty = true;
}
if (te.hasMold && entityPlayer.isSneaking()
&& !te.hasMoltenMetal) {
- dropItem(world, te.xCoord, te.yCoord, te.zCoord,
- te.mold.copy());
- te.mold = new ItemStack(Item.getItemById(0), 0, 0);
+ dropItem(world, te.xCoord, te.yCoord,
+ te.zCoord, te.mold.copy());
+ te.mold = new ItemStack(
+ Item.getItemById(0), 0, 0);
te.hasMold = false;
te.isDirty = true;
} else if (te.hasMoltenMetal)
- entityPlayer.addChatMessage(new ChatComponentText(
- StatCollector.translateToLocal(
- "chatmessage." + Variables.MODID
- + ".molder.hasmoltenmetal")));
+ entityPlayer.addChatMessage(
+ new ChatComponentText(
+ StatCollector.translateToLocal(
+ "chatmessage." + Variables.MODID
+ + ".molder.hasmoltenmetal")));
}
return true;
}
public void dropItem(World world, double x, double y, double z,
ItemStack stack) {
- EntityItem entityitem =
- new EntityItem(world, x + 0.5D, y + 0.5D, z + 0.5D, stack);
+ EntityItem entityitem = new EntityItem(world, x + 0.5D,
+ y + 0.5D, z + 0.5D, stack);
entityitem.motionX = 0;
entityitem.motionZ = 0;
entityitem.motionY = 0.11000000298023224D;
@@ -88,17 +91,18 @@ public class BlockMolder extends BlockContainer { }
@Override
- public void breakBlock(World world, int i, int j, int k, Block par5,
- int par6) {
- TileEntityMolder te =
- (TileEntityMolder) world.getTileEntity(i, j, k);
+ public void breakBlock(World world, int i, int j, int k,
+ Block par5, int par6) {
+ TileEntityMolder te = (TileEntityMolder) world
+ .getTileEntity(i, j, k);
if (te != null) {
if (te.hasJewelBase)
- dropItem(te.getWorldObj(), te.xCoord, te.yCoord, te.zCoord,
+ dropItem(te.getWorldObj(), te.xCoord,
+ te.yCoord, te.zCoord,
te.jewelBase.copy());
if (te.hasMold)
- dropItem(world, te.xCoord, te.yCoord, te.zCoord,
- te.mold.copy());
+ dropItem(world, te.xCoord, te.yCoord,
+ te.zCoord, te.mold.copy());
world.removeTileEntity(i, j, k);
}
super.breakBlock(world, i, j, k, par5, par6);
@@ -106,47 +110,60 @@ public class BlockMolder extends BlockContainer { @Override
public void onBlockPlacedBy(World world, int i, int j, int k,
- EntityLivingBase entityLiving, ItemStack par6ItemStack) {
- int rotation = MathHelper.floor_double(
- entityLiving.rotationYaw * 4.0F / 360.0F + 0.5D) & 3;
+ EntityLivingBase entityLiving,
+ ItemStack par6ItemStack) {
+ int rotation = MathHelper
+ .floor_double(entityLiving.rotationYaw
+ * 4.0F / 360.0F + 0.5D)
+ & 3;
world.setBlockMetadataWithNotify(i, j, k, rotation, 2);
}
@Override
public void onBlockClicked(World world, int i, int j, int k,
EntityPlayer player) {
- TileEntityMolder me =
- (TileEntityMolder) world.getTileEntity(i, j, k);
+ TileEntityMolder me = (TileEntityMolder) world
+ .getTileEntity(i, j, k);
if (me != null && !world.isRemote) {
if (me.hasJewelBase) {
- dropItem(me.getWorldObj(), me.xCoord, me.yCoord, me.zCoord,
+ dropItem(me.getWorldObj(), me.xCoord,
+ me.yCoord, me.zCoord,
me.jewelBase.copy());
- me.jewelBase = new ItemStack(Item.getItemById(0), 0, 0);
+ me.jewelBase = new ItemStack(
+ Item.getItemById(0), 0, 0);
me.hasJewelBase = false;
} else if (me.hasMoltenMetal && me.cooling >= 0)
- player.addChatMessage(new ChatComponentText(StatCollector
- .translateToLocal("chatmessage." + Variables.MODID
- + ".molder.metaliscooling")
- + " ("
- + (ConfigHandler.INGOT_COOLING_TIME - me.cooling)
- * 100 / ConfigHandler.INGOT_COOLING_TIME
- + "%)"));
+ player.addChatMessage(
+ new ChatComponentText(
+ StatCollector.translateToLocal(
+ "chatmessage." + Variables.MODID
+ + ".molder.metaliscooling")
+ + " ("
+ + (ConfigHandler.INGOT_COOLING_TIME
+ - me.cooling)
+ * 100
+ / ConfigHandler.INGOT_COOLING_TIME
+ + "%)"));
else if (me.mold.getItem() == ItemList.molds
&& !me.hasMoltenMetal)
- player.addChatMessage(new ChatComponentText(StatCollector
- .translateToLocal("chatmessage." + Variables.MODID
- + ".molder.moldisempty")));
+ player.addChatMessage(
+ new ChatComponentText(
+ StatCollector.translateToLocal(
+ "chatmessage." + Variables.MODID
+ + ".molder.moldisempty")));
else if (me.mold.getItem() != ItemList.molds)
- player.addChatMessage(new ChatComponentText(StatCollector
- .translateToLocal("chatmessage." + Variables.MODID
- + ".molder.moldismissing")));
+ player.addChatMessage(
+ new ChatComponentText(
+ StatCollector.translateToLocal(
+ "chatmessage." + Variables.MODID
+ + ".molder.moldismissing")));
me.isDirty = true;
}
}
@Override
- public boolean shouldSideBeRendered(IBlockAccess iblockaccess, int i,
- int j, int k, int l) {
+ public boolean shouldSideBeRendered(IBlockAccess iblockaccess,
+ int i, int j, int k, int l) {
return false;
}
diff --git a/src/main/java/darkknight/jewelrycraft/block/BlockMoltenMetal.java b/src/main/java/darkknight/jewelrycraft/block/BlockMoltenMetal.java index 088a5e2..6d88443 100755 --- a/src/main/java/darkknight/jewelrycraft/block/BlockMoltenMetal.java +++ b/src/main/java/darkknight/jewelrycraft/block/BlockMoltenMetal.java @@ -45,21 +45,23 @@ public class BlockMoltenMetal extends BlockFluidClassic @Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister register) {
- stillIcon = register
- .registerIcon(Variables.MODID + ":moltenMetalStill");
- flowingIcon = register
- .registerIcon(Variables.MODID + ":moltenMetalFlow");
+ stillIcon = register.registerIcon(
+ Variables.MODID + ":moltenMetalStill");
+ flowingIcon = register.registerIcon(
+ Variables.MODID + ":moltenMetalFlow");
}
@Override
- public boolean canDisplace(IBlockAccess world, int x, int y, int z) {
+ public boolean canDisplace(IBlockAccess world, int x, int y,
+ int z) {
if (world.getBlock(x, y, z).getMaterial().isLiquid())
return false;
return super.canDisplace(world, x, y, z);
}
@Override
- public boolean displaceIfPossible(World world, int x, int y, int z) {
+ public boolean displaceIfPossible(World world, int x, int y,
+ int z) {
if (world.getBlock(x, y, z).getMaterial().isLiquid())
return false;
return super.displaceIfPossible(world, x, y, z);
@@ -91,7 +93,8 @@ public class BlockMoltenMetal extends BlockFluidClassic @Override
@SideOnly(Side.CLIENT)
- public int colorMultiplier(IBlockAccess world, int i, int j, int k) {
+ public int colorMultiplier(IBlockAccess world, int i, int j,
+ int k) {
try {
return color(world, i, j, k, false, null);
} catch (IOException e) {
@@ -101,67 +104,191 @@ public class BlockMoltenMetal extends BlockFluidClassic }
@Override
- public void updateTick(World world, int x, int y, int z, Random rand) {
+ public void updateTick(World world, int x, int y, int z,
+ Random rand) {
if (getTileEntity(world, x, y, z) == null
- || (getTileEntity(world, x, y, z).getMetal() == null))
+ || (getTileEntity(world, x, y, z)
+ .getMetal() == null))
world.setBlockToAir(x, y, z);
else {
- int quantaRemaining =
- quantaPerBlock - world.getBlockMetadata(x, y, z);
+ int quantaRemaining = quantaPerBlock
+ - world.getBlockMetadata(x, y, z);
int expQuanta = -101;
// check adjacent block levels if non-source
if (quantaRemaining < quantaPerBlock) {
int y2 = y - densityDir;
if ((world.getBlock(x, y2, z) == this
- && getTileEntity(world, x, y2, z) != null
- && getTileEntity(world, x, y, z) != null
- && areMetalsEqual(world, x, y2, z, x, y, z))
- || (world.getBlock(x - 1, y2, z) == this
- && getTileEntity(world, x - 1, y2,
+ && getTileEntity(world, x,
+ y2,
+ z) != null
+ && getTileEntity(world, x,
+ y,
+ z) != null
+ && areMetalsEqual(world, x,
+ y2, z, x,
+ y, z))
+ || (world.getBlock(x - 1,
+ y2,
+ z) == this
+ && getTileEntity(
+ world,
+ x - 1,
+ y2,
+ z) != null
+ && getTileEntity(
+ world,
+ x,
+ y,
z) != null
- && getTileEntity(world, x, y, z) != null
- && areMetalsEqual(world, x - 1, y2, z, x,
- y, z))
- || (world.getBlock(x + 1, y2, z) == this
- && getTileEntity(world, x + 1, y2,
+ && areMetalsEqual(
+ world,
+ x - 1,
+ y2,
+ z,
+ x,
+ y,
+ z))
+ || (world.getBlock(x + 1,
+ y2,
+ z) == this
+ && getTileEntity(
+ world,
+ x + 1,
+ y2,
z) != null
- && getTileEntity(world, x, y, z) != null
- && areMetalsEqual(world, x + 1, y2, z, x,
- y, z))
- || (world.getBlock(x, y2, z - 1) == this
- && getTileEntity(world, x, y2,
+ && getTileEntity(
+ world,
+ x,
+ y,
+ z) != null
+ && areMetalsEqual(
+ world,
+ x + 1,
+ y2,
+ z,
+ x,
+ y,
+ z))
+ || (world.getBlock(x, y2, z
+ - 1) == this
+ && getTileEntity(
+ world,
+ x,
+ y2,
z - 1) != null
- && getTileEntity(world, x, y, z) != null
- && areMetalsEqual(world, x, y2, z - 1, x,
- y, z))
- || (world.getBlock(x, y2, z + 1) == this
- && getTileEntity(world, x, y2,
+ && getTileEntity(
+ world,
+ x,
+ y,
+ z) != null
+ && areMetalsEqual(
+ world,
+ x,
+ y2,
+ z - 1,
+ x,
+ y,
+ z))
+ || (world.getBlock(x, y2, z
+ + 1) == this
+ && getTileEntity(
+ world,
+ x,
+ y2,
z + 1) != null
- && getTileEntity(world, x, y, z) != null
- && areMetalsEqual(world, x, y2, z + 1, x,
- y, z)))
+ && getTileEntity(
+ world,
+ x,
+ y,
+ z) != null
+ && areMetalsEqual(
+ world,
+ x,
+ y2,
+ z + 1,
+ x,
+ y,
+ z)))
expQuanta = quantaPerBlock - 1;
else {
int maxQuanta = -100;
- if (getTileEntity(world, x, y, z) != null
- && getTileEntity(world, x - 1, y, z) != null
- && areMetalsEqual(world, x, y, z, x - 1, y, z))
- maxQuanta = getLargerQuanta(world, x - 1, y, z,
+ if (getTileEntity(world, x, y,
+ z) != null
+ && getTileEntity(
+ world,
+ x - 1,
+ y,
+ z) != null
+ && areMetalsEqual(
+ world,
+ x,
+ y,
+ z,
+ x - 1,
+ y,
+ z))
+ maxQuanta = getLargerQuanta(
+ world,
+ x - 1, y,
+ z,
maxQuanta);
- if (getTileEntity(world, x, y, z) != null
- && getTileEntity(world, x + 1, y, z) != null
- && areMetalsEqual(world, x, y, z, x + 1, y, z))
- maxQuanta = getLargerQuanta(world, x + 1, y, z,
+ if (getTileEntity(world, x, y,
+ z) != null
+ && getTileEntity(
+ world,
+ x + 1,
+ y,
+ z) != null
+ && areMetalsEqual(
+ world,
+ x,
+ y,
+ z,
+ x + 1,
+ y,
+ z))
+ maxQuanta = getLargerQuanta(
+ world,
+ x + 1, y,
+ z,
maxQuanta);
- if (getTileEntity(world, x, y, z) != null
- && getTileEntity(world, x, y, z - 1) != null
- && areMetalsEqual(world, x, y, z, x, y, z - 1))
- maxQuanta = getLargerQuanta(world, x, y, z - 1,
+ if (getTileEntity(world, x, y,
+ z) != null
+ && getTileEntity(
+ world,
+ x,
+ y,
+ z - 1) != null
+ && areMetalsEqual(
+ world,
+ x,
+ y,
+ z,
+ x,
+ y,
+ z - 1))
+ maxQuanta = getLargerQuanta(
+ world, x,
+ y, z - 1,
maxQuanta);
- if (getTileEntity(world, x, y, z) != null
- && getTileEntity(world, x, y, z + 1) != null
- && areMetalsEqual(world, x, y, z, x, y, z + 1))
- maxQuanta = getLargerQuanta(world, x, y, z + 1,
+ if (getTileEntity(world, x, y,
+ z) != null
+ && getTileEntity(
+ world,
+ x,
+ y,
+ z + 1) != null
+ && areMetalsEqual(
+ world,
+ x,
+ y,
+ z,
+ x,
+ y,
+ z + 1))
+ maxQuanta = getLargerQuanta(
+ world, x,
+ y, z + 1,
maxQuanta);
expQuanta = maxQuanta - 1;
}
@@ -169,75 +296,119 @@ public class BlockMoltenMetal extends BlockFluidClassic if (expQuanta != quantaRemaining) {
quantaRemaining = expQuanta;
if (expQuanta <= 0)
- world.setBlock(x, y, z, Blocks.air);
+ world.setBlock(x, y, z,
+ Blocks.air);
else {
- world.setBlockMetadataWithNotify(x, y, z,
- quantaPerBlock - expQuanta, 3);
- world.scheduleBlockUpdate(x, y, z, this, tickRate);
- world.notifyBlocksOfNeighborChange(x, y, z, this);
+ world.setBlockMetadataWithNotify(
+ x, y, z,
+ quantaPerBlock - expQuanta,
+ 3);
+ world.scheduleBlockUpdate(
+ x, y, z,
+ this,
+ tickRate);
+ world.notifyBlocksOfNeighborChange(
+ x, y, z,
+ this);
}
}
}
- // This is a "source" block, set meta to zero, and send a
+ // This is a "source" block, set meta to zero, and
+ // send a
// server only update
else if (quantaRemaining >= quantaPerBlock)
- world.setBlockMetadataWithNotify(x, y, z, 0, 2);
+ world.setBlockMetadataWithNotify(x, y, z,
+ 0, 2);
// Flow vertically if possible
if (canDisplace(world, x, y + densityDir, z)) {
- if (getTileEntity(world, x, y + densityDir, z) != null
- && getTileEntity(world, x, y, z) != null)
- BlockMoltenMetal
- .getTileEntity(world, x, y + densityDir, z)
- .setMetal(getTileEntity(world, x, y, z)
- .getMetal());
- flowIntoBlock(world, x, y + densityDir, z, 1,
- getTileEntity(world, x, y, z).getMetal());
+ if (getTileEntity(world, x, y + densityDir,
+ z) != null
+ && getTileEntity(world, x,
+ y,
+ z) != null)
+ BlockMoltenMetal.getTileEntity(
+ world, x,
+ y + densityDir, z)
+ .setMetal(getTileEntity(
+ world,
+ x,
+ y,
+ z).getMetal());
+ flowIntoBlock(world, x, y + densityDir, z,
+ 1,
+ getTileEntity(world, x, y,
+ z).getMetal());
return;
}
// Flow outward if possible
- int flowMeta = quantaPerBlock - quantaRemaining + 1;
+ int flowMeta = quantaPerBlock - quantaRemaining
+ + 1;
if (flowMeta >= quantaPerBlock)
return;
if (isSourceBlock(world, x, y, z)
- || !isFlowingVertically(world, x, y, z)) {
- if (world.getBlock(x, y - densityDir, z) == this
- && getTileEntity(world, x, y, z) != null
- && getTileEntity(world, x, y - densityDir,
+ || !isFlowingVertically(world, x,
+ y, z)) {
+ if (world.getBlock(x, y - densityDir,
+ z) == this
+ && getTileEntity(world, x,
+ y,
+ z) != null
+ && getTileEntity(world, x,
+ y - densityDir,
z) != null
- && areMetalsEqual(world, x, y, z, x,
- y - densityDir, z))
+ && areMetalsEqual(world, x,
+ y, z, x,
+ y - densityDir,
+ z))
flowMeta = 1;
- boolean flowTo[] =
- getOptimalFlowDirections(world, x, y, z);
+ boolean flowTo[] = getOptimalFlowDirections(
+ world, x, y, z);
if (flowTo[0])
- flowIntoBlock(world, x - 1, y, z, flowMeta,
- getTileEntity(world, x, y, z).getMetal());
+ flowIntoBlock(world, x - 1, y, z,
+ flowMeta,
+ getTileEntity(world,
+ x,
+ y,
+ z).getMetal());
if (flowTo[1])
- flowIntoBlock(world, x + 1, y, z, flowMeta,
- getTileEntity(world, x, y, z).getMetal());
+ flowIntoBlock(world, x + 1, y, z,
+ flowMeta,
+ getTileEntity(world,
+ x,
+ y,
+ z).getMetal());
if (flowTo[2])
- flowIntoBlock(world, x, y, z - 1, flowMeta,
- getTileEntity(world, x, y, z).getMetal());
+ flowIntoBlock(world, x, y, z - 1,
+ flowMeta,
+ getTileEntity(world,
+ x,
+ y,
+ z).getMetal());
if (flowTo[3])
- flowIntoBlock(world, x, y, z + 1, flowMeta,
- getTileEntity(world, x, y, z).getMetal());
+ flowIntoBlock(world, x, y, z + 1,
+ flowMeta,
+ getTileEntity(world,
+ x,
+ y,
+ z).getMetal());
}
}
}
- public void flowIntoBlock(World world, int x, int y, int z, int meta,
- ItemStack metal) {
+ public void flowIntoBlock(World world, int x, int y, int z,
+ int meta, ItemStack metal) {
if (meta < 0 || world.isRemote)
return;
if (displaceIfPossible(world, x, y, z)) {
world.setBlock(x, y, z, this, meta, 3);
if (getTileEntity(world, x, y, z) != null)
- getTileEntity(world, x, y, z).setMetal(metal);
+ getTileEntity(world, x, y, z)
+ .setMetal(metal);
}
}
- public static TileEntityMoltenMetal getTileEntity(World world, int x,
- int y, int z) {
+ public static TileEntityMoltenMetal getTileEntity(World world,
+ int x, int y, int z) {
TileEntity moltenLiquid = world.getTileEntity(x, y, z);
if (moltenLiquid != null
&& moltenLiquid instanceof TileEntityMoltenMetal)
@@ -248,18 +419,24 @@ public class BlockMoltenMetal extends BlockFluidClassic public static boolean areMetalsEqual(World world, int x1, int y1,
int z1, int x2, int y2, int z2) {
return ItemStack.areItemStacksEqual(
- getTileEntity(world, x1, y1, z1).getMetal(),
- getTileEntity(world, x2, y2, z2).getMetal());
+ getTileEntity(world, x1, y1, z1)
+ .getMetal(),
+ getTileEntity(world, x2, y2, z2)
+ .getMetal());
}
@SideOnly(Side.CLIENT)
public static int color(IBlockAccess world, int i, int j, int k,
- boolean forcecolor, Item itemC) throws IOException {
+ boolean forcecolor, Item itemC)
+ throws IOException {
TileEntity te = world.getTileEntity(i, j, k);
if (te instanceof TileEntityMoltenMetal
- && ((TileEntityMoltenMetal) te).getMetal() != null)
+ && ((TileEntityMoltenMetal) te)
+ .getMetal() != null)
return JewelrycraftUtil.getColor(
- ((TileEntityMoltenMetal) te).getMetal().copy());
+ ((TileEntityMoltenMetal) te)
+ .getMetal()
+ .copy());
return 16777215;
}
diff --git a/src/main/java/darkknight/jewelrycraft/block/BlockShadow.java b/src/main/java/darkknight/jewelrycraft/block/BlockShadow.java index a311c1f..dff2a94 100755 --- a/src/main/java/darkknight/jewelrycraft/block/BlockShadow.java +++ b/src/main/java/darkknight/jewelrycraft/block/BlockShadow.java @@ -103,8 +103,8 @@ public class BlockShadow extends BlockContainer { public void registerBlockIcons(IIconRegister par1IconRegister) {
iconArray = new IIcon[16];
for (int i = 0; i < iconArray.length; ++i)
- iconArray[i] = par1IconRegister
- .registerIcon(getTextureName() + (15 - i));
+ iconArray[i] = par1IconRegister.registerIcon(
+ getTextureName() + (15 - i));
}
/**
@@ -119,7 +119,8 @@ public class BlockShadow extends BlockContainer { int x, int y, int z) {
if (world.getBlockMetadata(x, y, z) == 15)
return null;
- return super.getCollisionBoundingBoxFromPool(world, x, y, z);
+ return super.getCollisionBoundingBoxFromPool(world, x, y,
+ z);
}
/**
@@ -129,8 +130,9 @@ public class BlockShadow extends BlockContainer { * @param par4
*/
@Override
- public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess,
- int par2, int par3, int par4) {
+ public void setBlockBoundsBasedOnState(
+ IBlockAccess par1IBlockAccess, int par2, int par3,
+ int par4) {
setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
}
@@ -146,14 +148,15 @@ public class BlockShadow extends BlockContainer { public boolean shouldSideBeRendered(IBlockAccess p_149646_1_,
int p_149646_2_, int p_149646_3_, int p_149646_4_,
int p_149646_5_) {
- Block block = p_149646_1_.getBlock(p_149646_2_, p_149646_3_,
- p_149646_4_);
+ Block block = p_149646_1_.getBlock(p_149646_2_,
+ p_149646_3_, p_149646_4_);
if (this == BlockList.shadowBlock)
if (block == this)
return false;
return block == this ? false
- : super.shouldSideBeRendered(p_149646_1_, p_149646_2_,
- p_149646_3_, p_149646_4_, p_149646_5_);
+ : super.shouldSideBeRendered(p_149646_1_,
+ p_149646_2_, p_149646_3_,
+ p_149646_4_, p_149646_5_);
}
/**
@@ -173,8 +176,8 @@ public class BlockShadow extends BlockContainer { * @return
*/
@Override
- public int getComparatorInputOverride(World world, int x, int y, int z,
- int meta) {
+ public int getComparatorInputOverride(World world, int x, int y,
+ int z, int meta) {
return world.getBlockMetadata(x, y, z);
}
diff --git a/src/main/java/darkknight/jewelrycraft/block/BlockShadowEye.java b/src/main/java/darkknight/jewelrycraft/block/BlockShadowEye.java index 85c552d..553ab05 100755 --- a/src/main/java/darkknight/jewelrycraft/block/BlockShadowEye.java +++ b/src/main/java/darkknight/jewelrycraft/block/BlockShadowEye.java @@ -48,8 +48,8 @@ public class BlockShadowEye extends BlockContainer { * @return
*/
@Override
- public boolean shouldSideBeRendered(IBlockAccess iblockaccess, int i,
- int j, int k, int l) {
+ public boolean shouldSideBeRendered(IBlockAccess iblockaccess,
+ int i, int j, int k, int l) {
return false;
}
@@ -83,10 +83,10 @@ public class BlockShadowEye extends BlockContainer { */
@Override
public boolean onBlockActivated(World world, int i, int j, int k,
- EntityPlayer entityPlayer, int par6, float par7, float par8,
- float par9) {
- TileEntityShadowEye tile =
- (TileEntityShadowEye) world.getTileEntity(i, j, k);
+ EntityPlayer entityPlayer, int par6, float par7,
+ float par8, float par9) {
+ TileEntityShadowEye tile = (TileEntityShadowEye) world
+ .getTileEntity(i, j, k);
if (!tile.active && tile.opening == 1) {
tile.active = true;
tile.target = entityPlayer;
@@ -118,9 +118,12 @@ public class BlockShadowEye extends BlockContainer { */
@Override
public void onBlockPlacedBy(World world, int i, int j, int k,
- EntityLivingBase entityLiving, ItemStack par6ItemStack) {
- int rotation = MathHelper.floor_double(
- entityLiving.rotationYaw * 4.0F / 360.0F + 0.5D) & 3;
+ EntityLivingBase entityLiving,
+ ItemStack par6ItemStack) {
+ int rotation = MathHelper
+ .floor_double(entityLiving.rotationYaw
+ * 4.0F / 360.0F + 0.5D)
+ & 3;
world.setBlockMetadataWithNotify(i, j, k, rotation, 2);
}
diff --git a/src/main/java/darkknight/jewelrycraft/block/BlockShadowHand.java b/src/main/java/darkknight/jewelrycraft/block/BlockShadowHand.java index 6d4cee1..0d9ceb4 100755 --- a/src/main/java/darkknight/jewelrycraft/block/BlockShadowHand.java +++ b/src/main/java/darkknight/jewelrycraft/block/BlockShadowHand.java @@ -49,8 +49,8 @@ public class BlockShadowHand extends BlockContainer { * @return
*/
@Override
- public boolean shouldSideBeRendered(IBlockAccess iblockaccess, int i,
- int j, int k, int l) {
+ public boolean shouldSideBeRendered(IBlockAccess iblockaccess,
+ int i, int j, int k, int l) {
return false;
}
@@ -79,8 +79,8 @@ public class BlockShadowHand extends BlockContainer { */
public void dropItem(World world, double x, double y, double z,
ItemStack stack) {
- EntityItem entityitem =
- new EntityItem(world, x + 0.5D, y + 1.5D, z + 0.5D, stack);
+ EntityItem entityitem = new EntityItem(world, x + 0.5D,
+ y + 1.5D, z + 0.5D, stack);
entityitem.motionX = 0;
entityitem.motionZ = 0;
entityitem.motionY = 0.11000000298023224D;
@@ -96,13 +96,15 @@ public class BlockShadowHand extends BlockContainer { * @param par6
*/
@Override
- public void breakBlock(World world, int i, int j, int k, Block block,
- int par6) {
- if (world.getTileEntity(i, j, k) instanceof TileEntityShadowHand) {
- TileEntityShadowHand te =
- (TileEntityShadowHand) world.getTileEntity(i, j, k);
+ public void breakBlock(World world, int i, int j, int k,
+ Block block, int par6) {
+ if (world.getTileEntity(i, j,
+ k) instanceof TileEntityShadowHand) {
+ TileEntityShadowHand te = (TileEntityShadowHand) world
+ .getTileEntity(i, j, k);
if (te != null && te.getHeldItemStack() != null) {
- dropItem(te.getWorldObj(), te.xCoord, te.yCoord, te.zCoord,
+ dropItem(te.getWorldObj(), te.xCoord,
+ te.yCoord, te.zCoord,
te.getHeldItemStack());
world.removeTileEntity(i, j, k);
}
@@ -120,9 +122,12 @@ public class BlockShadowHand extends BlockContainer { */
@Override
public void onBlockPlacedBy(World world, int i, int j, int k,
- EntityLivingBase entityLiving, ItemStack par6ItemStack) {
- int rotation = MathHelper.floor_double(
- entityLiving.rotationYaw * 8.0F / 360.0F + 0.5D) & 7;
+ EntityLivingBase entityLiving,
+ ItemStack par6ItemStack) {
+ int rotation = MathHelper
+ .floor_double(entityLiving.rotationYaw
+ * 8.0F / 360.0F + 0.5D)
+ & 7;
world.setBlockMetadataWithNotify(i, j, k, rotation, 2);
}
diff --git a/src/main/java/darkknight/jewelrycraft/block/BlockSmelter.java b/src/main/java/darkknight/jewelrycraft/block/BlockSmelter.java index ea5e991..4da1037 100755 --- a/src/main/java/darkknight/jewelrycraft/block/BlockSmelter.java +++ b/src/main/java/darkknight/jewelrycraft/block/BlockSmelter.java @@ -47,8 +47,8 @@ public class BlockSmelter extends BlockContainer { public void dropItem(World world, double x, double y, double z,
ItemStack stack) {
- EntityItem entityitem =
- new EntityItem(world, x + 0.5D, y + 1.3D, z + 0.5D, stack);
+ EntityItem entityitem = new EntityItem(world, x + 0.5D,
+ y + 1.3D, z + 0.5D, stack);
entityitem.motionX = 0;
entityitem.motionZ = 0;
entityitem.motionY = 0.11000000298023224D;
@@ -57,24 +57,29 @@ public class BlockSmelter extends BlockContainer { }
@Override
- public void breakBlock(World world, int i, int j, int k, Block block,
- int meta) {
- TileEntitySmelter te =
- (TileEntitySmelter) world.getTileEntity(i, j, k);
+ public void breakBlock(World world, int i, int j, int k,
+ Block block, int meta) {
+ TileEntitySmelter te = (TileEntitySmelter) world
+ .getTileEntity(i, j, k);
if (te != null) {
if (te.hasMetal)
dropItem(world, i, j, k, te.metal.copy());
if (te.hasMoltenMetal && te.moltenMetal != null
- && Item.getIdFromItem(te.moltenMetal.getItem()) > 0) {
+ && Item.getIdFromItem(
+ te.moltenMetal.getItem()) > 0) {
int quant = (int) (te.quantity * 10);
- ItemStack metalBucket = new ItemStack(ItemList.bucket);
- JewelryNBT.addMetal(metalBucket, te.moltenMetal.copy());
+ ItemStack metalBucket = new ItemStack(
+ ItemList.bucket);
+ JewelryNBT.addMetal(metalBucket,
+ te.moltenMetal.copy());
if (quant == 9) {
dropItem(world, i, j, k,
- new ItemStack(Blocks.cobblestone, 6));
+ new ItemStack(Blocks.cobblestone,
+ 6));
dropItem(world, i, j, k,
new ItemStack(Items.lava_bucket));
- dropItem(world, i, j, k, metalBucket);
+ dropItem(world, i, j, k,
+ metalBucket);
}
}
world.removeTileEntity(i, j, k);
@@ -83,115 +88,145 @@ public class BlockSmelter extends BlockContainer { @Override
public boolean onBlockActivated(World world, int i, int j, int k,
- EntityPlayer entityPlayer, int par6, float par7, float par8,
- float par9) {
- TileEntitySmelter te =
- (TileEntitySmelter) world.getTileEntity(i, j, k);
+ EntityPlayer entityPlayer, int par6, float par7,
+ float par8, float par9) {
+ TileEntitySmelter te = (TileEntitySmelter) world
+ .getTileEntity(i, j, k);
ItemStack item = entityPlayer.inventory.getCurrentItem();
if (te != null && te.hasMoltenMetal && te.quantity >= .9f
&& !te.pouring && item != null
&& item.getItem() == Items.bucket) {
te.quantity = 0f;
te.hasMoltenMetal = false;
- ItemStack metalBucket = new ItemStack(ItemList.bucket, 1);
+ ItemStack metalBucket = new ItemStack(
+ ItemList.bucket, 1);
ItemStack ingot = te.moltenMetal.copy();
JewelryNBT.addMetal(metalBucket, ingot);
--item.stackSize;
- entityPlayer.inventory.addItemStackToInventory(metalBucket);
+ entityPlayer.inventory.addItemStackToInventory(
+ metalBucket);
te.isDirty = true;
return true;
}
if (te != null && !world.isRemote) {
if (te.hasMetal && entityPlayer.isSneaking()) {
- dropItem(world, te.xCoord, te.yCoord, te.zCoord,
+ dropItem(world, te.xCoord, te.yCoord,
+ te.zCoord,
te.metal.copy());
te.hasMetal = false;
te.melting = -1;
te.isDirty = true;
}
- if (item != null && item.getItem() != null && !(item
- .getItem() instanceof ItemMoltenMetalBucket)) {
+ if (item != null && item.getItem() != null
+ && !(item.getItem() instanceof ItemMoltenMetalBucket)) {
int index = -1;
- for (int a = 0;
- a < JewelrycraftUtil.jamcraftPlayers.size(); a++)
- if (entityPlayer.getUniqueID().toString().equals(
- JewelrycraftUtil.jamcraftPlayers.get(a)))
+ for (int a = 0; a < JewelrycraftUtil.jamcraftPlayers
+ .size(); a++)
+ if (entityPlayer.getUniqueID()
+ .toString()
+ .equals(JewelrycraftUtil.jamcraftPlayers
+ .get(a)))
index = a;
if (entityPlayer.capabilities.isCreativeMode)
index = 1;
- boolean canPlace = JewelrycraftUtil.isMetal(item)
- || JewelrycraftUtil.isOre(item) || index >= 0
- || JewelryNBT.ingot(item) != null;
- boolean isOre = false, oreCoincidesWithMetal = false,
+ boolean canPlace = JewelrycraftUtil
+ .isMetal(item)
+ || JewelrycraftUtil.isOre(
+ item)
+ || index >= 0
+ || JewelryNBT.ingot(
+ item) != null;
+ boolean isOre = false,
+ oreCoincidesWithMetal = false,
itemCoincidesWithMetal = false,
itemCoincidesWithMoltenMetal = false,
overflow = false;
isOre = JewelrycraftUtil.isOre(item);
- if (te.metal != null && te.metal.getItem() != null) {
+ if (te.metal != null && te.metal
+ .getItem() != null) {
if (JewelryNBT.ingot(item) == null)
- itemCoincidesWithMetal =
- item.getItem().equals(te.metal.getItem())
- && item.getItemDamage() == te.metal
- .getItemDamage();
+ itemCoincidesWithMetal = item
+ .getItem()
+ .equals(te.metal.getItem())
+ && item.getItemDamage() == te.metal
+ .getItemDamage();
else
- itemCoincidesWithMetal =
- item.getItem().equals(te.metal.getItem())
- && item.getItemDamage() == te.metal
- .getItemDamage()
- && JewelryNBT.ingot(item).getItem()
- .equals(JewelryNBT
- .ingot(te.metal)
- .getItem())
- && JewelryNBT.ingot(item)
- .getItemDamage() == JewelryNBT
- .ingot(te.metal)
- .getItemDamage();
+ itemCoincidesWithMetal = item
+ .getItem()
+ .equals(te.metal.getItem())
+ && item.getItemDamage() == te.metal
+ .getItemDamage()
+ && JewelryNBT.ingot(
+ item)
+ .getItem()
+ .equals(JewelryNBT
+ .ingot(te.metal)
+ .getItem())
+ && JewelryNBT.ingot(
+ item)
+ .getItemDamage() == JewelryNBT
+ .ingot(te.metal)
+ .getItemDamage();
}
if (te.moltenMetal != null
- && te.moltenMetal.getItem() != null) {
+ && te.moltenMetal
+ .getItem() != null) {
if (JewelryNBT.ingot(item) == null)
- itemCoincidesWithMoltenMetal = item.getItem()
- .equals(te.moltenMetal.getItem())
+ itemCoincidesWithMoltenMetal = item
+ .getItem()
+ .equals(te.moltenMetal
+ .getItem())
&& item.getItemDamage() == te.moltenMetal
.getItemDamage();
else
- itemCoincidesWithMoltenMetal =
- JewelryNBT.ingot(item).getItem()
- .equals(te.moltenMetal.getItem())
- && JewelryNBT.ingot(item)
- .getItemDamage() == te.moltenMetal
- .getItemDamage();
+ itemCoincidesWithMoltenMetal = JewelryNBT
+ .ingot(item)
+ .getItem()
+ .equals(te.moltenMetal
+ .getItem())
+ && JewelryNBT.ingot(
+ item)
+ .getItemDamage() == te.moltenMetal
+ .getItemDamage();
if (isOre)
- oreCoincidesWithMetal = te.moltenMetal.getItem()
+ oreCoincidesWithMetal = te.moltenMetal
+ .getItem()
.equals(JewelrycraftUtil
- .getIngotFromOre(item).getItem())
+ .getIngotFromOre(
+ item)
+ .getItem())
&& te.moltenMetal
.getItemDamage() == JewelrycraftUtil
- .getIngotFromOre(item)
+ .getIngotFromOre(
+ item)
.getItemDamage();
}
- overflow = isOre
- ? te.metal.stackSize * 0.2f + te.quantity < 0.8f
- : te.metal.stackSize * 0.1f + te.quantity < 0.9f;
- boolean isValid =
- te.hasMoltenMetal
- ? isOre ? oreCoincidesWithMetal
- : itemCoincidesWithMoltenMetal
- : true;
- if (te.quantity < 0.9f && !te.pouring && canPlace
- && isValid) {
+ overflow = isOre ? te.metal.stackSize
+ * 0.2f + te.quantity < 0.8f
+ : te.metal.stackSize * 0.1f
+ + te.quantity < 0.9f;
+ boolean isValid = te.hasMoltenMetal ? isOre
+ ? oreCoincidesWithMetal
+ : itemCoincidesWithMoltenMetal
+ : true;
+ if (te.quantity < 0.9f && !te.pouring
+ && canPlace && isValid) {
boolean check = isOre
- ? oreCoincidesWithMetal && te.quantity < 0.8f
+ ? oreCoincidesWithMetal
+ && te.quantity < 0.8f
: itemCoincidesWithMoltenMetal;
- boolean check2 = isOre ? oreCoincidesWithMetal
+ boolean check2 = isOre
+ ? oreCoincidesWithMetal
: itemCoincidesWithMetal;
- if (!te.hasMetal && !te.hasMoltenMetal || !te.hasMetal
- && te.hasMoltenMetal && check) {
- entityPlayer.addChatMessage(new ChatComponentText(
- StatCollector.translateToLocalFormatted(
- "chatmessage." + Variables.MODID
- + ".smelter.nowsmeltingingot",
- item.getDisplayName())));
+ if (!te.hasMetal && !te.hasMoltenMetal
+ || !te.hasMetal && te.hasMoltenMetal
+ && check) {
+ entityPlayer.addChatMessage(
+ new ChatComponentText(
+ StatCollector.translateToLocalFormatted(
+ "chatmessage." + Variables.MODID
+ + ".smelter.nowsmeltingingot",
+ item.getDisplayName())));
te.metal = item.copy();
te.metal.stackSize = 1;
te.hasMetal = true;
@@ -199,19 +234,23 @@ public class BlockSmelter extends BlockContainer { if (!entityPlayer.capabilities.isCreativeMode)
--item.stackSize;
te.isDirty = true;
- } else if (te.hasMetal && te.hasMoltenMetal && check2
+ } else if (te.hasMetal
+ && te.hasMoltenMetal
+ && check2
&& overflow
|| te.hasMetal && !te.hasMoltenMetal
&& itemCoincidesWithMetal
&& overflow) {
- entityPlayer.addChatMessage(new ChatComponentText(
- StatCollector.translateToLocalFormatted(
- "Smelting extra "
- + (isOre ? "ores"
- : "ingots")
- + " ("
- + (te.metal.stackSize + 1)
- + ")")));
+ entityPlayer.addChatMessage(
+ new ChatComponentText(
+ StatCollector.translateToLocalFormatted(
+ "Smelting extra "
+ + (isOre ? "ores"
+ : "ingots")
+ + " ("
+ + (te.metal.stackSize
+ + 1)
+ + ")")));
te.metal.stackSize++;
te.hasMetal = true;
te.melting += ConfigHandler.INGOT_MELTING_TIME;
@@ -220,34 +259,43 @@ public class BlockSmelter extends BlockContainer { te.isDirty = true;
}
te.isDirty = true;
- } else if ((te.hasMetal || te.hasMoltenMetal)
+ } else if ((te.hasMetal
+ || te.hasMoltenMetal)
&& !itemCoincidesWithMoltenMetal
&& te.quantity < .9f)
- entityPlayer.addChatMessage(new ChatComponentText(
- StatCollector.translateToLocal("chatmessage."
- + Variables.MODID
- + ".smelter.contentdoesnotmatch")));
- else if (!item.getUnlocalizedName().toLowerCase()
+ entityPlayer.addChatMessage(
+ new ChatComponentText(
+ StatCollector.translateToLocal(
+ "chatmessage." + Variables.MODID
+ + ".smelter.contentdoesnotmatch")));
+ else if (!item.getUnlocalizedName()
+ .toLowerCase()
.contains("ingot")
- && item.getDisplayName().toLowerCase()
+ && item.getDisplayName()
+ .toLowerCase()
.contains("ingot")
&& te.quantity < .9f)
- entityPlayer.addChatMessage(new ChatComponentText(
- StatCollector.translateToLocal("chatmessage."
- + Variables.MODID
- + ".smelter.itemrenamedtoingot")));
+ entityPlayer.addChatMessage(
+ new ChatComponentText(
+ StatCollector.translateToLocal(
+ "chatmessage." + Variables.MODID
+ + ".smelter.itemrenamedtoingot")));
else if (te.quantity >= .9f)
- entityPlayer.addChatMessage(new ChatComponentText(
- StatCollector.translateToLocal("chatmessage."
- + Variables.MODID + ".smelter.full")));
+ entityPlayer.addChatMessage(
+ new ChatComponentText(
+ StatCollector.translateToLocal(
+ "chatmessage." + Variables.MODID
+ + ".smelter.full")));
else
- entityPlayer.addChatMessage(new ChatComponentText(
- StatCollector.translateToLocal(
- "chatmessage." + Variables.MODID
- + ".smelter.cannotsmelt")));
+ entityPlayer.addChatMessage(
+ new ChatComponentText(
+ StatCollector.translateToLocal(
+ "chatmessage." + Variables.MODID
+ + ".smelter.cannotsmelt")));
} else if (item != null && item.getItem() != null
&& item.getItem() instanceof ItemMoltenMetalBucket
- && !te.hasMoltenMetal && !te.hasMetal) {
+ && !te.hasMoltenMetal
+ && !te.hasMetal) {
te.hasMoltenMetal = true;
ItemStack ingot = JewelryNBT.ingot(item);
te.moltenMetal = ingot;
@@ -255,18 +303,22 @@ public class BlockSmelter extends BlockContainer { te.isDirty = true;
if (!entityPlayer.capabilities.isCreativeMode) {
--item.stackSize;
- dropItem(world, entityPlayer.posX, entityPlayer.posY,
+ dropItem(world, entityPlayer.posX,
+ entityPlayer.posY,
entityPlayer.posZ,
new ItemStack(Items.bucket));
}
} else if (item == null && te.hasMoltenMetal
- && te.moltenMetal.getItem() != null)
- entityPlayer.addChatMessage(new ChatComponentText(
- StatCollector.translateToLocalFormatted(
- "chatmessage." + Variables.MODID
- + ".smelter.hasmolteningot",
- te.moltenMetal.getDisplayName()
- .replace(" Ingot", ""))));
+ && te.moltenMetal
+ .getItem() != null)
+ entityPlayer.addChatMessage(
+ new ChatComponentText(
+ StatCollector.translateToLocalFormatted(
+ "chatmessage." + Variables.MODID
+ + ".smelter.hasmolteningot",
+ te.moltenMetal.getDisplayName()
+ .replace(" Ingot",
+ ""))));
world.setTileEntity(i, j, k, te);
}
return true;
@@ -275,99 +327,122 @@ public class BlockSmelter extends BlockContainer { @Override
public void onBlockClicked(World world, int i, int j, int k,
EntityPlayer player) {
- TileEntitySmelter te =
- (TileEntitySmelter) world.getTileEntity(i, j, k);
+ TileEntitySmelter te = (TileEntitySmelter) world
+ .getTileEntity(i, j, k);
TileEntityMolder me = null;
if (world.getBlockMetadata(i, j, k) == 0
&& world.getTileEntity(i, j, k - 1) != null
- && world.getTileEntity(i, j,
- k - 1) instanceof TileEntityMolder)
- me = (TileEntityMolder) world.getTileEntity(i, j, k - 1);
+ && world.getTileEntity(i, j, k
+ - 1) instanceof TileEntityMolder)
+ me = (TileEntityMolder) world.getTileEntity(i, j,
+ k - 1);
else if (world.getBlockMetadata(i, j, k) == 1
&& world.getTileEntity(i + 1, j, k) != null
&& world.getTileEntity(i + 1, j,
k) instanceof TileEntityMolder)
- me = (TileEntityMolder) world.getTileEntity(i + 1, j, k);
+ me = (TileEntityMolder) world.getTileEntity(i + 1,
+ j, k);
else if (world.getBlockMetadata(i, j, k) == 2
&& world.getTileEntity(i, j, k + 1) != null
- && world.getTileEntity(i, j,
- k + 1) instanceof TileEntityMolder)
- me = (TileEntityMolder) world.getTileEntity(i, j, k + 1);
+ && world.getTileEntity(i, j, k
+ + 1) instanceof TileEntityMolder)
+ me = (TileEntityMolder) world.getTileEntity(i, j,
+ k + 1);
else if (world.getBlockMetadata(i, j, k) == 3
&& world.getTileEntity(i - 1, j, k) != null
&& world.getTileEntity(i - 1, j,
k) instanceof TileEntityMolder)
- me = (TileEntityMolder) world.getTileEntity(i - 1, j, k);
+ me = (TileEntityMolder) world.getTileEntity(i - 1,
+ j, k);
if (te != null && me != null && !world.isRemote)
- if (te.hasMoltenMetal && isConnectedToMolder(world, i, j, k)
+ if (te.hasMoltenMetal
+ && isConnectedToMolder(world, i, j,
+ k)
&& me.hasMold && !me.hasMoltenMetal
&& !me.hasJewelBase) {
te.pouring = true;
te.isDirty = true;
} else if (te.hasMetal && te.melting > 0)
- player.addChatMessage(new ChatComponentText(
- StatCollector.translateToLocalFormatted(
- "chatmessage." + Variables.MODID
- + ".smelter.metalismelting",
- te.metal.getDisplayName())
- + " ("
- + (ConfigHandler.INGOT_MELTING_TIME
- * te.metal.stackSize - te.melting)
- * 100
- / (ConfigHandler.INGOT_MELTING_TIME
- * te.metal.stackSize)
- + "%)"));
+ player.addChatMessage(
+ new ChatComponentText(
+ StatCollector.translateToLocalFormatted(
+ "chatmessage." + Variables.MODID
+ + ".smelter.metalismelting",
+ te.metal.getDisplayName())
+ + " ("
+ + (ConfigHandler.INGOT_MELTING_TIME
+ * te.metal.stackSize
+ - te.melting)
+ * 100
+ / (ConfigHandler.INGOT_MELTING_TIME
+ * te.metal.stackSize)
+ + "%)"));
else if (te.hasMoltenMetal
- && !isConnectedToMolder(world, i, j, k))
- player.addChatMessage(new ChatComponentText(StatCollector
- .translateToLocal("chatmessage." + Variables.MODID
- + ".smelter.molderismissing")));
+ && !isConnectedToMolder(world, i,
+ j, k))
+ player.addChatMessage(
+ new ChatComponentText(
+ StatCollector.translateToLocal(
+ "chatmessage." + Variables.MODID
+ + ".smelter.molderismissing")));
else if (!me.hasMold && te.hasMoltenMetal)
- player.addChatMessage(new ChatComponentText(StatCollector
- .translateToLocal("chatmessage." + Variables.MODID
- + ".smelter.molderhasnomold")));
+ player.addChatMessage(
+ new ChatComponentText(
+ StatCollector.translateToLocal(
+ "chatmessage." + Variables.MODID
+ + ".smelter.molderhasnomold")));
else if (me.hasMoltenMetal && te.hasMoltenMetal)
- player.addChatMessage(new ChatComponentText(StatCollector
- .translateToLocal("chatmessage." + Variables.MODID
- + ".smelter.molderhasmoltenmetal")));
+ player.addChatMessage(
+ new ChatComponentText(
+ StatCollector.translateToLocal(
+ "chatmessage." + Variables.MODID
+ + ".smelter.molderhasmoltenmetal")));
else if (me.hasJewelBase && te.hasMoltenMetal)
- player.addChatMessage(new ChatComponentText(StatCollector
- .translateToLocal("chatmessage." + Variables.MODID
- + ".smelter.modlerhasitem")));
+ player.addChatMessage(
+ new ChatComponentText(
+ StatCollector.translateToLocal(
+ "chatmessage." + Variables.MODID
+ + ".smelter.modlerhasitem")));
else
- player.addChatMessage(new ChatComponentText(
- StatCollector.translateToLocal("chatmessage."
- + Variables.MODID + ".smelter.empty")));
+ player.addChatMessage(
+ new ChatComponentText(
+ StatCollector.translateToLocal(
+ "chatmessage." + Variables.MODID
+ + ".smelter.empty")));
}
- public boolean isConnectedToMolder(World world, int i, int j, int k) {
+ public boolean isConnectedToMolder(World world, int i, int j,
+ int k) {
int blockMeta = world.getBlockMetadata(i, j, k);
- if (blockMeta == 0
- && world.getBlock(i, j, k - 1) instanceof BlockMolder)
+ if (blockMeta == 0 && world.getBlock(i, j,
+ k - 1) instanceof BlockMolder)
return true;
- else if (blockMeta == 1
- && world.getBlock(i + 1, j, k) instanceof BlockMolder)
+ else if (blockMeta == 1 && world.getBlock(i + 1, j,
+ k) instanceof BlockMolder)
return true;
- else if (blockMeta == 2
- && world.getBlock(i, j, k + 1) instanceof BlockMolder)
+ else if (blockMeta == 2 && world.getBlock(i, j,
+ k + 1) instanceof BlockMolder)
return true;
- else if (blockMeta == 3
- && world.getBlock(i - 1, j, k) instanceof BlockMolder)
+ else if (blockMeta == 3 && world.getBlock(i - 1, j,
+ k) instanceof BlockMolder)
return true;
return false;
}
@Override
public void onBlockPlacedBy(World world, int i, int j, int k,
- EntityLivingBase entityLiving, ItemStack par6ItemStack) {
- int rotation = MathHelper.floor_double(
- entityLiving.rotationYaw * 4.0F / 360.0F + 0.5D) & 3;
+ EntityLivingBase entityLiving,
+ ItemStack par6ItemStack) {
+ int rotation = MathHelper
+ .floor_double(entityLiving.rotationYaw
+ * 4.0F / 360.0F + 0.5D)
+ & 3;
world.setBlockMetadataWithNotify(i, j, k, rotation, 2);
}
@Override
- public boolean shouldSideBeRendered(IBlockAccess iblockaccess, int i,
- int j, int k, int l) {
+ public boolean shouldSideBeRendered(IBlockAccess iblockaccess,
+ int i, int j, int k, int l) {
return false;
}
diff --git a/src/main/java/darkknight/jewelrycraft/block/render/BlockCrystalRenderer.java b/src/main/java/darkknight/jewelrycraft/block/render/BlockCrystalRenderer.java index a60c8cc..f8344b6 100755 --- a/src/main/java/darkknight/jewelrycraft/block/render/BlockCrystalRenderer.java +++ b/src/main/java/darkknight/jewelrycraft/block/render/BlockCrystalRenderer.java @@ -33,9 +33,12 @@ public class BlockCrystalRenderer implements ISimpleBlockRenderingHandler { GL11.glDisable(GL11.GL_LIGHTING);
tessellator.startDrawingQuads();
if (metadata < 16)
- tessellator.setColorRGBA_I(BlockCrystal.colors[metadata], 100);
+ tessellator.setColorRGBA_I(
+ BlockCrystal.colors[metadata],
+ 100);
GL11.glTranslatef(-0.5f, -0.5f, -0.5f);
- this.renderWorldBlock(null, 0, 0, 0, block, modelID, renderer);
+ this.renderWorldBlock(null, 0, 0, 0, block, modelID,
+ renderer);
tessellator.draw();
GL11.glTranslatef(0.5f, 0.5f, 0.5f);
GL11.glEnable(GL11.GL_LIGHTING);
@@ -44,7 +47,8 @@ public class BlockCrystalRenderer implements ISimpleBlockRenderingHandler { @Override
public boolean renderWorldBlock(IBlockAccess world, int x, int y,
- int z, Block block, int modelId, RenderBlocks renderer) {
+ int z, Block block, int modelId,
+ RenderBlocks renderer) {
int crystals = 5;
Random rnd = new Random();
Tessellator tessellator = Tessellator.instance;
@@ -56,8 +60,11 @@ public class BlockCrystalRenderer implements ISimpleBlockRenderingHandler { tessellator.addTranslation(x, y, z);
if (world != null && world.getTileEntity(x, y, z) != null
&& ConfigHandler.CRYSTAL_GLOW)
- tessellator.setBrightness(((TileEntityCrystal) world
- .getTileEntity(x, y, z)).shine);
+ tessellator.setBrightness(
+ ((TileEntityCrystal) world
+ .getTileEntity(x,
+ y,
+ z)).shine);
else
tessellator.setBrightness(230);
// 37435, 76464
@@ -67,37 +74,47 @@ public class BlockCrystalRenderer implements ISimpleBlockRenderingHandler { rnd.setSeed(76464);
if (world != null && world.getBlockMetadata(x, y, z) < 16)
tessellator.setColorRGBA_I(
- BlockCrystal.colors[world.getBlockMetadata(x, y, z)],
+ BlockCrystal.colors[world
+ .getBlockMetadata(
+ x,
+ y,
+ z)],
100);
- crystal(tessellator, umin, vmin, umax, vmax, 0.8D, 0.2D, 0D, 0D,
- 0D, 0.0D, 0.0D);
+ crystal(tessellator, umin, vmin, umax, vmax, 0.8D, 0.2D,
+ 0D, 0D, 0D, 0.0D, 0.0D);
for (int i = 0; i < crystals; i++) {
double rotation = Math.PI * 2.0f / crystals * i;
- double xp1 =
- Math.sin(rotation) * ((0.15F + rnd.nextFloat()) / 2f);
- double zp1 =
- Math.cos(rotation) * ((0.15F + rnd.nextFloat()) / 2f);
+ double xp1 = Math.sin(rotation)
+ * ((0.15F + rnd.nextFloat()) / 2f);
+ double zp1 = Math.cos(rotation)
+ * ((0.15F + rnd.nextFloat()) / 2f);
double height = 0.2f + rnd.nextFloat();
double topHeight = 0.1f + rnd.nextFloat() / 2f;
- crystal(tessellator, umin, vmin, umax, vmax, height, topHeight,
- -xp1, 0D, zp1, xp1, zp1);
+ crystal(tessellator, umin, vmin, umax, vmax,
+ height, topHeight, -xp1, 0D, zp1,
+ xp1, zp1);
}
if (world != null) {
crystals = 4;
for (int i = 0; i < crystals; i++) {
- double rotation = Math.PI * 2F / crystals * i;
- double xp1 = Math.sin(rotation)
- * ((0.15F + rnd.nextFloat()) / 2f);
- double zp1 = Math.cos(rotation)
- * ((0.15F + rnd.nextFloat()) / 2f);
+ double rotation = Math.PI * 2F / crystals
+ * i;
+ double xp1 = Math.sin(rotation) * ((0.15F
+ + rnd.nextFloat()) / 2f);
+ double zp1 = Math.cos(rotation) * ((0.15F
+ + rnd.nextFloat()) / 2f);
double height = 0.1f + rnd.nextFloat();
- double topHeight = 0.1f + rnd.nextFloat() / 2f;
- float xOff = (rnd.nextFloat() * 1.5f - 0.5f)
+ double topHeight = 0.1f
+ + rnd.nextFloat() / 2f;
+ float xOff = (rnd.nextFloat() * 1.5f
+ - 0.5f)
* (rnd.nextFloat() / 2f);
- float zOff = (rnd.nextFloat() * 1.5f - 0.5f)
+ float zOff = (rnd.nextFloat() * 1.5f
+ - 0.5f)
* (rnd.nextFloat() / 2f);
- crystal(tessellator, umin, vmin, umax, vmax, height,
- topHeight, xOff, 0D, zOff, xp1, zp1);
+ crystal(tessellator, umin, vmin, umax,
+ vmax, height, topHeight,
+ xOff, 0D, zOff, xp1, zp1);
}
}
tessellator.addTranslation(-x, -y, -z);
@@ -105,89 +122,106 @@ public class BlockCrystalRenderer implements ISimpleBlockRenderingHandler { }
private static void crystal(Tessellator tessellator, double umin,
- double vmin, double umax, double vmax, double height,
- double topHeight, double posX, double posY, double posZ,
- double rotX, double rotZ) {
+ double vmin, double umax, double vmax,
+ double height, double topHeight, double posX,
+ double posY, double posZ, double rotX,
+ double rotZ) {
// Negative X
tessellator.addVertexWithUV(0.4 + rotX + posX, 0.0 + posY,
0.6 - rotZ + posZ, umin, vmin);
- tessellator.addVertexWithUV(0.4 - rotX + posX, height + posY,
- 0.6 + rotZ + posZ, umin, vmax);
- tessellator.addVertexWithUV(0.4 - rotX + posX, height + posY,
- 0.4 + rotZ + posZ, umax, vmax);
+ tessellator.addVertexWithUV(0.4 - rotX + posX,
+ height + posY, 0.6 + rotZ + posZ, umin,
+ vmax);
+ tessellator.addVertexWithUV(0.4 - rotX + posX,
+ height + posY, 0.4 + rotZ + posZ, umax,
+ vmax);
tessellator.addVertexWithUV(0.4 + rotX + posX, 0.0 + posY,
0.4 - rotZ + posZ, umax, vmin);
// Positive X
tessellator.addVertexWithUV(0.6 + rotX + posX, 0.0 + posY,
0.4 - rotZ + posZ, umin, vmin);
- tessellator.addVertexWithUV(0.6 - rotX + posX, height + posY,
- 0.4 + rotZ + posZ, umin, vmax);
- tessellator.addVertexWithUV(0.6 - rotX + posX, height + posY,
- 0.6 + rotZ + posZ, umax, vmax);
+ tessellator.addVertexWithUV(0.6 - rotX + posX,
+ height + posY, 0.4 + rotZ + posZ, umin,
+ vmax);
+ tessellator.addVertexWithUV(0.6 - rotX + posX,
+ height + posY, 0.6 + rotZ + posZ, umax,
+ vmax);
tessellator.addVertexWithUV(0.6 + rotX + posX, 0.0 + posY,
0.6 - rotZ + posZ, umax, vmin);
// Negative Z
tessellator.addVertexWithUV(0.4 + rotX + posX, 0.0 + posY,
0.4 - rotZ + posZ, umin, vmin);
- tessellator.addVertexWithUV(0.4 - rotX + posX, height + posY,
- 0.4 + rotZ + posZ, umin, vmax);
- tessellator.addVertexWithUV(0.6 - rotX + posX, height + posY,
- 0.4 + rotZ + posZ, umax, vmax);
+ tessellator.addVertexWithUV(0.4 - rotX + posX,
+ height + posY, 0.4 + rotZ + posZ, umin,
+ vmax);
+ tessellator.addVertexWithUV(0.6 - rotX + posX,
+ height + posY, 0.4 + rotZ + posZ, umax,
+ vmax);
tessellator.addVertexWithUV(0.6 + rotX + posX, 0.0 + posY,
0.4 - rotZ + posZ, umax, vmin);
// Positive Z
tessellator.addVertexWithUV(0.6 + rotX + posX, 0.0 + posY,
0.6 - rotZ + posZ, umin, vmin);
- tessellator.addVertexWithUV(0.6 - rotX + posX, height + posY,
- 0.6 + rotZ + posZ, umin, vmax);
- tessellator.addVertexWithUV(0.4 - rotX + posX, height + posY,
- 0.6 + rotZ + posZ, umax, vmax);
+ tessellator.addVertexWithUV(0.6 - rotX + posX,
+ height + posY, 0.6 + rotZ + posZ, umin,
+ vmax);
+ tessellator.addVertexWithUV(0.4 - rotX + posX,
+ height + posY, 0.6 + rotZ + posZ, umax,
+ vmax);
tessellator.addVertexWithUV(0.4 + rotX + posX, 0.0 + posY,
0.6 - rotZ + posZ, umax, vmin);
// Top -X
- tessellator.addVertexWithUV(0.4 - rotX + posX, height + posY,
- 0.6 + rotZ + posZ, umin, vmin);
+ tessellator.addVertexWithUV(0.4 - rotX + posX,
+ height + posY, 0.6 + rotZ + posZ, umin,
+ vmin);
tessellator.addVertexWithUV(0.5 - rotX - rotX + posX,
- height + topHeight + posY, 0.5 + rotZ + rotZ + posZ, umin,
- vmax);
+ height + topHeight + posY,
+ 0.5 + rotZ + rotZ + posZ, umin, vmax);
tessellator.addVertexWithUV(0.5 - rotX - rotX + posX,
- height + topHeight + posY, 0.5 + rotZ + rotZ + posZ, umax,
- vmax);
- tessellator.addVertexWithUV(0.4 - rotX + posX, height + posY,
- 0.4 + rotZ + posZ, umax, vmin);
+ height + topHeight + posY,
+ 0.5 + rotZ + rotZ + posZ, umax, vmax);
+ tessellator.addVertexWithUV(0.4 - rotX + posX,
+ height + posY, 0.4 + rotZ + posZ, umax,
+ vmin);
// Top +X
- tessellator.addVertexWithUV(0.6 - rotX + posX, height + posY,
- 0.4 + rotZ + posZ, umin, vmin);
+ tessellator.addVertexWithUV(0.6 - rotX + posX,
+ height + posY, 0.4 + rotZ + posZ, umin,
+ vmin);
tessellator.addVertexWithUV(0.5 - rotX - rotX + posX,
- height + topHeight + posY, 0.5 + rotZ + rotZ + posZ, umin,
- vmax);
+ height + topHeight + posY,
+ 0.5 + rotZ + rotZ + posZ, umin, vmax);
tessellator.addVertexWithUV(0.5 - rotX - rotX + posX,
- height + topHeight + posY, 0.5 + rotZ + rotZ + posZ, umax,
- vmax);
- tessellator.addVertexWithUV(0.6 - rotX + posX, height + posY,
- 0.6 + rotZ + posZ, umax, vmin);
+ height + topHeight + posY,
+ 0.5 + rotZ + rotZ + posZ, umax, vmax);
+ tessellator.addVertexWithUV(0.6 - rotX + posX,
+ height + posY, 0.6 + rotZ + posZ, umax,
+ vmin);
// Top +Z
- tessellator.addVertexWithUV(0.6 - rotX + posX, height + posY,
- 0.6 + rotZ + posZ, umin, vmin);
+ tessellator.addVertexWithUV(0.6 - rotX + posX,
+ height + posY, 0.6 + rotZ + posZ, umin,
+ vmin);
tessellator.addVertexWithUV(0.5 - rotX - rotX + posX,
- height + topHeight + posY, 0.5 + rotZ + rotZ + posZ, umin,
- vmax);
+ height + topHeight + posY,
+ 0.5 + rotZ + rotZ + posZ, umin, vmax);
tessellator.addVertexWithUV(0.5 - rotX - rotX + posX,
- height + topHeight + posY, 0.5 + rotZ + rotZ + posZ, umax,
- vmax);
- tessellator.addVertexWithUV(0.4 - rotX + posX, height + posY,
- 0.6 + rotZ + posZ, umax, vmin);
+ height + topHeight + posY,
+ 0.5 + rotZ + rotZ + posZ, umax, vmax);
+ tessellator.addVertexWithUV(0.4 - rotX + posX,
+ height + posY, 0.6 + rotZ + posZ, umax,
+ vmin);
// Top -Z
- tessellator.addVertexWithUV(0.4 - rotX + posX, height + posY,
- 0.4 + rotZ + posZ, umin, vmin);
+ tessellator.addVertexWithUV(0.4 - rotX + posX,
+ height + posY, 0.4 + rotZ + posZ, umin,
+ vmin);
tessellator.addVertexWithUV(0.5 - rotX - rotX + posX,
- height + topHeight + posY, 0.5 + rotZ + rotZ + posZ, umin,
- vmax);
+ height + topHeight + posY,
+ 0.5 + rotZ + rotZ + posZ, umin, vmax);
tessellator.addVertexWithUV(0.5 - rotX - rotX + posX,
- height + topHeight + posY, 0.5 + rotZ + rotZ + posZ, umax,
- vmax);
- tessellator.addVertexWithUV(0.6 - rotX + posX, height + posY,
- 0.4 + rotZ + posZ, umax, vmin);
+ height + topHeight + posY,
+ 0.5 + rotZ + rotZ + posZ, umax, vmax);
+ tessellator.addVertexWithUV(0.6 - rotX + posX,
+ height + posY, 0.4 + rotZ + posZ, umax,
+ vmin);
// Bottom
tessellator.addVertexWithUV(0.4 + rotX + posX, 0.0 + posY,
0.6 - rotZ + posZ, umin, vmin);
diff --git a/src/main/java/darkknight/jewelrycraft/client/AbstractTab.java b/src/main/java/darkknight/jewelrycraft/client/AbstractTab.java index 66c3329..0db57c7 100755 --- a/src/main/java/darkknight/jewelrycraft/client/AbstractTab.java +++ b/src/main/java/darkknight/jewelrycraft/client/AbstractTab.java @@ -18,12 +18,13 @@ import net.minecraft.util.ResourceLocation; */
@SideOnly(Side.CLIENT)
public abstract class AbstractTab extends GuiButton {
- ResourceLocation texture = new ResourceLocation(
+ ResourceLocation texture = new ResourceLocation(
Variables.MODID, "textures/gui/hearts.png");
- ItemStack renderStack;
- RenderItem itemRenderer = new RenderItem();
+ ItemStack renderStack;
+ RenderItem itemRenderer = new RenderItem();
- public AbstractTab(int id, int posX, int posY, ItemStack renderStack) {
+ public AbstractTab(int id, int posX, int posY,
+ ItemStack renderStack) {
super(id, posX, posY, 18, 18, "");
this.renderStack = renderStack;
}
@@ -35,8 +36,9 @@ public abstract class AbstractTab extends GuiButton { int xOffset = this.enabled ? 0 : 8;
mc.renderEngine.bindTexture(this.texture);
- this.drawTexturedModalRect(this.xPosition, yPosition,
- 144 + xOffset, 32, 18, 18);
+ this.drawTexturedModalRect(this.xPosition,
+ yPosition, 144 + xOffset, 32, 18,
+ 18);
GL11.glPushMatrix();
RenderHelper.enableGUIStandardItemLighting();
@@ -44,11 +46,13 @@ public abstract class AbstractTab extends GuiButton { this.itemRenderer.zLevel = 100.0F;
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
- this.itemRenderer.renderItemAndEffectIntoGUI(mc.fontRenderer,
- mc.renderEngine, renderStack, xPosition + 1,
+ this.itemRenderer.renderItemAndEffectIntoGUI(
+ mc.fontRenderer, mc.renderEngine,
+ renderStack, xPosition + 1,
yPosition + 1);
- this.itemRenderer.renderItemOverlayIntoGUI(mc.fontRenderer,
- mc.renderEngine, renderStack, xPosition + 1,
+ this.itemRenderer.renderItemOverlayIntoGUI(
+ mc.fontRenderer, mc.renderEngine,
+ renderStack, xPosition + 1,
yPosition + 1);
GL11.glDisable(GL11.GL_LIGHTING);
this.itemRenderer.zLevel = 0.0F;
@@ -61,7 +65,8 @@ public abstract class AbstractTab extends GuiButton { @Override
public boolean mousePressed(Minecraft mc, int mouseX, int mouseY) {
boolean inWindow = this.enabled && this.visible
- && mouseX >= this.xPosition && mouseY >= this.yPosition
+ && mouseX >= this.xPosition
+ && mouseY >= this.yPosition
&& mouseX < this.xPosition + this.width
&& mouseY < this.yPosition + this.height;
if (inWindow)
diff --git a/src/main/java/darkknight/jewelrycraft/client/JewelryInventory.java b/src/main/java/darkknight/jewelrycraft/client/JewelryInventory.java index 6baf8ad..6571634 100755 --- a/src/main/java/darkknight/jewelrycraft/client/JewelryInventory.java +++ b/src/main/java/darkknight/jewelrycraft/client/JewelryInventory.java @@ -20,11 +20,11 @@ public class JewelryInventory implements IInventory { */
public JewelryInventory(EntityPlayer player) {
this.player = player;
- NBTTagCompound nbt = PlayerUtils.getModPlayerPersistTag(player,
- Variables.MODID);
+ NBTTagCompound nbt = PlayerUtils.getModPlayerPersistTag(
+ player, Variables.MODID);
for (int i = 0; i < 18; i++)
- inventory[i] = ItemStack
- .loadItemStackFromNBT(nbt.getCompoundTag("ext" + i));
+ inventory[i] = ItemStack.loadItemStackFromNBT(
+ nbt.getCompoundTag("ext" + i));
}
/**
@@ -79,7 +79,8 @@ public class JewelryInventory implements IInventory { @Override
public void setInventorySlotContents(int slot, ItemStack stack) {
inventory[slot] = stack;
- if (stack != null && stack.stackSize > getInventoryStackLimit())
+ if (stack != null
+ && stack.stackSize > getInventoryStackLimit())
stack.stackSize = getInventoryStackLimit();
markDirty();
}
@@ -113,12 +114,13 @@ public class JewelryInventory implements IInventory { */
@Override
public void markDirty() {
- NBTTagCompound nbt = PlayerUtils.getModPlayerPersistTag(player,
- Variables.MODID);
+ NBTTagCompound nbt = PlayerUtils.getModPlayerPersistTag(
+ player, Variables.MODID);
for (int i = 0; i < 18; i++)
if (inventory[i] != null)
nbt.setTag("ext" + i, inventory[i]
- .writeToNBT(nbt.getCompoundTag("ext" + i)));
+ .writeToNBT(nbt.getCompoundTag(
+ "ext" + i)));
else
nbt.removeTag("ext" + i);
}
@@ -155,7 +157,8 @@ public class JewelryInventory implements IInventory { */
@Override
public boolean isItemValidForSlot(int slot, ItemStack stack) {
- if (slot >= 0 && slot <= 9 && stack.getItem() instanceof ItemRing)
+ if (slot >= 0 && slot <= 9
+ && stack.getItem() instanceof ItemRing)
return true;
else if (slot >= 10 && slot <= 13
&& stack.getItem() instanceof ItemBracelet)
@@ -163,7 +166,8 @@ public class JewelryInventory implements IInventory { else if (slot >= 14 && slot <= 16
&& stack.getItem() instanceof ItemNecklace)
return true;
- else if (slot == 17 && stack.getItem() instanceof ItemEarrings)
+ else if (slot == 17
+ && stack.getItem() instanceof ItemEarrings)
return true;
return false;
}
diff --git a/src/main/java/darkknight/jewelrycraft/client/Page.java b/src/main/java/darkknight/jewelrycraft/client/Page.java index f3fcec9..4d67c81 100755 --- a/src/main/java/darkknight/jewelrycraft/client/Page.java +++ b/src/main/java/darkknight/jewelrycraft/client/Page.java @@ -17,54 +17,77 @@ public class Page { Variables.MODID, "textures/gui/guidePageFlip.png");
public static void addCraftingRecipeTextPage(GuiGuide gui, int x,
- int y, boolean isSmall, String text, int mouseX, int mouseY,
- boolean rotate, ItemStack... items) {
+ int y, boolean isSmall, String text, int mouseX,
+ int mouseY, boolean rotate, ItemStack... items) {
y += 5;
GL11.glEnable(GL11.GL_BLEND);
- GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
- gui.getFont().drawString(
- EnumChatFormatting.DARK_BLUE + "\u00a7n"
- + items[0].getDisplayName(),
+ GL11.glBlendFunc(GL11.GL_SRC_ALPHA,
+ GL11.GL_ONE_MINUS_SRC_ALPHA);
+ gui.getFont().drawString(EnumChatFormatting.DARK_BLUE
+ + "\u00a7n" + items[0].getDisplayName(),
x + Math.abs(70 - gui.getFont()
- .getStringWidth(items[0].getDisplayName()) / 2)
- - 10,
+ .getStringWidth(items[0]
+ .getDisplayName())
+ / 2) - 10,
y - 2, 0);
GL11.glColor4f(1, 1, 1, 1);
Minecraft.getMinecraft().getTextureManager()
.bindTexture(pageFlipped);
ArrayList<String> name = new ArrayList<>();
if (isSmall) {
- gui.drawTexturedModalRect(x, y + 10, 145, 54, 111, 46);
- gui.renderItem(items[0], x + 89, y + 22 + 10, 30f, rotate, 0,
- 0, 0);
+ gui.drawTexturedModalRect(x, y + 10, 145, 54, 111,
+ 46);
+ gui.renderItem(items[0], x + 89, y + 22 + 10, 30f,
+ rotate, 0, 0, 0);
for (int i = 1; i <= 4; i++)
if (items.length > i && items[i] != null) {
- int posX = x + 8 + (i - 1) % 2 * 22;
- int posY = y + 26 + (i - 1) / 2 * 22;
- gui.renderItem(items[i], posX, posY, 30f, rotate, 0, 0,
- 0);
- name.add(items[i].getDisplayName());
- if (mouseX >= posX - 8 && mouseX <= posX + 8
- && mouseY >= posY - 16 && mouseY <= posY)
- gui.drawHoverString(name, posX - 20, posY - 14);
+ int posX = x + 8 + (i - 1) % 2
+ * 22;
+ int posY = y + 26
+ + (i - 1) / 2 * 22;
+ gui.renderItem(items[i], posX,
+ posY, 30f, rotate,
+ 0, 0, 0);
+ name.add(items[i]
+ .getDisplayName());
+ if (mouseX >= posX - 8
+ && mouseX <= posX
+ + 8
+ && mouseY >= posY
+ - 16
+ && mouseY <= posY)
+ gui.drawHoverString(name,
+ posX - 20,
+ posY - 14);
name.removeAll(name);
GL11.glDisable(GL11.GL_LIGHTING);
}
drawText(gui, text, x, y + 25);
} else {
- gui.drawTexturedModalRect(x, y + 12, 145, 0, 111, 54);
- gui.renderItem(items[0], x + 91, y + 28 + 10, 30f, rotate, 0,
- 0, 0);
+ gui.drawTexturedModalRect(x, y + 12, 145, 0, 111,
+ 54);
+ gui.renderItem(items[0], x + 91, y + 28 + 10, 30f,
+ rotate, 0, 0, 0);
for (int i = 1; i <= 9; i++)
if (items.length > i && items[i] != null) {
- int posX = x + 8 + (i - 1) % 3 * 19;
- int posY = y + 22 + (i - 1) / 3 * 17;
- gui.renderItem(items[i], posX, posY, 30f, rotate, 0, 0,
- 0);
- name.add(items[i].getDisplayName());
- if (mouseX >= posX - 8 && mouseX <= posX + 8
- && mouseY >= posY - 10 && mouseY <= posY)
- gui.drawHoverString(name, posX - 20, posY - 12);
+ int posX = x + 8 + (i - 1) % 3
+ * 19;
+ int posY = y + 22
+ + (i - 1) / 3 * 17;
+ gui.renderItem(items[i], posX,
+ posY, 30f, rotate,
+ 0, 0, 0);
+ name.add(items[i]
+ .getDisplayName());
+ if (mouseX >= posX - 8
+ && mouseX <= posX
+ + 8
+ && mouseY >= posY
+ - 10
+ && mouseY <= posY)
+ gui.drawHoverString(name,
+ posX - 20,
+ posY - 12);
name.removeAll(name);
GL11.glDisable(GL11.GL_LIGHTING);
}
@@ -75,65 +98,73 @@ public class Page { }
public static void addSmeltingRecipeTextPage(GuiGuide gui, int x,
- int y, String text, int mouseX, int mouseY, boolean rotate,
- ItemStack... items) {
+ int y, String text, int mouseX, int mouseY,
+ boolean rotate, ItemStack... items) {
ArrayList<String> name = new ArrayList<>();
- gui.getFont().drawString(
- EnumChatFormatting.DARK_BLUE + "\u00a7n"
- + items[1].getDisplayName(),
- x + 30 - items[0].getDisplayName().length() / 2, y + 2, 0);
+ gui.getFont().drawString(EnumChatFormatting.DARK_BLUE
+ + "\u00a7n" + items[1].getDisplayName(),
+ x + 30 - items[0].getDisplayName().length()
+ / 2,
+ y + 2, 0);
GL11.glColor4f(1, 1, 1, 1);
Minecraft.getMinecraft().getTextureManager()
.bindTexture(pageFlipped);
GL11.glEnable(GL11.GL_BLEND);
- GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
+ GL11.glBlendFunc(GL11.GL_SRC_ALPHA,
+ GL11.GL_ONE_MINUS_SRC_ALPHA);
gui.drawTexturedModalRect(x, y + 10, 145, 100, 111, 52);
- gui.renderItem(items[0], x + 13, y + 20 + 10, 35f, rotate, 0, 0,
- 0);
+ gui.renderItem(items[0], x + 13, y + 20 + 10, 35f, rotate,
+ 0, 0, 0);
name.add(items[0].getDisplayName());
if (mouseX >= x && mouseX <= x + 20 && mouseY >= y + 20
&& mouseY <= y + 20 + 16)
gui.drawHoverString(name, x, y + 20);
name.removeAll(name);
GL11.glDisable(GL11.GL_LIGHTING);
- gui.renderItem(items[1], x + 77, y + 28 + 10, 35f, rotate, 0, 0,
- 0);
+ gui.renderItem(items[1], x + 77, y + 28 + 10, 35f, rotate,
+ 0, 0, 0);
drawText(gui, text, x, y + 30);
GL11.glColor4f(1, 1, 1, 1);
GL11.glDisable(GL11.GL_BLEND);
}
public static void addImageTextPage(GuiGuide gui, int x, int y,
- ItemStack item, String text, float size, boolean rotate) {
+ ItemStack item, String text, float size,
+ boolean rotate) {
y += 5;
GL11.glEnable(GL11.GL_BLEND);
- GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
- gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n"
- + item.getDisplayName(),
- x
- + Math.abs(70 - gui.getFont()
- .getStringWidth(item.getDisplayName()) / 2)
- - 10,
+ GL11.glBlendFunc(GL11.GL_SRC_ALPHA,
+ GL11.GL_ONE_MINUS_SRC_ALPHA);
+ gui.getFont().drawString(
+ EnumChatFormatting.DARK_BLUE + "\u00a7n"
+ + item.getDisplayName(),
+ x + Math.abs(70 - gui.getFont()
+ .getStringWidth(item
+ .getDisplayName())
+ / 2) - 10,
y + (int) size / 5, 0);
GL11.glColor4f(1, 1, 1, 1);
- gui.renderItem(item, x + 13, y + 18, size, rotate, 0, 0, 0);
+ gui.renderItem(item, x + 13, y + 18, size, rotate, 0, 0,
+ 0);
drawText(gui, text, x - 2, y - (int) (250 / size));
GL11.glDisable(GL11.GL_BLEND);
}
- public static void addSlotItem(GuiGuide gui, int x, int y, int mouseX,
- int mouseY, ItemStack item, float xRot, float yRot,
- float zRot) {
+ public static void addSlotItem(GuiGuide gui, int x, int y,
+ int mouseX, int mouseY, ItemStack item, float xRot,
+ float yRot, float zRot) {
ArrayList<String> name = new ArrayList<>();
GL11.glColor4f(1, 1, 1, 1);
Minecraft.getMinecraft().getTextureManager()
.bindTexture(pageFlipped);
GL11.glEnable(GL11.GL_BLEND);
- GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
+ GL11.glBlendFunc(GL11.GL_SRC_ALPHA,
+ GL11.GL_ONE_MINUS_SRC_ALPHA);
gui.drawTexturedModalRect(x + 9, y + 19, 148, 153, 12, 12);
if (item.getItem() != null) {
name.add(item.getDisplayName());
- if (mouseX >= x + 10 && mouseX <= x + 20 && mouseY >= y + 20
+ if (mouseX >= x + 10 && mouseX <= x + 20
+ && mouseY >= y + 20
&& mouseY <= y + 30)
gui.drawHoverString(name, x, y + 10);
name.removeAll(name);
@@ -141,56 +172,63 @@ public class Page { GL11.glDisable(GL11.GL_LIGHTING);
GL11.glColor4f(1, 1, 1, 1);
if (item.getItem() != null)
- gui.renderItem(item, x + 15, y + 25, 40f, false, xRot, yRot,
- zRot);
+ gui.renderItem(item, x + 15, y + 25, 40f, false,
+ xRot, yRot, zRot);
GL11.glDisable(GL11.GL_BLEND);
}
public static void addImageTextPage(GuiGuide gui, int x, int y,
- ItemStack item, String text, float size, int txtX, int txtY,
- boolean showName, int imgX, int imgY, boolean rotate) {
+ ItemStack item, String text, float size, int txtX,
+ int txtY, boolean showName, int imgX, int imgY,
+ boolean rotate) {
y += 5;
GL11.glEnable(GL11.GL_BLEND);
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
- GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
+ GL11.glBlendFunc(GL11.GL_SRC_ALPHA,
+ GL11.GL_ONE_MINUS_SRC_ALPHA);
if (showName)
- gui.getFont()
- .drawString(
- EnumChatFormatting.DARK_BLUE + "\u00a7n"
- + item.getDisplayName().substring(0,
- item.getDisplayName()
- .length() > 23
- ? 23 : item
- .getDisplayName()
- .length()),
- x + Math.abs(70 - gui.getFont().getStringWidth(
- item.getDisplayName()) / 2) - 10,
- y + 2, 0);
+ gui.getFont().drawString(
+ EnumChatFormatting.DARK_BLUE
+ + "\u00a7n"
+ + item.getDisplayName()
+ .substring(0, item
+ .getDisplayName()
+ .length() > 23 ? 23
+ : item.getDisplayName()
+ .length()),
+ x + Math.abs(70 - gui.getFont()
+ .getStringWidth(item
+ .getDisplayName())
+ / 2) - 10,
+ y + 2, 0);
GL11.glColor4f(1, 1, 1, 1);
- gui.renderItem(item, x + 13 + imgX, y + 18 + imgY, size, rotate, 0,
- 0, 0);
+ gui.renderItem(item, x + 13 + imgX, y + 18 + imgY, size,
+ rotate, 0, 0, 0);
drawText(gui, text, x + txtX, y + txtY);
GL11.glDisable(GL11.GL_BLEND);
}
public static void addImageTextPage(GuiGuide gui, int x, int y,
- ItemStack item, String text, float size, int txtX, int txtY,
- String title, int imgX, int imgY, boolean rotate) {
+ ItemStack item, String text, float size, int txtX,
+ int txtY, String title, int imgX, int imgY,
+ boolean rotate) {
y += 5;
GL11.glEnable(GL11.GL_BLEND);
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
- GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
- gui.getFont().drawString(
- EnumChatFormatting.DARK_BLUE + "\u00a7n"
- + title.substring(0,
- item.getDisplayName().length() > 23 ? 23
- : title.length()),
- x + Math.abs(70 - gui.getFont().getStringWidth(title) / 2)
+ GL11.glBlendFunc(GL11.GL_SRC_ALPHA,
+ GL11.GL_ONE_MINUS_SRC_ALPHA);
+ gui.getFont().drawString(EnumChatFormatting.DARK_BLUE
+ + "\u00a7n"
+ + title.substring(0, item.getDisplayName()
+ .length() > 23 ? 23
+ : title.length()),
+ x + Math.abs(70 - gui.getFont()
+ .getStringWidth(title) / 2)
- 10,
y + 2, 0);
GL11.glColor4f(1, 1, 1, 1);
- gui.renderItem(item, x + 13 + imgX, y + 18 + imgY, size, rotate, 0,
- 0, 0);
+ gui.renderItem(item, x + 13 + imgX, y + 18 + imgY, size,
+ rotate, 0, 0, 0);
drawText(gui, text, x + txtX, y + txtY);
GL11.glDisable(GL11.GL_BLEND);
}
@@ -202,7 +240,8 @@ public class Page { GL11.glColor4f(1, 1, 1, 1);
}
- public static void drawText(GuiGuide gui, String text, int x, int y) {
+ public static void drawText(GuiGuide gui, String text, int x,
+ int y) {
String[] s = text.split(" ");
String displayText = "";
float scale = 0.75F;
@@ -218,8 +257,10 @@ public class Page { for (int i = 0; i < textLines.size(); i++) {
GL11.glPushMatrix();
GL11.glScalef(scale, scale, 0f);
- gui.getFont().drawString(textLines.get(i), (int) (x / scale),
- (int) ((y + 32 + i * 9) / scale), 0);
+ gui.getFont().drawString(textLines.get(i),
+ (int) (x / scale),
+ (int) ((y + 32 + i * 9) / scale),
+ 0);
GL11.glPopMatrix();
}
}
diff --git a/src/main/java/darkknight/jewelrycraft/client/TabRegistry.java b/src/main/java/darkknight/jewelrycraft/client/TabRegistry.java index 21d8b9c..9b30274 100755 --- a/src/main/java/darkknight/jewelrycraft/client/TabRegistry.java +++ b/src/main/java/darkknight/jewelrycraft/client/TabRegistry.java @@ -36,36 +36,45 @@ public class TabRegistry { int ySize = 166;
int guiLeft = (event.gui.width - xSize) / 2;
int guiTop = (event.gui.height - ySize) / 2;
- if (!mc.thePlayer.getActivePotionEffects().isEmpty())
+ if (!mc.thePlayer.getActivePotionEffects()
+ .isEmpty())
if (Loader.isModLoaded("NotEnoughItems")) {
try {
- // Check whether NEI is hidden and enabled
+ // Check whether NEI is
+ // hidden and enabled
Class<?> c = Class.forName(
"codechicken.nei.NEIClientConfig");
- Object hidden =
- c.getMethod("isHidden").invoke(null);
- Object enabled =
- c.getMethod("isEnabled").invoke(null);
- if (hidden != null && hidden instanceof Boolean
+ Object hidden = c
+ .getMethod("isHidden")
+ .invoke(null);
+ Object enabled = c
+ .getMethod("isEnabled")
+ .invoke(null);
+ if (hidden != null
+ && hidden instanceof Boolean
&& enabled != null
&& enabled instanceof Boolean)
- if ((Boolean) hidden || !((Boolean) enabled))
+ if ((Boolean) hidden
+ || !((Boolean) enabled))
guiLeft += 60;
} catch (Exception e) {
// Do nothing
}
} else
guiLeft += 60;
- updateTabValues(guiLeft, guiTop, InventoryTabVanilla.class);
+ updateTabValues(guiLeft, guiTop,
+ InventoryTabVanilla.class);
addTabsToList(event.buttonList);
}
}
- private static Minecraft mc = FMLClientHandler.instance().getClient();
+ private static Minecraft mc = FMLClientHandler.instance()
+ .getClient();
public static void openInventoryGui() {
- mc.thePlayer.sendQueue.addToSendQueue(new C0DPacketCloseWindow(
- mc.thePlayer.openContainer.windowId));
+ mc.thePlayer.sendQueue
+ .addToSendQueue(new C0DPacketCloseWindow(
+ mc.thePlayer.openContainer.windowId));
GuiInventory inventory = new GuiInventory(mc.thePlayer);
mc.displayGuiScreen(inventory);
}
@@ -76,17 +85,22 @@ public class TabRegistry { for (int i = 0; i < tabList.size(); i++) {
AbstractTab t = tabList.get(i);
if (t.shouldAddToList()) {
- if (selectedButton.equals(TabCurses.class)) {
+ if (selectedButton
+ .equals(TabCurses.class)) {
t.xPosition = cornerX + 195;
t.yPosition = cornerY + count * 20;
- } else if (selectedButton.equals(TabJewelry.class)) {
- t.xPosition = cornerX + 140 + count * 20;
+ } else if (selectedButton.equals(
+ TabJewelry.class)) {
+ t.xPosition = cornerX + 140
+ + count * 20;
t.yPosition = cornerY + 64;
} else {
- t.xPosition = cornerX + 131 + count * 20;
+ t.xPosition = cornerX + 131
+ + count * 20;
t.yPosition = cornerY + 64;
}
- t.enabled = !t.getClass().equals(selectedButton);
+ t.enabled = !t.getClass()
+ .equals(selectedButton);
if (t.enabled)
count++;
}
diff --git a/src/main/java/darkknight/jewelrycraft/client/gui/GuiCurseInfo.java b/src/main/java/darkknight/jewelrycraft/client/gui/GuiCurseInfo.java index acd1a69..0c833ec 100755 --- a/src/main/java/darkknight/jewelrycraft/client/gui/GuiCurseInfo.java +++ b/src/main/java/darkknight/jewelrycraft/client/gui/GuiCurseInfo.java @@ -25,11 +25,11 @@ import net.minecraft.util.ResourceLocation; import net.minecraft.world.World;
public class GuiCurseInfo extends GuiContainer {
- World world;
+ World world;
EntityPlayer player;
ResourceLocation texture;
- int page = 0, maxPages = 1;
- String selectedCurse = "";
+ int page = 0, maxPages = 1;
+ String selectedCurse = "";
public GuiCurseInfo(Container container, World world,
EntityPlayer player, ResourceLocation texture) {
@@ -50,47 +50,59 @@ public class GuiCurseInfo extends GuiContainer { public void drawGuiContainerBackgroundLayer(float f, int mouseX,
int mouseY) {
GL11.glColor3f(1, 1, 1);
- Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
+ Minecraft.getMinecraft().getTextureManager()
+ .bindTexture(texture);
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
if (player != null) {
NBTTagCompound playerInfo = PlayerUtils
- .getModPlayerPersistTag(player, Variables.MODID);
+ .getModPlayerPersistTag(player,
+ Variables.MODID);
if (!player.capabilities.isCreativeMode)
- maxPages = playerInfo.getInteger("activeCurses") / 5
- - (playerInfo.getInteger("activeCurses") % 5 == 0
- ? 1 : 0);
+ maxPages = playerInfo.getInteger(
+ "activeCurses") / 5
+ - (playerInfo.getInteger(
+ "activeCurses")
+ % 5 == 0 ? 1
+ : 0);
else
maxPages = Curse.getCurseList().size() / 5
- - (Curse.getCurseList().size() % 5 == 0 ? 1 : 0);
+ - (Curse.getCurseList()
+ .size()
+ % 5 == 0 ? 1
+ : 0);
if (!player.capabilities.isCreativeMode)
survivalCurses(playerInfo);
else
creativeCurses(playerInfo);
if (playerInfo.hasKey("cursePoints"))
this.drawString(fontRendererObj,
- "Curse points: "
- + playerInfo.getInteger("cursePoints")
+ "Curse points: " + playerInfo
+ .getInteger("cursePoints")
+ " | Active curses: "
- + playerInfo.getInteger("activeCurses"),
- guiLeft, guiTop - 10, 0xffffff);
+ + playerInfo.getInteger(
+ "activeCurses"),
+ guiLeft, guiTop - 10,
+ 0xffffff);
}
- Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
- drawTexturedModalRect(guiLeft + 5, guiTop + ySize - 14, 0, ySize,
- 13, 11);
- drawTexturedModalRect(guiLeft + xSize - 38, guiTop + ySize - 14,
- 13, ySize, 13, 11);
- this.drawString(fontRendererObj, (page + 1) + "/" + (maxPages + 1),
+ Minecraft.getMinecraft().getTextureManager()
+ .bindTexture(texture);
+ drawTexturedModalRect(guiLeft + 5, guiTop + ySize - 14, 0,
+ ySize, 13, 11);
+ drawTexturedModalRect(guiLeft + xSize - 38,
+ guiTop + ySize - 14, 13, ySize, 13, 11);
+ this.drawString(fontRendererObj,
+ (page + 1) + "/" + (maxPages + 1),
guiLeft + 90, guiTop + 153, 0xffffff);
this.drawString(fontRendererObj,
- "Click on an active curse to see its description", guiLeft,
- guiTop + 170, 0xffffff);
+ "Click on an active curse to see its description",
+ guiLeft, guiTop + 170, 0xffffff);
if (player.capabilities.isCreativeMode) {
- drawText(this,
- "To enable or disable a curse simply hold the CTRL key and click on one.",
- guiLeft - 100, guiTop, 20, 0xff0000);
- drawText(this,
- "If you do not have any curse points you need to type the command '/jw addCursePoints [playerUsername] [no of curse points]'. If you don't do this any curse you activate won't have any effect.",
- guiLeft - 100, guiTop + 50, 20, 0xff0000);
+ drawText(this, "To enable or disable a curse simply hold the CTRL key and click on one.",
+ guiLeft - 100, guiTop, 20,
+ 0xff0000);
+ drawText(this, "If you do not have any curse points you need to type the command '/jw addCursePoints [playerUsername] [no of curse points]'. If you don't do this any curse you activate won't have any effect.",
+ guiLeft - 100, guiTop + 50, 20,
+ 0xff0000);
}
}
@@ -100,7 +112,8 @@ public class GuiCurseInfo extends GuiContainer { String displayText = "";
ArrayList<String> textLines = new ArrayList<>();
for (String element : s)
- if ((displayText + element + " ").length() <= characters)
+ if ((displayText + element + " ")
+ .length() <= characters)
displayText += element + " ";
else {
textLines.add(displayText.trim());
@@ -108,8 +121,8 @@ public class GuiCurseInfo extends GuiContainer { }
textLines.add(displayText.trim());
for (int i = 0; i < textLines.size(); i++)
- gui.drawString(gui.getFont(), textLines.get(i), x, y + i * 9,
- color);
+ gui.drawString(gui.getFont(), textLines.get(i), x,
+ y + i * 9, color);
}
public FontRenderer getFont() {
@@ -121,81 +134,129 @@ public class GuiCurseInfo extends GuiContainer { int ind = 0;
if (!playerInfo.hasNoTags()) {
for (Curse curse : Curse.getCurseList()) {
- if (playerInfo.getInteger(curse.getName()) > 0) {
- if (ind >= page * 5 && ind < (page + 1) * 5) {
- if (ind == page * 5 && selectedCurse == "")
- selectedCurse = curse.getName();
- mc.renderEngine
- .bindTexture(Variables.MISC_TEXTURE);
- drawTexturedModalRect(guiLeft + 43,
- guiTop + 8 + (size - 8) * (ind - page * 5),
- 0, 32, 112, 22);
- if (selectedCurse == curse.getName()) {
+ if (playerInfo.getInteger(
+ curse.getName()) > 0) {
+ if (ind >= page * 5 && ind < (page
+ + 1) * 5) {
+ if (ind == page * 5
+ && selectedCurse == "")
+ selectedCurse = curse
+ .getName();
+ mc.renderEngine.bindTexture(
+ Variables.MISC_TEXTURE);
+ drawTexturedModalRect(
+ guiLeft + 43,
+ guiTop + 8 + (size
+ - 8)
+ * (ind - page * 5),
+ 0, 32, 112,
+ 22);
+ if (selectedCurse == curse
+ .getName()) {
GL11.glPushMatrix();
- GL11.glScalef(1.2f, 1.5f, 0f);
+ GL11.glScalef(1.2f,
+ 1.5f,
+ 0f);
drawTexturedModalRect(
- (int) (guiLeft / (1.2)) + 126,
- (int) (guiTop / (1.5)) + 7
- + (size - 16)
- * (ind - page * 5),
- 48, 16, 32, 16);
+ (int) (guiLeft / (1.2))
+ + 126,
+ (int) (guiTop / (1.5))
+ + 7
+ + (size - 16) * (ind
+ - page * 5),
+ 48,
+ 16,
+ 32,
+ 16);
drawTexturedModalRect(
- (int) (guiLeft / (1.2)) + 5,
- (int) (guiTop / (1.5)) + 7
- + (size - 16)
- * (ind - page * 5),
- 80, 16, 32, 16);
+ (int) (guiLeft / (1.2))
+ + 5,
+ (int) (guiTop / (1.5))
+ + 7
+ + (size - 16) * (ind
+ - page * 5),
+ 80,
+ 16,
+ 32,
+ 16);
GL11.glPopMatrix();
GL11.glPushMatrix();
List<?> descr = fontRendererObj
.listFormattedStringToWidth(
- curse.getDescription(), 238);
- GL11.glScalef(0.75F, 0.75F, 0F);
- for (int i = 0; i < descr.size(); i++)
+ curse.getDescription(),
+ 238);
+ GL11.glScalef(0.75F,
+ 0.75F,
+ 0F);
+ for (int i = 0; i < descr
+ .size(); i++)
this.drawString(fontRendererObj,
descr.get(i).toString(),
- (int) (guiLeft / 0.75F) + 12,
- (int) (guiTop / 0.75F) + 184
+ (int) (guiLeft / 0.75F)
+ + 12,
+ (int) (guiTop / 0.75F)
+ + 184
+ i * 12
- - (descr.size() > 1 ? 6
+ - (descr.size() > 1
+ ? 6
: 0),
0xffffff);
GL11.glPopMatrix();
}
- if (playerInfo.getInteger(curse.getName()) == 2) {
- mc.renderEngine
- .bindTexture(Variables.MISC_TEXTURE);
+ if (playerInfo.getInteger(
+ curse.getName()) == 2) {
+ mc.renderEngine.bindTexture(
+ Variables.MISC_TEXTURE);
GL11.glPushMatrix();
GL11.glEnable(GL11.GL_BLEND);
- GL11.glBlendFunc(GL11.GL_SRC_ALPHA,
+ GL11.glBlendFunc(
+ GL11.GL_SRC_ALPHA,
GL11.GL_ONE_MINUS_SRC_ALPHA);
- GL11.glColor4f(1f, 1f, 1f, 0.5f);
- drawTexturedModalRect(guiLeft + 134,
- guiTop + 11
- + (size - 8)
- * (ind - page * 5),
- 3 * 16, 0, 16, 16);
+ GL11.glColor4f(1f,
+ 1f,
+ 1f,
+ 0.5f);
+ drawTexturedModalRect(
+ guiLeft + 134,
+ guiTop + 11 + (size
+ - 8)
+ * (ind - page * 5),
+ 3 * 16,
+ 0,
+ 16,
+ 16);
GL11.glDisable(GL11.GL_BLEND);
GL11.glPopMatrix();
}
mc.renderEngine.bindTexture(
- new ResourceLocation(Variables.MODID,
- "textures/gui/"
- + curse.getTexturePack()
+ new ResourceLocation(
+ Variables.MODID,
+ "textures/gui/" + curse
+ .getTexturePack()
+ ".png"));
int tag = curse.getTextureID();
GL11.glPushMatrix();
- GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+ GL11.glColor4f(1.0F, 1.0F,
+ 1.0F,
+ 1.0F);
GL11.glDisable(GL11.GL_LIGHTING);
- GL11.glScalef(0.5f, 0.5f, 0.0f);
- drawTexturedModalRect(guiLeft * 2 + 100,
- guiTop * 2 + 22 + (ind - page * 5) * 48,
- tag % 8 * 32, tag / 8 * 32, 32, 32);
+ GL11.glScalef(0.5f, 0.5f,
+ 0.0f);
+ drawTexturedModalRect(
+ guiLeft * 2 + 100,
+ guiTop * 2 + 22 + (ind
+ - page * 5)
+ * 48,
+ tag % 8 * 32,
+ tag / 8 * 32,
+ 32, 32);
GL11.glPopMatrix();
this.drawString(fontRendererObj,
- curse.getDisplayName(), guiLeft + 70,
- guiTop + 15
- + (ind - page * 5) * (size - 8),
+ curse.getDisplayName(),
+ guiLeft + 70,
+ guiTop + 15 + (ind
+ - page * 5)
+ * (size - 8),
0xffffff);
}
ind++;
@@ -211,68 +272,103 @@ public class GuiCurseInfo extends GuiContainer { if (ind >= page * 5 && ind < (page + 1) * 5) {
if (ind == page * 5 && selectedCurse == "")
selectedCurse = curse.getName();
- if (playerInfo.getInteger(curse.getName()) <= 0) {
+ if (playerInfo.getInteger(
+ curse.getName()) <= 0) {
GL11.glPushMatrix();
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA,
GL11.GL_ONE_MINUS_SRC_ALPHA);
if (!curse.canCurseBeActivated()
|| !ConfigHandler.CURSES_ENABLED)
- GL11.glColor4f(1f, 0f, 0f, 0.5f);
+ GL11.glColor4f(1f, 0f, 0f,
+ 0.5f);
else
- GL11.glColor4f(1f, 1f, 1f, 0.5f);
+ GL11.glColor4f(1f, 1f, 1f,
+ 0.5f);
}
- mc.renderEngine.bindTexture(Variables.MISC_TEXTURE);
- drawTexturedModalRect(guiLeft + 43,
- guiTop + 8 + (size - 8) * (ind - page * 5), 0, 32,
- 112, 22);
+ mc.renderEngine.bindTexture(
+ Variables.MISC_TEXTURE);
+ drawTexturedModalRect(guiLeft + 43, guiTop
+ + 8
+ + (size - 8) * (ind - page
+ * 5),
+ 0, 32, 112, 22);
if (selectedCurse == curse.getName()) {
GL11.glPushMatrix();
GL11.glScalef(1.2f, 1.5f, 0f);
- drawTexturedModalRect((int) (guiLeft / (1.2)) + 126,
- (int) (guiTop / (1.5)) + 7
- + (size - 16) * (ind - page * 5),
+ drawTexturedModalRect(
+ (int) (guiLeft / (1.2))
+ + 126,
+ (int) (guiTop / (1.5))
+ + 7
+ + (size - 16) * (ind
+ - page * 5),
48, 16, 32, 16);
- drawTexturedModalRect((int) (guiLeft / (1.2)) + 5,
- (int) (guiTop / (1.5)) + 7
- + (size - 16) * (ind - page * 5),
+ drawTexturedModalRect(
+ (int) (guiLeft / (1.2))
+ + 5,
+ (int) (guiTop / (1.5))
+ + 7
+ + (size - 16) * (ind
+ - page * 5),
80, 16, 32, 16);
GL11.glPopMatrix();
GL11.glPushMatrix();
- List<?> descr =
- fontRendererObj.listFormattedStringToWidth(
- curse.getDescription(), 238);
+ List<?> descr = fontRendererObj
+ .listFormattedStringToWidth(
+ curse.getDescription(),
+ 238);
GL11.glScalef(0.75F, 0.75F, 0F);
- for (int i = 0; i < descr.size(); i++)
+ for (int i = 0; i < descr
+ .size(); i++)
this.drawString(fontRendererObj,
descr.get(i).toString(),
- (int) (guiLeft / 0.75F) + 12,
- (int) (guiTop / 0.75F) + 184 + i * 12
- - (descr.size() > 1 ? 6 : 0),
+ (int) (guiLeft / 0.75F)
+ + 12,
+ (int) (guiTop / 0.75F)
+ + 184
+ + i * 12
+ - (descr.size() > 1
+ ? 6
+ : 0),
0xffffff);
GL11.glPopMatrix();
}
- mc.renderEngine.bindTexture(new ResourceLocation(
- Variables.MODID, "textures/gui/"
- + curse.getTexturePack() + ".png"));
+ mc.renderEngine.bindTexture(
+ new ResourceLocation(
+ Variables.MODID,
+ "textures/gui/" + curse
+ .getTexturePack()
+ + ".png"));
int tag = curse.getTextureID();
GL11.glPushMatrix();
- if (playerInfo.getInteger(curse.getName()) <= 0)
- GL11.glColor4f(1.0F, 1.0F, 1.0F, 0.5F);
+ if (playerInfo.getInteger(
+ curse.getName()) <= 0)
+ GL11.glColor4f(1.0F, 1.0F, 1.0F,
+ 0.5F);
else
- GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+ GL11.glColor4f(1.0F, 1.0F, 1.0F,
+ 1.0F);
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glScalef(0.5f, 0.5f, 0.0f);
drawTexturedModalRect(guiLeft * 2 + 100,
- guiTop * 2 + 22 + (ind - page * 5) * 48,
- tag % 8 * 32, tag / 8 * 32, 32, 32);
+ guiTop * 2 + 22 + (ind
+ - page * 5)
+ * 48,
+ tag % 8 * 32, tag / 8 * 32,
+ 32, 32);
GL11.glPopMatrix();
- this.drawString(fontRendererObj, curse.getDisplayName(),
+ this.drawString(fontRendererObj,
+ curse.getDisplayName(),
guiLeft + 70,
- guiTop + 15 + (ind - page * 5) * (size - 8),
- playerInfo.getInteger(curse.getName()) > 0
- ? 0xffffffff : 0xaaffffff);
- if (playerInfo.getInteger(curse.getName()) <= 0) {
+ guiTop + 15 + (ind
+ - page * 5)
+ * (size - 8),
+ playerInfo.getInteger(curse
+ .getName()) > 0 ? 0xffffffff
+ : 0xaaffffff);
+ if (playerInfo.getInteger(
+ curse.getName()) <= 0) {
GL11.glDisable(GL11.GL_BLEND);
GL11.glPopMatrix();
}
@@ -282,7 +378,8 @@ public class GuiCurseInfo extends GuiContainer { }
@Override
- public void drawGuiContainerForegroundLayer(int mouseX, int mouseY) {
+ public void drawGuiContainerForegroundLayer(int mouseX,
+ int mouseY) {
// Do nothing
}
@@ -299,7 +396,8 @@ public class GuiCurseInfo extends GuiContainer { int cornerX = guiLeft;
int cornerY = guiTop;
this.buttonList.clear();
- TabRegistry.updateTabValues(cornerX, cornerY, TabCurses.class);
+ TabRegistry.updateTabValues(cornerX, cornerY,
+ TabCurses.class);
TabRegistry.addTabsToList(this.buttonList);
}
@@ -310,70 +408,100 @@ public class GuiCurseInfo extends GuiContainer { int size = 32;
if (player != null) {
NBTTagCompound playerInfo = PlayerUtils
- .getModPlayerPersistTag(player, Variables.MODID);
+ .getModPlayerPersistTag(player,
+ Variables.MODID);
for (Curse curse : Curse.getCurseList()) {
if (player.capabilities.isCreativeMode) {
if (x > (guiLeft + 43)
&& y > (guiTop + 8
- + (size - 8) * (ind - page * 5))
- && x < (guiLeft + 43 + 112)
+ + (size - 8) * (ind
+ - page * 5))
+ && x < (guiLeft + 43
+ + 112)
&& y < (guiTop + 40
- + (size - 8) * (ind - page * 5))
- && ind >= page * 5 && ind < (page + 1) * 5) {
+ + (size - 8) * (ind
+ - page * 5))
+ && ind >= page * 5
+ && ind < (page + 1)
+ * 5) {
if (player.capabilities.isCreativeMode
- && isCtrlKeyDown() && playerInfo
- .getInteger(curse.getName()) > 0) {
- playerInfo.setInteger(curse.getName(), 0);
- playerInfo.setInteger("activeCurses",
- playerInfo.getInteger("activeCurses")
+ && isCtrlKeyDown()
+ && playerInfo.getInteger(
+ curse.getName()) > 0) {
+ playerInfo.setInteger(
+ curse.getName(),
+ 0);
+ playerInfo.setInteger(
+ "activeCurses",
+ playerInfo.getInteger(
+ "activeCurses")
- 1);
- Curse.availableCurses.add(curse);
- JewelrycraftMod.netWrapper.sendToServer(
- new PacketSendServerPlayerInfo(
- "remove", curse.getName(),
+ Curse.availableCurses
+ .add(curse);
+ JewelrycraftMod.netWrapper
+ .sendToServer(new PacketSendServerPlayerInfo(
+ "remove",
+ curse.getName(),
playerInfo));
- JewelrycraftMod.netWrapper.sendToAll(
- new PacketSendServerPlayersInfo());
+ JewelrycraftMod.netWrapper
+ .sendToAll(new PacketSendServerPlayersInfo());
} else if (player.capabilities.isCreativeMode
&& isCtrlKeyDown()
- && playerInfo
- .getInteger(curse.getName()) <= 0
+ && playerInfo.getInteger(
+ curse.getName()) <= 0
&& curse.canCurseBeActivated()
&& ConfigHandler.CURSES_ENABLED) {
- playerInfo.setInteger(curse.getName(), 1);
- playerInfo.setInteger("activeCurses",
- playerInfo.getInteger("activeCurses")
+ playerInfo.setInteger(
+ curse.getName(),
+ 1);
+ playerInfo.setInteger(
+ "activeCurses",
+ playerInfo.getInteger(
+ "activeCurses")
+ 1);
- Curse.availableCurses.remove(curse);
- JewelrycraftMod.netWrapper.sendToServer(
- new PacketSendServerPlayerInfo("add",
- curse.getName(), playerInfo));
- JewelrycraftMod.netWrapper.sendToAll(
- new PacketSendServerPlayersInfo());
+ Curse.availableCurses
+ .remove(curse);
+ JewelrycraftMod.netWrapper
+ .sendToServer(new PacketSendServerPlayerInfo(
+ "add",
+ curse.getName(),
+ playerInfo));
+ JewelrycraftMod.netWrapper
+ .sendToAll(new PacketSendServerPlayersInfo());
} else
- selectedCurse = curse.getName();
+ selectedCurse = curse
+ .getName();
}
ind++;
- } else if (playerInfo.getInteger(curse.getName()) > 0) {
+ } else if (playerInfo.getInteger(
+ curse.getName()) > 0) {
if (x > (guiLeft + 43)
&& y > (guiTop + 8
- + (size - 8) * (ind - page * 5))
- && x < (guiLeft + 43 + 112)
+ + (size - 8) * (ind
+ - page * 5))
+ && x < (guiLeft + 43
+ + 112)
&& y < (guiTop + 40
- + (size - 8) * (ind - page * 5))
- && ind >= page * 5 && ind < (page + 1) * 5)
- selectedCurse = curse.getName();
+ + (size - 8) * (ind
+ - page * 5))
+ && ind >= page * 5
+ && ind < (page + 1)
+ * 5)
+ selectedCurse = curse
+ .getName();
ind++;
}
}
}
if (page > 0 && x > guiLeft + 5 && x < guiLeft + 18
- && y > guiTop + ySize - 14 && y < guiTop + ySize - 3) {
+ && y > guiTop + ySize - 14
+ && y < guiTop + ySize - 3) {
page--;
selectedCurse = "";
}
if (page < maxPages && x > guiLeft + xSize - 38
- && x < guiLeft + xSize - 25 && y > guiTop + ySize - 14
+ && x < guiLeft + xSize - 25
+ && y > guiTop + ySize - 14
&& y < guiTop + ySize - 3) {
page++;
selectedCurse = "";
diff --git a/src/main/java/darkknight/jewelrycraft/client/gui/GuiGuide.java b/src/main/java/darkknight/jewelrycraft/client/gui/GuiGuide.java index a91b5a4..d322761 100755 --- a/src/main/java/darkknight/jewelrycraft/client/gui/GuiGuide.java +++ b/src/main/java/darkknight/jewelrycraft/client/gui/GuiGuide.java @@ -21,22 +21,25 @@ import net.minecraft.util.ResourceLocation; import net.minecraft.world.World;
public class GuiGuide extends GuiContainer {
- public int page, rot, del;
- public boolean prevHover, nextHover;
- World world;
- private final GuiTab[] tabs =
- new GuiTab[] { new GuiTabIntroduction(0), new GuiTabBlocks(1),
- new GuiTabItems(2), new GuiTabGemsAndIngots(3),
- new GuiTabCurses(4), new GuiTabModifiers(5),
- new GuiTabRitual(6) };
- private GuiTab activeTab;
- ResourceLocation pageTexture, flippedPageTexture;
+ public int page, rot, del;
+ public boolean prevHover, nextHover;
+ World world;
+ private final GuiTab[] tabs = new GuiTab[] {
+ new GuiTabIntroduction(0), new GuiTabBlocks(1),
+ new GuiTabItems(2), new GuiTabGemsAndIngots(3),
+ new GuiTabCurses(4), new GuiTabModifiers(5),
+ new GuiTabRitual(6)
+ };
+ private GuiTab activeTab;
+ ResourceLocation pageTexture, flippedPageTexture;
// GUIDE
- public static GuiTab prevActive = new GuiTabIntroduction(0);
- public static int prevPage = 1;
+ public static GuiTab prevActive = new GuiTabIntroduction(
+ 0);
+ public static int prevPage = 1;
public GuiGuide(Container container, World world,
- ResourceLocation pageTex, ResourceLocation flipPageTex) {
+ ResourceLocation pageTex,
+ ResourceLocation flipPageTex) {
super(container);
page = prevPage;
rot = 0;
@@ -49,7 +52,8 @@ public class GuiGuide extends GuiContainer { }
@Override
- protected void drawGuiContainerBackgroundLayer(float f, int i, int j) {
+ protected void drawGuiContainerBackgroundLayer(float f, int i,
+ int j) {
nextHover = false;
prevHover = false;
if (del == 0)
@@ -59,12 +63,12 @@ public class GuiGuide extends GuiContainer { del = 0;
Minecraft.getMinecraft().getTextureManager()
.bindTexture(pageTexture);
- drawTexturedModalRect(guiLeft + 147 / 2 + 20, guiTop - 10, 0, 0,
- 145, 179);
+ drawTexturedModalRect(guiLeft + 147 / 2 + 20, guiTop - 10,
+ 0, 0, 145, 179);
Minecraft.getMinecraft().getTextureManager()
.bindTexture(flippedPageTexture);
- drawTexturedModalRect(guiLeft - 147 / 2 + 21, guiTop - 10, 0, 0,
- 145, 179);
+ drawTexturedModalRect(guiLeft - 147 / 2 + 21, guiTop - 10,
+ 0, 0, 145, 179);
for (GuiRectangle tab : tabs) {
int srcX = 24;
int sizeX = 19;
@@ -76,35 +80,43 @@ public class GuiGuide extends GuiContainer { tab.draw(this, srcX, 180, sizeX, 18);
}
if (i >= guiLeft + 195 + 20 && i <= guiLeft + 195 + 20 + 11
- && j >= guiTop + 127 + 20 && j <= guiTop + 127 + 20 + 14
+ && j >= guiTop + 127 + 20
+ && j <= guiTop + 127 + 20 + 14
&& page + 2 <= activeTab.getMaxPages()) {
- drawTexturedModalRect(guiLeft + 195 + 20, guiTop + 127 + 20, 0,
- 180, 11, 14);
+ drawTexturedModalRect(guiLeft + 195 + 20,
+ guiTop + 127 + 20, 0, 180, 11, 14);
nextHover = true;
}
if (i >= guiLeft + 20 - 61 && i <= guiLeft - 61 + 20 + 11
- && j >= guiTop + 127 + 20 && j <= guiTop + 127 + 20 + 14
+ && j >= guiTop + 127 + 20
+ && j <= guiTop + 127 + 20 + 14
&& page - 2 > 0) {
- drawTexturedModalRect(guiLeft - 61 + 20, guiTop + 127 + 20, 11,
- 180, 11, 14);
+ drawTexturedModalRect(guiLeft - 61 + 20,
+ guiTop + 127 + 20, 11, 180, 11,
+ 14);
prevHover = true;
}
activeTab.drawBackground(this, i, j, page);
activeTab.drawBackground(this, i, j, page + 1);
ArrayList<String> text = new ArrayList<>();
text.add(page + "/" + activeTab.getMaxPages());
- drawHoveringText(text, guiLeft - 10 + 20 - text.get(0).length(),
+ drawHoveringText(text,
+ guiLeft - 10 + 20 - text.get(0).length(),
guiTop + 150 + 25, fontRendererObj);
if (page < activeTab.getMaxPages()) {
text.remove(0);
- text.add((page + 1) + "/" + activeTab.getMaxPages());
+ text.add((page + 1) + "/"
+ + activeTab.getMaxPages());
drawHoveringText(text,
- guiLeft - 10 + 20 + 147 - text.get(0).length(),
- guiTop + 150 + 25, fontRendererObj);
+ guiLeft - 10 + 20 + 147 - text
+ .get(0).length(),
+ guiTop + 150 + 25,
+ fontRendererObj);
}
for (int tab = 0; tab < tabs.length; tab++)
renderItem(tabs[tab].getIcon(), guiLeft - 52,
- guiTop + 26 + tab * 19, activeTab.getIcon());
+ guiTop + 26 + tab * 19,
+ activeTab.getIcon());
}
@Override
@@ -140,8 +152,8 @@ public class GuiGuide extends GuiContainer { ItemStack activeIcon) {
GL11.glPushMatrix();
GL11.glDisable(GL11.GL_LIGHTING);
- EntityItem entityitem =
- new EntityItem(world, 0.0D, 0.0D, 0.0D, item);
+ EntityItem entityitem = new EntityItem(world, 0.0D, 0.0D,
+ 0.0D, item);
entityitem.hoverStart = 0.0F;
if (item.isItemEqual(new ItemStack(BlockList.smelter))) {
y -= 3;
@@ -154,36 +166,40 @@ public class GuiGuide extends GuiContainer { GL11.glRotatef(rot, 0, 1, 0);
if (item.isItemEqual(new ItemStack(BlockList.smelter)))
GL11.glScalef(1.5F, 1.5F, 1.5F);
- else if (item.isItemEqual(new ItemStack(BlockList.handPedestal))) {
+ else if (item.isItemEqual(
+ new ItemStack(BlockList.handPedestal))) {
GL11.glScalef(1.2F, 1.2F, 1.2F);
GL11.glTranslatef(0F, -0.05F, 0F);
}
GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F);
- if (!(Block.getBlockFromItem(
- entityitem.getEntityItem().getItem()) instanceof BlockAir))
+ if (!(Block.getBlockFromItem(entityitem.getEntityItem()
+ .getItem()) instanceof BlockAir))
RenderHelper.enableStandardItemLighting();
if (RenderManager.instance.options.fancyGraphics)
- RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D,
- 0.0D, 0.0D, 0.0F, 0.0F);
+ RenderManager.instance.renderEntityWithPosYaw(
+ entityitem, 0.0D, 0.0D, 0.0D, 0.0F,
+ 0.0F);
else {
GL11.glRotatef(180F, 0F, 1F, 0F);
RenderManager.instance.options.fancyGraphics = true;
- RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D,
- 0.0D, 0.0D, 0.0F, 0.0F);
+ RenderManager.instance.renderEntityWithPosYaw(
+ entityitem, 0.0D, 0.0D, 0.0D, 0.0F,
+ 0.0F);
RenderManager.instance.options.fancyGraphics = false;
}
- if (!(Block.getBlockFromItem(
- entityitem.getEntityItem().getItem()) instanceof BlockAir))
+ if (!(Block.getBlockFromItem(entityitem.getEntityItem()
+ .getItem()) instanceof BlockAir))
RenderHelper.disableStandardItemLighting();
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glPopMatrix();
}
- public void renderItem(ItemStack item, float x, float y, float scale,
- boolean rotate, float xRot, float yRot, float zRot) {
+ public void renderItem(ItemStack item, float x, float y,
+ float scale, boolean rotate, float xRot,
+ float yRot, float zRot) {
GL11.glPushMatrix();
- EntityItem entityitem =
- new EntityItem(world, 0.0D, 0.0D, 0.0D, item);
+ EntityItem entityitem = new EntityItem(world, 0.0D, 0.0D,
+ 0.0D, item);
entityitem.hoverStart = 0.0F;
GL11.glTranslatef(x, y, 100);
GL11.glScalef(-scale, scale, scale);
@@ -196,24 +212,27 @@ public class GuiGuide extends GuiContainer { GL11.glRotatef(zRot, 0, 0, 1);
if (xRot >= 90F || zRot >= 90F)
GL11.glTranslatef(0F, -0.2F, 0F);
- if (Block.getBlockFromItem(entityitem.getEntityItem()
+ if (Block.getBlockFromItem(entityitem
+ .getEntityItem()
.getItem()) instanceof BlockShadowEye)
GL11.glTranslatef(0F, 0F, 0.025F);
}
- if (!(Block.getBlockFromItem(
- entityitem.getEntityItem().getItem()) instanceof BlockAir))
+ if (!(Block.getBlockFromItem(entityitem.getEntityItem()
+ .getItem()) instanceof BlockAir))
RenderHelper.enableStandardItemLighting();
if (RenderManager.instance.options.fancyGraphics)
- RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D,
- 0.0D, 0.0D, 0.0F, 0.0F);
+ RenderManager.instance.renderEntityWithPosYaw(
+ entityitem, 0.0D, 0.0D, 0.0D, 0.0F,
+ 0.0F);
else {
RenderManager.instance.options.fancyGraphics = true;
- RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D,
- 0.0D, 0.0D, 0.0F, 0.0F);
+ RenderManager.instance.renderEntityWithPosYaw(
+ entityitem, 0.0D, 0.0D, 0.0D, 0.0F,
+ 0.0F);
RenderManager.instance.options.fancyGraphics = false;
}
- if (!(Block.getBlockFromItem(
- entityitem.getEntityItem().getItem()) instanceof BlockAir))
+ if (!(Block.getBlockFromItem(entityitem.getEntityItem()
+ .getItem()) instanceof BlockAir))
RenderHelper.disableStandardItemLighting();
GL11.glPopMatrix();
}
diff --git a/src/main/java/darkknight/jewelrycraft/client/gui/GuiHandler.java b/src/main/java/darkknight/jewelrycraft/client/gui/GuiHandler.java index ae21f08..be4a907 100755 --- a/src/main/java/darkknight/jewelrycraft/client/gui/GuiHandler.java +++ b/src/main/java/darkknight/jewelrycraft/client/gui/GuiHandler.java @@ -17,7 +17,7 @@ import net.minecraft.util.ResourceLocation; import net.minecraft.world.World;
public class GuiHandler implements IGuiHandler {
- ResourceLocation pageTexture = new ResourceLocation(
+ ResourceLocation pageTexture = new ResourceLocation(
Variables.MODID, "textures/gui/guidePage.png");
ResourceLocation flippedPageTexture = new ResourceLocation(
Variables.MODID, "textures/gui/guidePageFlip.png");
@@ -28,14 +28,15 @@ public class GuiHandler implements IGuiHandler { ResourceLocation cursesInvTexture = new ResourceLocation(
Variables.MODID, "textures/gui/curses_tab.png");
ResourceLocation jewlryModTexture = new ResourceLocation(
- Variables.MODID, "textures/gui/jewelry_modifier.png");
+ Variables.MODID,
+ "textures/gui/jewelry_modifier.png");
/**
*
*/
public GuiHandler() {
- NetworkRegistry.INSTANCE
- .registerGuiHandler(JewelrycraftMod.instance, this);
+ NetworkRegistry.INSTANCE.registerGuiHandler(
+ JewelrycraftMod.instance, this);
}
/**
@@ -52,16 +53,26 @@ public class GuiHandler implements IGuiHandler { World world, int x, int y, int z) {
switch (ID) {
case 0:
- return new ContainerRingChest(player.inventory,
- (TileEntityChest) world.getTileEntity(x, y, z));
+ return new ContainerRingChest(
+ player.inventory,
+ (TileEntityChest) world
+ .getTileEntity(x,
+ y,
+ z));
case 1:
return new ContainerGuide();
case 2:
- return new ContainerJewelryTab(player, player.inventory,
- new JewelryInventory(player));
+ return new ContainerJewelryTab(player,
+ player.inventory,
+ new JewelryInventory(
+ player));
case 3:
- return new ContainerJewelryModifier(player.inventory,
- new InventoryBasic("ItemModifier", false, 37));
+ return new ContainerJewelryModifier(
+ player.inventory,
+ new InventoryBasic(
+ "ItemModifier",
+ false,
+ 37));
case 4:
return new ContainerCurseInfo();
default:
@@ -84,29 +95,42 @@ public class GuiHandler implements IGuiHandler { switch (ID) {
case 0:
return new GuiRingChest(
- (ContainerRingChest) getServerGuiElement(ID,
- player, world, x, y, z),
+ (ContainerRingChest) getServerGuiElement(
+ ID, player,
+ world, x,
+ y, z),
chestTexture);
case 1:
return new GuiGuide(
- (ContainerGuide) getServerGuiElement(ID, player,
- world, x, y, z),
- world, pageTexture, flippedPageTexture);
+ (ContainerGuide) getServerGuiElement(
+ ID, player,
+ world, x,
+ y, z),
+ world, pageTexture,
+ flippedPageTexture);
case 2:
return new GuiJewelry(
- new ContainerJewelryTab(player, player.inventory,
- new JewelryInventory(player)),
+ new ContainerJewelryTab(
+ player,
+ player.inventory,
+ new JewelryInventory(
+ player)),
jewelryInvTexture);
case 3:
return new GuiJewelryModifier(
- (ContainerJewelryModifier) getServerGuiElement(ID,
- player, world, x, y, z),
+ (ContainerJewelryModifier) getServerGuiElement(
+ ID, player,
+ world, x,
+ y, z),
jewlryModTexture);
case 4:
return new GuiCurseInfo(
- (ContainerCurseInfo) getServerGuiElement(ID,
- player, world, x, y, z),
- world, player, cursesInvTexture);
+ (ContainerCurseInfo) getServerGuiElement(
+ ID, player,
+ world, x,
+ y, z),
+ world, player,
+ cursesInvTexture);
default:
return null;
}
diff --git a/src/main/java/darkknight/jewelrycraft/client/gui/GuiJewelry.java b/src/main/java/darkknight/jewelrycraft/client/gui/GuiJewelry.java index bccf2b1..1498f75 100755 --- a/src/main/java/darkknight/jewelrycraft/client/gui/GuiJewelry.java +++ b/src/main/java/darkknight/jewelrycraft/client/gui/GuiJewelry.java @@ -35,12 +35,14 @@ public class GuiJewelry extends GuiContainer { public void drawGuiContainerBackgroundLayer(float f, int mouseX,
int mouseY) {
GL11.glColor3f(1, 1, 1);
- Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
+ Minecraft.getMinecraft().getTextureManager()
+ .bindTexture(texture);
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
GL11.glPushMatrix();
GuiInventory.func_147046_a(guiLeft - 24, guiTop + 124, 60,
(float) (guiLeft - 24) - mouseX,
- (float) (guiTop + 124 - 90) - mouseY, this.mc.thePlayer);
+ (float) (guiTop + 124 - 90) - mouseY,
+ this.mc.thePlayer);
GL11.glPopMatrix();
}
@@ -49,7 +51,8 @@ public class GuiJewelry extends GuiContainer { * @param mouseY
*/
@Override
- public void drawGuiContainerForegroundLayer(int mouseX, int mouseY) {
+ public void drawGuiContainerForegroundLayer(int mouseX,
+ int mouseY) {
// Do nothing
}
@@ -70,7 +73,8 @@ public class GuiJewelry extends GuiContainer { int cornerX = guiLeft;
int cornerY = guiTop;
this.buttonList.clear();
- TabRegistry.updateTabValues(cornerX, cornerY, TabJewelry.class);
+ TabRegistry.updateTabValues(cornerX, cornerY,
+ TabJewelry.class);
TabRegistry.addTabsToList(this.buttonList);
}
}
diff --git a/src/main/java/darkknight/jewelrycraft/client/gui/GuiJewelryModifier.java b/src/main/java/darkknight/jewelrycraft/client/gui/GuiJewelryModifier.java index df8035c..30f0b5b 100755 --- a/src/main/java/darkknight/jewelrycraft/client/gui/GuiJewelryModifier.java +++ b/src/main/java/darkknight/jewelrycraft/client/gui/GuiJewelryModifier.java @@ -22,22 +22,19 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.ResourceLocation;
public class GuiJewelryModifier extends GuiContainer {
- private ResourceLocation texture;
- private GuiTextField searchField, pages;
- private int page =
- 1, maxPages = 1, selectedX = 0, selectedY = 0,
+ private ResourceLocation texture;
+ private GuiTextField searchField,
+ pages;
+ private int page = 1,
+ maxPages = 1, selectedX = 0, selectedY = 0,
selectedPage = 0, enabled = 0;
- private ItemStack selectedItem;
- private ArrayList<
- ItemStack> selectedItems =
- new ArrayList<>();
- private List<Map<Integer,
- Map<Integer,
- Integer>>> selectedItemsPos =
- new ArrayList<>();
- ContainerJewelryModifier jMod;
+ private ItemStack selectedItem;
+ private ArrayList<ItemStack> selectedItems = new ArrayList<>();
+ private List<Map<Integer, Map<Integer, Integer>>> selectedItemsPos = new ArrayList<>();
+ ContainerJewelryModifier jMod;
- public GuiJewelryModifier(ContainerJewelryModifier containerJewelryTab,
+ public GuiJewelryModifier(
+ ContainerJewelryModifier containerJewelryTab,
ResourceLocation texture) {
super(containerJewelryTab);
xSize = 211;
@@ -51,20 +48,25 @@ public class GuiJewelryModifier extends GuiContainer { public void drawGuiContainerBackgroundLayer(float f, int mouseX,
int mouseY) {
GL11.glColor3f(1, 1, 1);
- Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
+ Minecraft.getMinecraft().getTextureManager()
+ .bindTexture(texture);
int k = (this.width - this.xSize) / 2;
int l = (this.height - this.ySize) / 2;
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
- if (selectedX != 0 && selectedY != 0 && page == selectedPage)
- drawTexturedModalRect(k + selectedX, l + selectedY, 211, 0, 18,
- 18);
- for (Map<Integer,
- Map<Integer, Integer>> items : selectedItemsPos) {
+ if (selectedX != 0 && selectedY != 0
+ && page == selectedPage)
+ drawTexturedModalRect(k + selectedX, l + selectedY,
+ 211, 0, 18, 18);
+ for (Map<Integer, Map<Integer, Integer>> items : selectedItemsPos) {
for (Object itemPage : items.keySet()) {
if (page == (Integer) itemPage)
- for (int x : items.get(itemPage).keySet())
- drawTexturedModalRect(k + x,
- l + items.get(itemPage).get(x), 211, 0, 18,
+ for (int x : items.get(itemPage)
+ .keySet())
+ drawTexturedModalRect(
+ k + x,
+ l + items.get(itemPage)
+ .get(x),
+ 211, 0, 18,
18);
}
}
@@ -73,13 +75,17 @@ public class GuiJewelryModifier extends GuiContainer { }
@Override
- public void drawGuiContainerForegroundLayer(int mouseX, int mouseY) {
+ public void drawGuiContainerForegroundLayer(int mouseX,
+ int mouseY) {
int i = 0;
for (ItemStack item : JewelrycraftUtil.objects) {
if (item != null && item.getItem() != null
- && (this.searchField.getText() == ""
- || item.getDisplayName().toLowerCase()
- .contains(this.searchField.getText()
+ && (this.searchField
+ .getText() == ""
+ || item.getDisplayName()
+ .toLowerCase()
+ .contains(this.searchField
+ .getText()
.toLowerCase()))) {
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glColor3f(1F, 1F, 1F);
@@ -89,9 +95,11 @@ public class GuiJewelryModifier extends GuiContainer { try {
itemRender.renderItemAndEffectIntoGUI(
this.fontRendererObj,
- this.mc.getTextureManager(), item,
+ this.mc.getTextureManager(),
+ item,
88 + 20 * (i % 6),
- 7 + 17 * (i / 6) - 136 * (page - 1));
+ 7 + 17 * (i / 6) - 136
+ * (page - 1));
} catch (Exception e) {
JewelrycraftMod.logger
.info("Trying to display an item but gets this error: "
@@ -113,8 +121,11 @@ public class GuiJewelryModifier extends GuiContainer { if (item != null && searchField != null
&& searchField.getText() != ""
&& item.getItem() != null
- && item.getDisplayName().toLowerCase().contains(
- this.searchField.getText().toLowerCase()))
+ && item.getDisplayName()
+ .toLowerCase()
+ .contains(this.searchField
+ .getText()
+ .toLowerCase()))
items++;
maxPages = items / 48 + 1;
page = 1;
@@ -127,30 +138,41 @@ public class GuiJewelryModifier extends GuiContainer { protected void mouseClicked(int x, int y, int id) {
super.mouseClicked(x, y, id);
if (x >= this.searchField.xPosition
- && x <= this.searchField.xPosition + this.searchField.width
+ && x <= this.searchField.xPosition
+ + this.searchField.width
&& y >= this.searchField.yPosition
&& y <= this.searchField.yPosition
+ this.searchField.height) {
this.searchField.setText("");
this.searchField.setFocused(true);
- maxPages = JewelrycraftUtil.objects.size() / 48 + 1;
+ maxPages = JewelrycraftUtil.objects.size() / 48
+ + 1;
} else
this.searchField.setFocused(false);
for (Object button : this.buttonList) {
if (((GuiButton) button).id < 4
- && ((GuiButton) button).mousePressed(mc, x, y)) {
+ && ((GuiButton) button)
+ .mousePressed(mc,
+ x,
+ y)) {
if (((GuiButton) button).id != 3) {
- this.selectedItems.removeAll(selectedItems);
- this.selectedItemsPos.removeAll(selectedItemsPos);
+ this.selectedItems.removeAll(
+ selectedItems);
+ this.selectedItemsPos.removeAll(
+ selectedItemsPos);
} else {
this.selectedX = 0;
this.selectedY = 0;
this.selectedItem = null;
}
- ((GuiButton) buttonList.get(0)).enabled = true;
- ((GuiButton) buttonList.get(1)).enabled = true;
- ((GuiButton) buttonList.get(2)).enabled = true;
- ((GuiButton) buttonList.get(3)).enabled = true;
+ ((GuiButton) buttonList
+ .get(0)).enabled = true;
+ ((GuiButton) buttonList
+ .get(1)).enabled = true;
+ ((GuiButton) buttonList
+ .get(2)).enabled = true;
+ ((GuiButton) buttonList
+ .get(3)).enabled = true;
((GuiButton) button).enabled = false;
enabled = ((GuiButton) button).id;
}
@@ -158,41 +180,59 @@ public class GuiJewelryModifier extends GuiContainer { int i = 0;
for (ItemStack item : JewelrycraftUtil.objects) {
if (item != null && item.getItem() != null
- && (this.searchField.getText() == ""
- || item.getDisplayName().toLowerCase()
- .contains(this.searchField.getText()
+ && (this.searchField
+ .getText() == ""
+ || item.getDisplayName()
+ .toLowerCase()
+ .contains(this.searchField
+ .getText()
.toLowerCase()))) {
if (i >= (page - 1) * 48 && i < page * 48
- && x >= this.guiLeft + 88 + 20 * (i % 6)
- && x < this.guiLeft + 108 + 20 * (i % 6)
- && y >= this.guiTop + 9 + 17 * (i / 6)
+ && x >= this.guiLeft + 88
+ + 20 * (i % 6)
+ && x < this.guiLeft + 108
+ + 20 * (i % 6)
+ && y >= this.guiTop + 9
+ + 17 * (i / 6)
- 136 * (page - 1)
- && y < this.guiTop + 25 + 17 * (i / 6)
+ && y < this.guiTop + 25
+ + 17 * (i / 6)
- 136 * (page - 1)) {
try {
- if (!((GuiButton) buttonList.get(0)).enabled
- || !((GuiButton) buttonList.get(1)).enabled
+ if (!((GuiButton) buttonList
+ .get(0)).enabled
+ || !((GuiButton) buttonList
+ .get(1)).enabled
|| !((GuiButton) buttonList
.get(2)).enabled) {
this.selectedItem = item;
- this.selectedX = 87 + 20 * (i % 6);
- this.selectedY =
- 6 + 17 * (i / 6) - 136 * (page - 1);
+ this.selectedX = 87
+ + 20 * (i % 6);
+ this.selectedY = 6
+ + 17 * (i / 6)
+ - 136 * (page - 1);
this.selectedPage = page;
} else if (!((GuiButton) buttonList
.get(3)).enabled) {
- Map<Integer, Map<Integer, Integer>> itemPage =
- new HashMap<>();
+ Map<Integer, Map<Integer, Integer>> itemPage = new HashMap<>();
Map<Integer, Integer> pos = new HashMap<>();
- pos.put(87 + 20 * (i % 6),
- 6 + 17 * (i / 6) - 136 * (page - 1));
- itemPage.put(page, pos);
- if (!this.selectedItems.contains(item)) {
- this.selectedItems.add(item);
- this.selectedItemsPos.add(itemPage);
+ pos.put(87 + 20 * (i
+ % 6),
+ 6 + 17 * (i / 6) - 136
+ * (page - 1));
+ itemPage.put(page,
+ pos);
+ if (!this.selectedItems
+ .contains(item)) {
+ this.selectedItems
+ .add(item);
+ this.selectedItemsPos
+ .add(itemPage);
} else {
- this.selectedItems.remove(item);
- this.selectedItemsPos.remove(itemPage);
+ this.selectedItems
+ .remove(item);
+ this.selectedItemsPos
+ .remove(itemPage);
}
}
} catch (Exception e) {
@@ -213,40 +253,63 @@ public class GuiJewelryModifier extends GuiContainer { && page < maxPages)
page++;
if (jMod.modInv.getStackInSlot(36) != null) {
- ItemStack targetItem = jMod.modInv.getStackInSlot(36).copy();
- if (((GuiButton) buttonList.get(4)).mousePressed(mc, x, y)
- && !((GuiButton) buttonList.get(0)).enabled) {
- JewelryNBT.addIngotColor(targetItem, 16777215);
+ ItemStack targetItem = jMod.modInv
+ .getStackInSlot(36).copy();
+ if (((GuiButton) buttonList.get(4))
+ .mousePressed(mc, x, y)
+ && !((GuiButton) buttonList
+ .get(0)).enabled) {
+ JewelryNBT.addIngotColor(targetItem,
+ 16777215);
JewelryNBT.addMetal(targetItem,
- new ItemStack(Item.getItemById(0), 0, 0));
+ new ItemStack(Item
+ .getItemById(0),
+ 0, 0));
if (selectedItem != null)
- JewelryNBT.addMetal(targetItem, this.selectedItem);
+ JewelryNBT.addMetal(targetItem,
+ this.selectedItem);
JewelrycraftMod.netWrapper.sendToServer(
- new PacketRequestSetSlot(targetItem));
+ new PacketRequestSetSlot(
+ targetItem));
}
- if (((GuiButton) buttonList.get(4)).mousePressed(mc, x, y)
- && !((GuiButton) buttonList.get(1)).enabled) {
- JewelryNBT.addGemColor(targetItem, 16777215);
+ if (((GuiButton) buttonList.get(4))
+ .mousePressed(mc, x, y)
+ && !((GuiButton) buttonList
+ .get(1)).enabled) {
+ JewelryNBT.addGemColor(targetItem,
+ 16777215);
JewelryNBT.addGem(targetItem,
- new ItemStack(Item.getItemById(0), 0, 0));
+ new ItemStack(Item
+ .getItemById(0),
+ 0, 0));
if (selectedItem != null)
- JewelryNBT.addGem(targetItem, this.selectedItem);
+ JewelryNBT.addGem(targetItem,
+ this.selectedItem);
JewelrycraftMod.netWrapper.sendToServer(
- new PacketRequestSetSlot(targetItem));
+ new PacketRequestSetSlot(
+ targetItem));
}
- if (((GuiButton) buttonList.get(4)).mousePressed(mc, x, y)
- && !((GuiButton) buttonList.get(2)).enabled) {
+ if (((GuiButton) buttonList.get(4))
+ .mousePressed(mc, x, y)
+ && !((GuiButton) buttonList
+ .get(2)).enabled) {
if (selectedItem != null)
- JewelryNBT.addItem(targetItem, selectedItem);
+ JewelryNBT.addItem(targetItem,
+ selectedItem);
JewelrycraftMod.netWrapper.sendToServer(
- new PacketRequestSetSlot(targetItem));
+ new PacketRequestSetSlot(
+ targetItem));
}
- if (((GuiButton) buttonList.get(4)).mousePressed(mc, x, y)
- && !((GuiButton) buttonList.get(3)).enabled) {
+ if (((GuiButton) buttonList.get(4))
+ .mousePressed(mc, x, y)
+ && !((GuiButton) buttonList
+ .get(3)).enabled) {
if (!selectedItems.isEmpty())
- JewelryNBT.addModifiers(targetItem, selectedItems);
+ JewelryNBT.addModifiers(targetItem,
+ selectedItems);
JewelrycraftMod.netWrapper.sendToServer(
- new PacketRequestSetSlot(targetItem));
+ new PacketRequestSetSlot(
+ targetItem));
}
}
this.pages.setText(page + "/" + maxPages);
@@ -293,23 +356,32 @@ public class GuiJewelryModifier extends GuiContainer { List<String> list = new ArrayList<>();
for (ItemStack item : JewelrycraftUtil.objects) {
if (item != null && item.getItem() != null
- && (this.searchField.getText() == ""
- || item.getDisplayName().toLowerCase()
- .contains(this.searchField.getText()
+ && (this.searchField
+ .getText() == ""
+ || item.getDisplayName()
+ .toLowerCase()
+ .contains(this.searchField
+ .getText()
.toLowerCase()))) {
if (i >= (page - 1) * 48 && i < page * 48
- && x >= this.guiLeft + 88 + 20 * (i % 6)
- && x < this.guiLeft + 108 + 20 * (i % 6)
- && y >= this.guiTop + 9 + 17 * (i / 6)
+ && x >= this.guiLeft + 88
+ + 20 * (i % 6)
+ && x < this.guiLeft + 108
+ + 20 * (i % 6)
+ && y >= this.guiTop + 9
+ + 17 * (i / 6)
- 136 * (page - 1)
- && y < this.guiTop + 25 + 17 * (i / 6)
+ && y < this.guiTop + 25
+ + 17 * (i / 6)
- 136 * (page - 1)) {
list.add(item.getDisplayName());
if (item.getTooltip(mc.thePlayer,
mc.gameSettings.advancedItemTooltips) != null)
- this.renderToolTip(item, x, y);
+ this.renderToolTip(item, x,
+ y);
else
- this.drawHoveringText(list, x, y,
+ this.drawHoveringText(list,
+ x, y,
this.fontRendererObj);
}
i++;
diff --git a/src/main/java/darkknight/jewelrycraft/client/gui/GuiRectangle.java b/src/main/java/darkknight/jewelrycraft/client/gui/GuiRectangle.java index 9ce5814..d5e2451 100755 --- a/src/main/java/darkknight/jewelrycraft/client/gui/GuiRectangle.java +++ b/src/main/java/darkknight/jewelrycraft/client/gui/GuiRectangle.java @@ -56,8 +56,8 @@ public class GuiRectangle { * @param srcY
*/
public void draw(GuiGuide gui, int srcX, int srcY) {
- gui.drawTexturedModalRect(gui.getLeft() + x, gui.getTop() + y,
- srcX, srcY, w, h);
+ gui.drawTexturedModalRect(gui.getLeft() + x,
+ gui.getTop() + y, srcX, srcY, w, h);
}
/**
@@ -69,8 +69,9 @@ public class GuiRectangle { */
public void draw(GuiGuide gui, int srcX, int srcY, int width,
int height) {
- gui.drawTexturedModalRect(gui.getLeft() + x, gui.getTop() + y,
- srcX, srcY, width, height);
+ gui.drawTexturedModalRect(gui.getLeft() + x,
+ gui.getTop() + y, srcX, srcY, width,
+ height);
}
/**
@@ -83,7 +84,8 @@ public class GuiRectangle { String str) {
if (inRect(gui, mouseX, mouseY))
gui.drawHoverString(Arrays.asList(str.split("\n")),
- mouseX - gui.getLeft(), mouseY - gui.getTop());
+ mouseX - gui.getLeft(),
+ mouseY - gui.getTop());
}
/**
diff --git a/src/main/java/darkknight/jewelrycraft/client/gui/GuiRingChest.java b/src/main/java/darkknight/jewelrycraft/client/gui/GuiRingChest.java index 4a71b11..8013440 100755 --- a/src/main/java/darkknight/jewelrycraft/client/gui/GuiRingChest.java +++ b/src/main/java/darkknight/jewelrycraft/client/gui/GuiRingChest.java @@ -9,7 +9,7 @@ import net.minecraft.util.ResourceLocation; public class GuiRingChest extends GuiContainer {
public ContainerRingChest container;
- ResourceLocation texture;
+ ResourceLocation texture;
/**
* @param container
@@ -33,7 +33,8 @@ public class GuiRingChest extends GuiContainer { public void drawGuiContainerBackgroundLayer(float f, int mouseX,
int mouseY) {
GL11.glColor3f(1, 1, 1);
- Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
+ Minecraft.getMinecraft().getTextureManager()
+ .bindTexture(texture);
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
}
@@ -42,7 +43,8 @@ public class GuiRingChest extends GuiContainer { * @param mouseY
*/
@Override
- public void drawGuiContainerForegroundLayer(int mouseX, int mouseY) {
+ public void drawGuiContainerForegroundLayer(int mouseX,
+ int mouseY) {
fontRendererObj.drawString("Linked Chest", 8, 6, 0x404040);
fontRendererObj.drawString("Inventory", 8, 72, 0x404040);
}
diff --git a/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabBlocks.java b/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabBlocks.java index 8a48a1b..6c72a13 100755 --- a/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabBlocks.java +++ b/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabBlocks.java @@ -20,8 +20,8 @@ public class GuiTabBlocks extends GuiTab { @Override
public String getName() {
- return StatCollector.translateToLocal(
- "guide." + Variables.MODID + ".tab.blocks");
+ return StatCollector.translateToLocal("guide."
+ + Variables.MODID + ".tab.blocks");
}
/**
@@ -45,14 +45,19 @@ public class GuiTabBlocks extends GuiTab { switch (page) {
case 1:
text = "This ore is extremely rare and can be found only between Y-level 5 and 8. It can only be mined using a diamond pickaxe.";
- Page.addImageTextPage(gui, gui.getLeft() + xPos,
- gui.getTop(), new ItemStack(BlockList.shadowOre),
- text, 180f, 0, -18, true, 42, 100, true);
+ Page.addImageTextPage(gui,
+ gui.getLeft() + xPos,
+ gui.getTop(),
+ new ItemStack(BlockList.shadowOre),
+ text, 180f, 0, -18, true,
+ 42, 100, true);
break;
case 2:
text = "Magicians believed this block held the ability to merge with the shadows. It becomes more transparent as it gets darker. If a comparator is attached to it, the output strength will be equal to the value of darkness it is in.";
- Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos,
- gui.getTop(), false, text, x, y, true,
+ Page.addCraftingRecipeTextPage(gui,
+ gui.getLeft() + xPos,
+ gui.getTop(), false, text,
+ x, y, true,
new ItemStack(BlockList.shadowBlock),
new ItemStack(ItemList.shadowIngot),
new ItemStack(ItemList.shadowIngot),
@@ -66,13 +71,16 @@ public class GuiTabBlocks extends GuiTab { break;
case 3:
text = "The smelter is one of the first blocks needed to get started with Jewelrycraft. Requiring just some cobble and a couple buckets. It is required in order to melt ingots or even ores which can be made into rings, necklaces, bracelets or earrings. To use the block all you need to do";
- Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos,
- gui.getTop(), false, text, x, y, true,
+ Page.addCraftingRecipeTextPage(gui,
+ gui.getLeft() + xPos,
+ gui.getTop(), false, text,
+ x, y, true,
new ItemStack(BlockList.smelter),
new ItemStack(Blocks.cobblestone),
new ItemStack(Items.bucket),
new ItemStack(Blocks.cobblestone),
- new ItemStack(Blocks.cobblestone), null,
+ new ItemStack(Blocks.cobblestone),
+ null,
new ItemStack(Blocks.cobblestone),
new ItemStack(Blocks.cobblestone),
new ItemStack(Items.lava_bucket),
@@ -80,15 +88,18 @@ public class GuiTabBlocks extends GuiTab { break;
case 4:
text = "is right click on it with any ore or ingot. It can melt multiple ingots/ores at a time. Crouch (default: Shift) + Right Click will remove all items added. If right clicked when done smelting, it will say what the block contains.";
- Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(),
- text);
+ Page.addTextPage(gui, gui.getLeft() + xPos,
+ gui.getTop(), text);
break;
case 5:
text = "The molder is a key piece in creating jewelry. You need to pour the molten metal out of the smelter somewhere. That somewhere is the molder. But before pouring the molten metal in it, you must first add a mold. You can do that by simply right clicking the block with the mold of your";
- Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos,
- gui.getTop(), false, text, x, y, true,
+ Page.addCraftingRecipeTextPage(gui,
+ gui.getLeft() + xPos,
+ gui.getTop(), false, text,
+ x, y, true,
new ItemStack(BlockList.molder),
- new ItemStack(Blocks.cobblestone), null,
+ new ItemStack(Blocks.cobblestone),
+ null,
new ItemStack(Blocks.cobblestone),
new ItemStack(Blocks.cobblestone),
new ItemStack(Blocks.cobblestone),
@@ -96,8 +107,8 @@ public class GuiTabBlocks extends GuiTab { break;
case 6:
text = "choice. If you want to get the mold out, simply crouch and Right Click it with an empty hand. Once you have a mold inside, left click on the smelter and wait for the metal to cool down. When it's done, left click on the molder to get the jewellery. Be aware that this block must be placed directly in front of the smelter, otherwise it won't work!";
- Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(),
- text);
+ Page.addTextPage(gui, gui.getLeft() + xPos,
+ gui.getTop(), text);
break;
case 7:
text = "This table allows you to add a gem to a piece of jewelry. Right click the block while holding jewelry to add it in. Then do the same with a gem (you can find a list with all possible gems in this guide). Crouch + Right Click to retreive placed items. Left Click the block to see the";
@@ -108,30 +119,41 @@ public class GuiTabBlocks extends GuiTab { del = 0;
if (values >= 4)
values = 0;
- Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos,
- gui.getTop(), false, text, x, y, true,
+ Page.addCraftingRecipeTextPage(gui,
+ gui.getLeft() + xPos,
+ gui.getTop(), false, text,
+ x, y, true,
new ItemStack(BlockList.jewelCraftingTable),
- new ItemStack(Blocks.planks, 1, values),
- new ItemStack(Blocks.planks, 1, values),
- new ItemStack(Blocks.planks, 1, values),
- new ItemStack(Blocks.stone), null,
+ new ItemStack(Blocks.planks,
+ 1, values),
+ new ItemStack(Blocks.planks,
+ 1, values),
+ new ItemStack(Blocks.planks,
+ 1, values),
+ new ItemStack(Blocks.stone),
+ null,
new ItemStack(Blocks.stone),
- new ItemStack(Blocks.stone), null,
+ new ItemStack(Blocks.stone),
+ null,
new ItemStack(Blocks.stone));
break;
case 8:
text = "progress the crafting has made. Once the crafting is done, Left Click the block to get the item. You are able to recraft a jewellery by readding the modified version to this block and adding a different gem to it. Once the crafting is done, the current gem will be replaced by the new one. There is also a 50% chance that you will get back the old gem.";
- Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(),
- text);
+ Page.addTextPage(gui, gui.getLeft() + xPos,
+ gui.getTop(), text);
break;
case 9:
text = "The Storage Displayer, as the name suggests, can store a large amount (Up to: "
+ Integer.MAX_VALUE
+ ") of a single item/block placed in it. It will display all possible infromation about the object in it, such as the name, durability, enchantments etc. To store something in it";
- Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos,
- gui.getTop(), false, text, x, y, true,
- new ItemStack(BlockList.displayer), null,
- new ItemStack(Items.iron_ingot), null,
+ Page.addCraftingRecipeTextPage(gui,
+ gui.getLeft() + xPos,
+ gui.getTop(), false, text,
+ x, y, true,
+ new ItemStack(BlockList.displayer),
+ null,
+ new ItemStack(Items.iron_ingot),
+ null,
new ItemStack(Items.iron_ingot),
new ItemStack(Items.iron_ingot),
new ItemStack(Items.iron_ingot),
@@ -141,46 +163,58 @@ public class GuiTabBlocks extends GuiTab { break;
case 10:
text = "simply right click with that object on it and the whole amount of items or blocks you are holding will be immediately stored inside. If a displayer already contains an item and you have that in your inventory, you can simply hold right click on it with an empty hand to add all of your items of that type from your inventory. To retrieve a single item just left click the block. If you wish to get a whole stack, Crouch + Left Click on it. In creative mode you can simply hold Right";
- Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(),
- text);
+ Page.addTextPage(gui, gui.getLeft() + xPos,
+ gui.getTop(), text);
break;
case 11:
text = "Click on a displayer containing an object and it will add 64 of it with every right click, without it being in your inventory.";
- Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(),
- text);
+ Page.addTextPage(gui, gui.getLeft() + xPos,
+ gui.getTop(), text);
break;
case 12:
text = "This mysterious shaped block is used in the ritual. The acient ones claimed it had the power to travel through worlds. They would use these to offer sacrifices to 'The Dark One' in exchange for unimaginable powers.";
- Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos,
- gui.getTop(), false, text, x, y, true,
+ Page.addCraftingRecipeTextPage(gui,
+ gui.getLeft() + xPos,
+ gui.getTop(), false, text,
+ x, y, true,
new ItemStack(BlockList.handPedestal),
new ItemStack(Blocks.cobblestone_wall),
new ItemStack(Blocks.cobblestone_wall),
- new ItemStack(Blocks.cobblestone_wall), null,
- new ItemStack(Blocks.stonebrick), null,
- new ItemStack(Blocks.stone_slab, 1, 5),
+ new ItemStack(Blocks.cobblestone_wall),
+ null,
+ new ItemStack(Blocks.stonebrick),
+ null,
+ new ItemStack(Blocks.stone_slab,
+ 1, 5),
new ItemStack(Blocks.stonebrick),
- new ItemStack(Blocks.stone_slab, 1, 5));
+ new ItemStack(Blocks.stone_slab,
+ 1, 5));
break;
case 13:
text = "The Cursed Eye is an ancient artifact also known as 'The Dark One's Eye'. It is part of the sacrifice ritual the ancient ones talk about. Be careful though, for He sees everything. To see how to create the ritual look in the Ritual tab. One you created the ritual, simply place a";
- Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos,
- gui.getTop(), false, text, x, y, true,
+ Page.addCraftingRecipeTextPage(gui,
+ gui.getLeft() + xPos,
+ gui.getTop(), false, text,
+ x, y, true,
new ItemStack(BlockList.shadowEye),
new ItemStack(Blocks.stonebrick),
- new ItemStack(Blocks.stained_hardened_clay, 1, 15),
+ new ItemStack(Blocks.stained_hardened_clay,
+ 1, 15),
new ItemStack(Blocks.stonebrick),
- new ItemStack(Blocks.stained_hardened_clay, 1, 15),
+ new ItemStack(Blocks.stained_hardened_clay,
+ 1, 15),
new ItemStack(Items.ender_eye),
- new ItemStack(Blocks.stained_hardened_clay, 1, 15),
+ new ItemStack(Blocks.stained_hardened_clay,
+ 1, 15),
new ItemStack(Blocks.stonebrick),
- new ItemStack(Blocks.stained_hardened_clay, 1, 15),
+ new ItemStack(Blocks.stained_hardened_clay,
+ 1, 15),
new ItemStack(Blocks.stonebrick));
break;
case 14:
text = "piece of jewelry in the middle pedestal and your modifiers of choice in the other ones (you don't need to put an item in every single pedestal). After you do that simply right click the eye to activate the ritual. Be careful not to leave the premise or you'll die! When the ritual is done, Shift+Right Click on the central hand pedestal to retrieve your newly modified item!";
- Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(),
- text);
+ Page.addTextPage(gui, gui.getLeft() + xPos,
+ gui.getTop(), text);
break;
case 15:
if (del == 0)
@@ -191,10 +225,13 @@ public class GuiTabBlocks extends GuiTab { if (values >= 15)
values = 0;
text = "Crystals don't do much as of yet. They spawn naturally in caves and come in all 16 colors.";
- Page.addImageTextPage(gui, gui.getLeft() + xPos,
+ Page.addImageTextPage(gui,
+ gui.getLeft() + xPos,
gui.getTop(),
- new ItemStack(BlockList.crystal, 1, values), text,
- 180f, 0, -18, true, 48, 120, true);
+ new ItemStack(BlockList.crystal,
+ 1, values),
+ text, 180f, 0, -18, true,
+ 48, 120, true);
break;
default:
;
diff --git a/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabCurses.java b/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabCurses.java index 03de3c2..cd18b64 100755 --- a/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabCurses.java +++ b/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabCurses.java @@ -14,8 +14,8 @@ public class GuiTabCurses extends GuiTab { @Override
public String getName() {
- return StatCollector.translateToLocal(
- "guide." + Variables.MODID + ".tab.curses");
+ return StatCollector.translateToLocal("guide."
+ + Variables.MODID + ".tab.curses");
}
@Override
@@ -30,100 +30,144 @@ public class GuiTabCurses extends GuiTab { switch (page) {
case 1:
text = "You are poisoned for as long as this curse is active.";
- Page.addImageTextPage(gui, gui.getLeft() + xPos,
+ Page.addImageTextPage(gui,
+ gui.getLeft() + xPos,
gui.getTop() - 5,
- new ItemStack(ItemList.testItem, 1, 0), text, 40f,
- 0, 0, Curse.getCurseList().get(page - 1)
+ new ItemStack(ItemList.testItem,
+ 1, 0),
+ text, 40f, 0, 0,
+ Curse.getCurseList().get(
+ page - 1)
.getDisplayName(),
45, 10, false);
break;
case 2:
text = "Whenever you attack an entity you are set on fire.";
- Page.addImageTextPage(gui, gui.getLeft() + xPos,
+ Page.addImageTextPage(gui,
+ gui.getLeft() + xPos,
gui.getTop() - 5,
- new ItemStack(ItemList.testItem, 1, 1), text, 40f,
- 0, 0, Curse.getCurseList().get(page - 1)
+ new ItemStack(ItemList.testItem,
+ 1, 1),
+ text, 40f, 0, 0,
+ Curse.getCurseList().get(
+ page - 1)
.getDisplayName(),
45, 10, false);
break;
case 3:
text = "You can no longer throw any item. I mean, you might need them later, right?";
- Page.addImageTextPage(gui, gui.getLeft() + xPos,
+ Page.addImageTextPage(gui,
+ gui.getLeft() + xPos,
gui.getTop() - 5,
- new ItemStack(ItemList.testItem, 1, 2), text, 40f,
- 0, 0, Curse.getCurseList().get(page - 1)
+ new ItemStack(ItemList.testItem,
+ 1, 2),
+ text, 40f, 0, 0,
+ Curse.getCurseList().get(
+ page - 1)
.getDisplayName(),
45, 10, false);
break;
case 4:
text = "You are blinded. Literally. I mean, what did you expect?";
- Page.addImageTextPage(gui, gui.getLeft() + xPos,
+ Page.addImageTextPage(gui,
+ gui.getLeft() + xPos,
gui.getTop() - 5,
- new ItemStack(ItemList.testItem, 1, 3), text, 40f,
- 0, 0, Curse.getCurseList().get(page - 1)
+ new ItemStack(ItemList.testItem,
+ 1, 3),
+ text, 40f, 0, 0,
+ Curse.getCurseList().get(
+ page - 1)
.getDisplayName(),
45, 10, false);
break;
case 5:
text = "There is a random chance that when you attack a passive mob you will lose a full heart, but gain a black heart.";
- Page.addImageTextPage(gui, gui.getLeft() + xPos,
+ Page.addImageTextPage(gui,
+ gui.getLeft() + xPos,
gui.getTop() - 5,
- new ItemStack(ItemList.testItem, 1, 4), text, 40f,
- 0, 0, Curse.getCurseList().get(page - 1)
+ new ItemStack(ItemList.testItem,
+ 1, 4),
+ text, 40f, 0, 0,
+ Curse.getCurseList().get(
+ page - 1)
.getDisplayName(),
45, 10, false);
break;
case 6:
text = "Whatever you touch turns into gold. Believe me, this is no good to you, you can't even harvest this gold. At lest the items you can't. But if you touched an entity with your bear hands while the curse is active and then no longer have it, you should be able to mine it with an iron pick or higher. THe golden statue will drop gold nuggets depending on the size of the entity.";
- Page.addImageTextPage(gui, gui.getLeft() + xPos,
+ Page.addImageTextPage(gui,
+ gui.getLeft() + xPos,
gui.getTop() - 5,
- new ItemStack(ItemList.testItem, 1, 5), text, 40f,
- 0, 0, Curse.getCurseList().get(page - 1)
+ new ItemStack(ItemList.testItem,
+ 1, 5),
+ text, 40f, 0, 0,
+ Curse.getCurseList().get(
+ page - 1)
.getDisplayName(),
45, 10, false);
break;
case 7:
text = "Entities have a higher chance of dropping more items and hearts when killed.";
- Page.addImageTextPage(gui, gui.getLeft() + xPos,
+ Page.addImageTextPage(gui,
+ gui.getLeft() + xPos,
gui.getTop() - 5,
- new ItemStack(ItemList.testItem, 1, 6), text, 40f,
- 0, 0, Curse.getCurseList().get(page - 1)
+ new ItemStack(ItemList.testItem,
+ 1, 6),
+ text, 40f, 0, 0,
+ Curse.getCurseList().get(
+ page - 1)
.getDisplayName(),
45, 10, false);
break;
case 8:
text = "There is a random chance that you'll steal 1 heart from an entity that is collided with you. If you are low on health, you will heal. If you are fully healed, an extra heart will be added to you. You can steal up to 2 hearts per entity (3 if you complete the challenge). When you steal a heart, that entity will have their max health reduced by 1. Challenges are found in the Achievements menu.";
- Page.addImageTextPage(gui, gui.getLeft() + xPos,
+ Page.addImageTextPage(gui,
+ gui.getLeft() + xPos,
gui.getTop() - 5,
- new ItemStack(ItemList.testItem, 1, 7), text, 40f,
- 0, 0, Curse.getCurseList().get(page - 1)
+ new ItemStack(ItemList.testItem,
+ 1, 7),
+ text, 40f, 0, 0,
+ Curse.getCurseList().get(
+ page - 1)
.getDisplayName(),
45, 10, false);
break;
case 9:
text = "When you attack an entity and are low on health, there is a 50% chance that you'll heal half a heart. Also you will catch on fire if you're exposed to sun.";
- Page.addImageTextPage(gui, gui.getLeft() + xPos,
+ Page.addImageTextPage(gui,
+ gui.getLeft() + xPos,
gui.getTop() - 5,
- new ItemStack(ItemList.testItem, 1, 8), text, 40f,
- 0, 0, Curse.getCurseList().get(page - 1)
+ new ItemStack(ItemList.testItem,
+ 1, 8),
+ text, 40f, 0, 0,
+ Curse.getCurseList().get(
+ page - 1)
.getDisplayName(),
45, 10, false);
break;
case 10:
text = "Any mob you kill or block you destroy(eg. Diamond Ore, Redstone Ore, stuff that drops items not the block itself) drops double the amount of items it normally would.";
- Page.addImageTextPage(gui, gui.getLeft() + xPos,
+ Page.addImageTextPage(gui,
+ gui.getLeft() + xPos,
gui.getTop() - 5,
- new ItemStack(ItemList.testItem, 1, 9), text, 40f,
- 0, 0, Curse.getCurseList().get(page - 1)
+ new ItemStack(ItemList.testItem,
+ 1, 9),
+ text, 40f, 0, 0,
+ Curse.getCurseList().get(
+ page - 1)
.getDisplayName(),
45, 10, false);
break;
case 11:
text = "All the damage you do pierces through armor or any other type of defense, but creatures no longer drop XP.";
- Page.addImageTextPage(gui, gui.getLeft() + xPos,
+ Page.addImageTextPage(gui,
+ gui.getLeft() + xPos,
gui.getTop() - 5,
- new ItemStack(ItemList.testItem, 1, 10), text, 40f,
- 0, 0, Curse.getCurseList().get(page - 1)
+ new ItemStack(ItemList.testItem,
+ 1, 10),
+ text, 40f, 0, 0,
+ Curse.getCurseList().get(
+ page - 1)
.getDisplayName(),
45, 10, false);
break;
diff --git a/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabGemsAndIngots.java b/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabGemsAndIngots.java index 086084f..f161cdd 100755 --- a/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabGemsAndIngots.java +++ b/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabGemsAndIngots.java @@ -47,46 +47,68 @@ public class GuiTabGemsAndIngots extends GuiTab { GL11.glPushMatrix();
if (i == (page - 1) * 12)
gui.getFont().drawString(
- EnumChatFormatting.DARK_BLUE + "\u00a7n"
+ EnumChatFormatting.DARK_BLUE
+ + "\u00a7n"
+ "Gems",
- gui.getLeft() + xPos + 40, gui.getTop(), 0);
+ gui.getLeft() + xPos
+ + 40,
+ gui.getTop(), 0);
GL11.glScalef(scale, scale, 0f);
- gui.getFont().drawString(
- String.format("%-1.26s",
- JewelrycraftUtil.gem.get(i)
- .getDisplayName()),
- (int) ((gui.getLeft() + xPos + 12) / scale),
+ gui.getFont().drawString(String.format(
+ "%-1.26s",
+ JewelrycraftUtil.gem.get(i)
+ .getDisplayName()),
+ (int) ((gui.getLeft()
+ + xPos
+ + 12)
+ / scale),
(int) ((gui.getTop() + 12
- + 12 * (i - 12 * (page - 1))) / scale),
+ + 12 * (i - 12 * (page
+ - 1)))
+ / scale),
0);
GL11.glPopMatrix();
gui.renderItem(JewelrycraftUtil.gem.get(i),
gui.getLeft() + xPos + 5,
- gui.getTop() + 18 + 12 * (i - 12 * (page - 1)),
+ gui.getTop() + 18 + 12 * (i
+ - 12 * (page - 1)),
24f, true, 0, 0, 0);
}
page -= JewelrycraftUtil.gem.size() / 13 + 1;
for (int i = (page - 1) * 12; i < page * 12; i++)
- if (i < JewelrycraftUtil.metal.size() && page > 0) {
+ if (i < JewelrycraftUtil.metal.size()
+ && page > 0) {
GL11.glPushMatrix();
if (i == (page - 1) * 12)
gui.getFont().drawString(
- EnumChatFormatting.DARK_BLUE + "\u00a7n"
+ EnumChatFormatting.DARK_BLUE
+ + "\u00a7n"
+ "Ingots",
- gui.getLeft() + xPos + 40, gui.getTop(), 0);
+ gui.getLeft() + xPos
+ + 40,
+ gui.getTop(), 0);
GL11.glScalef(scale, scale, 0f);
- gui.getFont().drawString(
- String.format("%-1.18s",
- JewelrycraftUtil.metal.get(i).copy()
- .getDisplayName()),
- (int) ((gui.getLeft() + xPos + 12) / scale),
+ gui.getFont().drawString(String.format(
+ "%-1.18s",
+ JewelrycraftUtil.metal
+ .get(i)
+ .copy()
+ .getDisplayName()),
+ (int) ((gui.getLeft()
+ + xPos
+ + 12)
+ / scale),
(int) ((gui.getTop() + 12
- + 12 * (i - 12 * (page - 1))) / scale),
+ + 12 * (i - 12 * (page
+ - 1)))
+ / scale),
0);
GL11.glPopMatrix();
- gui.renderItem(JewelrycraftUtil.metal.get(i),
+ gui.renderItem(JewelrycraftUtil.metal
+ .get(i),
gui.getLeft() + xPos + 5,
- gui.getTop() + 18 + 12 * (i - 12 * (page - 1)),
+ gui.getTop() + 18 + 12 * (i
+ - 12 * (page - 1)),
24f, true, 0, 0, 0);
}
page -= JewelrycraftUtil.metal.size() / 13 + 1;
@@ -95,22 +117,34 @@ public class GuiTabGemsAndIngots extends GuiTab { GL11.glPushMatrix();
if (i == (page - 1) * 12)
gui.getFont().drawString(
- EnumChatFormatting.DARK_BLUE + "\u00a7n"
+ EnumChatFormatting.DARK_BLUE
+ + "\u00a7n"
+ "Ores",
- gui.getLeft() + xPos + 40, gui.getTop(), 0);
+ gui.getLeft() + xPos
+ + 40,
+ gui.getTop(), 0);
GL11.glScalef(scale, scale, 0f);
- gui.getFont().drawString(
- String.format("%-1.18s",
- JewelrycraftUtil.ores.get(i).copy()
- .getDisplayName()),
- (int) ((gui.getLeft() + xPos + 12) / scale),
+ gui.getFont().drawString(String.format(
+ "%-1.18s",
+ JewelrycraftUtil.ores
+ .get(i)
+ .copy()
+ .getDisplayName()),
+ (int) ((gui.getLeft()
+ + xPos
+ + 12)
+ / scale),
(int) ((gui.getTop() + 12
- + 12 * (i - 12 * (page - 1))) / scale),
+ + 12 * (i - 12 * (page
+ - 1)))
+ / scale),
0);
GL11.glPopMatrix();
- gui.renderItem(JewelrycraftUtil.ores.get(i),
+ gui.renderItem(JewelrycraftUtil.ores
+ .get(i),
gui.getLeft() + xPos + 5,
- gui.getTop() + 18 + 12 * (i - 12 * (page - 1)),
+ gui.getTop() + 18 + 12 * (i
+ - 12 * (page - 1)),
24f, true, 0, 0, 0);
}
}
diff --git a/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabIntroduction.java b/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabIntroduction.java index b7b9a62..fe22374 100755 --- a/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabIntroduction.java +++ b/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabIntroduction.java @@ -18,8 +18,8 @@ public class GuiTabIntroduction extends GuiTab { @Override
public String getName() {
- return StatCollector.translateToLocal(
- "guide." + Variables.MODID + ".tab.introduction");
+ return StatCollector.translateToLocal("guide."
+ + Variables.MODID + ".tab.introduction");
}
@Override
@@ -28,16 +28,20 @@ public class GuiTabIntroduction extends GuiTab { int xPos = page % 2 == 0 ? 107 : -35;
switch (page) {
case 1:
- text = StatCollector.translateToLocal("guide."
- + Variables.MODID + ".tab.introduction." + page);
- Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(),
- text);
+ text = StatCollector.translateToLocal(
+ "guide." + Variables.MODID
+ + ".tab.introduction."
+ + page);
+ Page.addTextPage(gui, gui.getLeft() + xPos,
+ gui.getTop(), text);
break;
case 2:
- text = StatCollector.translateToLocal("guide."
- + Variables.MODID + ".tab.introduction." + page);
- Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(),
- text);
+ text = StatCollector.translateToLocal(
+ "guide." + Variables.MODID
+ + ".tab.introduction."
+ + page);
+ Page.addTextPage(gui, gui.getLeft() + xPos,
+ gui.getTop(), text);
break;
}
}
diff --git a/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabItems.java b/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabItems.java index a741af3..5b9bf55 100755 --- a/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabItems.java +++ b/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabItems.java @@ -51,68 +51,99 @@ public class GuiTabItems extends GuiTab { switch (page) {
case 1:
text = "Shadow ingots are obtained by smelting shadow ore. They are used in a few recipes and an important key for making some jewelry work.";
- Page.addSmeltingRecipeTextPage(gui, gui.getLeft() + xPos,
- gui.getTop(), text, x, y, true,
+ Page.addSmeltingRecipeTextPage(gui,
+ gui.getLeft() + xPos,
+ gui.getTop(), text, x, y,
+ true,
new ItemStack(BlockList.shadowOre),
new ItemStack(ItemList.shadowIngot));
break;
case 2:
text = "These gloves give you the chance to steal the trades those pesky Testificates have to offer. To use these simply open their gui at least once, then Crouch and right click on the them to hopefully steal the trades. If you traded with him before, then you have a chance of getting the traded";
- Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos,
- gui.getTop(), false, text, x, y, true,
+ Page.addCraftingRecipeTextPage(gui,
+ gui.getLeft() + xPos,
+ gui.getTop(), false, text,
+ x, y, true,
new ItemStack(ItemList.thiefGloves),
- new ItemStack(ItemList.shadowIngot), null,
new ItemStack(ItemList.shadowIngot),
- new ItemStack(Blocks.wool, 1, 15),
+ null,
new ItemStack(ItemList.shadowIngot),
- new ItemStack(Blocks.wool, 1, 15),
- new ItemStack(Blocks.wool, 1, 15),
+ new ItemStack(Blocks.wool,
+ 1, 15),
new ItemStack(ItemList.shadowIngot),
- new ItemStack(Blocks.wool, 1, 15));
+ new ItemStack(Blocks.wool,
+ 1, 15),
+ new ItemStack(Blocks.wool,
+ 1, 15),
+ new ItemStack(ItemList.shadowIngot),
+ new ItemStack(Blocks.wool,
+ 1, 15));
break;
case 3:
text = "emeralds back as well. This has a maximum of 10 uses before it breaks.";
- Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(),
- text);
+ Page.addTextPage(gui, gui.getLeft() + xPos,
+ gui.getTop(), text);
break;
case 4:
text = "In order to get the ingot back from the smelter you need a mold for it. However, this mold can't be used. It is too soft. It needs to be hardened in order for it to be used.";
- Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos,
- gui.getTop(), true, text, x, y, true,
- new ItemStack(ItemList.clayMolds, 1, 0),
+ Page.addCraftingRecipeTextPage(gui,
+ gui.getLeft() + xPos,
+ gui.getTop(), true, text,
+ x, y, true,
+ new ItemStack(ItemList.clayMolds,
+ 1, 0),
new ItemStack(Items.clay_ball),
new ItemStack(Items.clay_ball));
break;
case 5:
text = "To create a ring you need a mold for it. However, this one is too soft to be used. It needs to be hardened in order for it to be used.";
- Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos,
- gui.getTop(), false, text, x, y, true,
- new ItemStack(ItemList.clayMolds, 1, 1), null,
- new ItemStack(Items.clay_ball), null,
- new ItemStack(Items.clay_ball), null,
- new ItemStack(Items.clay_ball), null,
- new ItemStack(Items.clay_ball), null);
+ Page.addCraftingRecipeTextPage(gui,
+ gui.getLeft() + xPos,
+ gui.getTop(), false, text,
+ x, y, true,
+ new ItemStack(ItemList.clayMolds,
+ 1, 1),
+ null,
+ new ItemStack(Items.clay_ball),
+ null,
+ new ItemStack(Items.clay_ball),
+ null,
+ new ItemStack(Items.clay_ball),
+ null,
+ new ItemStack(Items.clay_ball),
+ null);
break;
case 6:
text = "To create a necklace you need a mold for it. However, this one can't be used. It is too soft. It needs to be hardened in order for it to be used.";
- Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos,
- gui.getTop(), false, text, x, y, true,
- new ItemStack(ItemList.clayMolds, 1, 2),
- new ItemStack(Items.clay_ball), null,
- new ItemStack(Items.clay_ball),
- new ItemStack(Items.clay_ball), null,
- new ItemStack(Items.clay_ball), null,
- new ItemStack(Items.clay_ball), null);
+ Page.addCraftingRecipeTextPage(gui,
+ gui.getLeft() + xPos,
+ gui.getTop(), false, text,
+ x, y, true,
+ new ItemStack(ItemList.clayMolds,
+ 1, 2),
+ new ItemStack(Items.clay_ball),
+ null,
+ new ItemStack(Items.clay_ball),
+ new ItemStack(Items.clay_ball),
+ null,
+ new ItemStack(Items.clay_ball),
+ null,
+ new ItemStack(Items.clay_ball),
+ null);
break;
case 7:
text = "To create a bracelet you need a mold for it. However, this one can't be used. It is too soft. It needs to be hardened in order for it to be used.";
- Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos,
- gui.getTop(), false, text, x, y, true,
- new ItemStack(ItemList.clayMolds, 1, 3),
+ Page.addCraftingRecipeTextPage(gui,
+ gui.getLeft() + xPos,
+ gui.getTop(), false, text,
+ x, y, true,
+ new ItemStack(ItemList.clayMolds,
+ 1, 3),
new ItemStack(Items.clay_ball),
new ItemStack(Items.clay_ball),
new ItemStack(Items.clay_ball),
- new ItemStack(Items.clay_ball), null,
+ new ItemStack(Items.clay_ball),
+ null,
new ItemStack(Items.clay_ball),
new ItemStack(Items.clay_ball),
new ItemStack(Items.clay_ball),
@@ -120,11 +151,17 @@ public class GuiTabItems extends GuiTab { break;
case 8:
text = "To create earrings you need a mold for them. However, this one can't be used. It is too soft. It needs to be hardened in order for it to be used.";
- Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos,
- gui.getTop(), false, text, x, y, true,
- new ItemStack(ItemList.clayMolds, 1, 4), null,
- null, null, new ItemStack(Items.clay_ball), null,
- new ItemStack(Items.clay_ball), null, null, null);
+ Page.addCraftingRecipeTextPage(gui,
+ gui.getLeft() + xPos,
+ gui.getTop(), false, text,
+ x, y, true,
+ new ItemStack(ItemList.clayMolds,
+ 1, 4),
+ null, null, null,
+ new ItemStack(Items.clay_ball),
+ null,
+ new ItemStack(Items.clay_ball),
+ null, null, null);
break;
case 9:
if (del == 0)
@@ -135,10 +172,15 @@ public class GuiTabItems extends GuiTab { if (values > 4)
values = 0;
text = "By smelting a clay mold you get a harder version which can be used to create jewelry. Simply right click with this on a molder to attach it and you're ready to go.";
- Page.addSmeltingRecipeTextPage(gui, gui.getLeft() + xPos,
- gui.getTop(), text, x, y, true,
- new ItemStack(ItemList.clayMolds, 1, values),
- new ItemStack(ItemList.molds, 1, values));
+ Page.addSmeltingRecipeTextPage(gui,
+ gui.getLeft() + xPos,
+ gui.getTop(), text, x, y,
+ true,
+ new ItemStack(ItemList.clayMolds,
+ 1, values),
+ new ItemStack(ItemList.molds,
+ 1,
+ values));
break;
case 10:
if (del == 0)
@@ -149,58 +191,73 @@ public class GuiTabItems extends GuiTab { if (values > 4)
values = 0;
text = "It's this exact guide. I don't even know why you're reading this. I added this recipe in case you lose the original. Even if this is more helpful than NEI, I do suggest installing it so you can see all the recipes. Since you are reading this, how about making a youtube video spotlighting this mod. I'd really";
- Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos,
- gui.getTop(), true, text, x, y, true,
+ Page.addCraftingRecipeTextPage(gui,
+ gui.getLeft() + xPos,
+ gui.getTop(), true, text,
+ x, y, true,
new ItemStack(ItemList.guide),
- new ItemStack(ItemList.molds, 1, values),
+ new ItemStack(ItemList.molds,
+ 1, values),
new ItemStack(Items.book));
break;
case 11:
String link = "HERE";
- if (x >= gui.getLeft() - 7 && x <= gui.getLeft() + 10
+ if (x >= gui.getLeft() - 7
+ && x <= gui.getLeft() + 10
&& y >= gui.getTop() + 20
&& y <= gui.getTop() + 34)
- link = EnumChatFormatting.DARK_BLUE + "HERE"
+ link = EnumChatFormatting.DARK_BLUE
+ + "HERE"
+ EnumChatFormatting.BLACK;
text = "appreciate it. After that you can share it in the main thread "
+ link + ".";
- Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(),
- text);
+ Page.addTextPage(gui, gui.getLeft() + xPos,
+ gui.getTop(), text);
break;
case 12:
- ItemStack item = new ItemStack(ItemList.bucket);
+ ItemStack item = new ItemStack(
+ ItemList.bucket);
if (del == 0)
values++;
del++;
if (del >= 50)
del = 0;
- if (values > JewelrycraftUtil.metal.size() - 1)
+ if (values > JewelrycraftUtil.metal.size()
+ - 1)
values = 0;
JewelryNBT.addMetal(item,
- JewelrycraftUtil.metal.get(values).copy());
+ JewelrycraftUtil.metal.get(
+ values)
+ .copy());
text = "These buckets contain molten metal. To obtain one simply Right Click a full Smelter to get a bucket. You can pour the metal, other than that it has no use. You can place the molten metal back in a Smelter by Right Clicking one with it.";
- Page.addImageTextPage(gui, gui.getLeft() + xPos,
- gui.getTop() - 5, item, text, 40f, 0, 0, true, 45,
+ Page.addImageTextPage(gui,
+ gui.getLeft() + xPos,
+ gui.getTop() - 5, item,
+ text, 40f, 0, 0, true, 45,
10, false);
break;
case 13:
text = "This item is a creative only item! Right click it while in creative mode to open a GUI. Place a piece of jewelery inside the slot, select what you want to add, then click on 'Add Items'. If you selected Modifiers, you can select multiple items at once. The 'Item' button is to add an Item to a Golden Object, which can not be obtained normally. This tool can be really useful, especially for those";
- Page.addImageTextPage(gui, gui.getLeft() + xPos,
+ Page.addImageTextPage(gui,
+ gui.getLeft() + xPos,
gui.getTop() - 5,
- new ItemStack(ItemList.jewelryModifier), text, 40f,
- 0, 0, true, 45, 10, false);
+ new ItemStack(ItemList.jewelryModifier),
+ text, 40f, 0, 0, true, 45,
+ 10, false);
break;
case 14:
text = "who want to test the mod and can't wait for the normal processes to finish (Smelter, Jeweler's Table, Ritual).";
- Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(),
- text);
+ Page.addTextPage(gui, gui.getLeft() + xPos,
+ gui.getTop(), text);
break;
case 15:
text = "This item is a creative only item! If you right click in the air while holding this item you'll increment the number of the structure to spawn. Crouch and right click to go backwards. To spawn a structure simply right click on a block with this.";
- Page.addImageTextPage(gui, gui.getLeft() + xPos,
+ Page.addImageTextPage(gui,
+ gui.getLeft() + xPos,
gui.getTop() - 5,
- new ItemStack(ItemList.structureGen), text, 40f, 0,
- 0, true, 45, 10, false);
+ new ItemStack(ItemList.structureGen),
+ text, 40f, 0, 0, true, 45,
+ 10, false);
break;
default:
;
@@ -224,11 +281,12 @@ public class GuiTabItems extends GuiTab { @Override
public void mouseClick(GuiGuide gui, int x, int y, int button) {
if (gui.page == 11 && x >= gui.getLeft() - 7
- && x <= gui.getLeft() + 10 && y >= gui.getTop() + 20
+ && x <= gui.getLeft() + 10
+ && y >= gui.getTop() + 20
&& y <= gui.getTop() + 34)
try {
- Desktop.getDesktop().browse(
- new URL("http://minecraft.curseforge.com/mc-mods/229927-jewelrycraft-2")
+ Desktop.getDesktop().browse(new URL(
+ "http://minecraft.curseforge.com/mc-mods/229927-jewelrycraft-2")
.toURI());
} catch (Exception e) {
}
diff --git a/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabModifiers.java b/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabModifiers.java index 91f5873..cf22586 100755 --- a/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabModifiers.java +++ b/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabModifiers.java @@ -16,8 +16,8 @@ public class GuiTabModifiers extends GuiTab { @Override
public String getName() {
- return StatCollector.translateToLocal(
- "guide." + Variables.MODID + ".tab.modifiers");
+ return StatCollector.translateToLocal("guide."
+ + Variables.MODID + ".tab.modifiers");
}
/**
@@ -41,38 +41,47 @@ public class GuiTabModifiers extends GuiTab { switch (page) {
case 1:
text = "Although you can add anything as a modifier, only some objects have an effect. In this tab you can find all modifiers that have a use and what they do, in the form of a story/riddle/poem. However, different jewellery have different effects for the same modifier.";
- Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(),
- text);
+ Page.addTextPage(gui, gui.getLeft() + xPos,
+ gui.getTop(), text);
break;
case 2:
text = "The ancient ones talked about a rising fire in your heart. Fret do not, for flames do not burn, but water might sting a turn. Watch your step, do not be cocky, for its protection is a bit sloppy.";
- Page.addImageTextPage(gui, gui.getLeft() + xPos,
+ Page.addImageTextPage(gui,
+ gui.getLeft() + xPos,
gui.getTop() - 10,
- new ItemStack(Items.blaze_powder), text, 40f,
- true);
+ new ItemStack(Items.blaze_powder),
+ text, 40f, true);
break;
case 3:
text = "Light and swift as a feather can be good all together. Enemies miss and get confused, this power can be abused. Against an arrow you can't compare, so move around, don't just stare. Fire is your enemy and weakness is the penalty.";
- Page.addImageTextPage(gui, gui.getLeft() + xPos,
- gui.getTop() - 10, new ItemStack(Items.feather),
+ Page.addImageTextPage(gui,
+ gui.getLeft() + xPos,
+ gui.getTop() - 10,
+ new ItemStack(Items.feather),
text, 40f, true);
break;
case 4:
text = "Endermen may tolerate you, end portals are near too, you may find ore that is true. But be careful, for the power may make you dizzy, blind you if you're a sissy, worsen your vision if you're unaware and shift positions everywhere.";
- Page.addImageTextPage(gui, gui.getLeft() + xPos,
- gui.getTop() - 10, new ItemStack(Items.ender_eye),
+ Page.addImageTextPage(gui,
+ gui.getLeft() + xPos,
+ gui.getTop() - 10,
+ new ItemStack(Items.ender_eye),
text, 40f, true);
break;
case 5:
text = "Through the power of a pearl arrows don't know where to go. In confusion they can explode, making you a helpless toad. But if an enemy hits, they get damaged like a blitz. You may be weaker, water is bad, but you get saved if health is weak like a lilly pad.";
- Page.addImageTextPage(gui, gui.getLeft() + xPos,
+ Page.addImageTextPage(gui,
+ gui.getLeft() + xPos,
gui.getTop() - 10,
- new ItemStack(Items.ender_pearl), text, 40f, true);
+ new ItemStack(Items.ender_pearl),
+ text, 40f, true);
break;
case 6:
text = "Toughest stone made on Earth, falling damage is absurd. Deal more damage, more protection, anvils and arrows need inspection. But after long and hard abuse, the stone is starting to get loose. You are weak and heavy, sink like a ship, arrows need only one hit, deal less damage overall, don't abuse its power now.";
- Page.addImageTextPage(gui, gui.getLeft() + xPos,
- gui.getTop() - 10, new ItemStack(Blocks.obsidian),
+ Page.addImageTextPage(gui,
+ gui.getLeft() + xPos,
+ gui.getTop() - 10,
+ new ItemStack(Blocks.obsidian),
text, 40f, true);
break;
}
diff --git a/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabOresToIngots.java b/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabOresToIngots.java index 71ad370..36a8a1e 100755 --- a/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabOresToIngots.java +++ b/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabOresToIngots.java @@ -18,8 +18,8 @@ public class GuiTabOresToIngots extends GuiTab { @Override
public String getName() {
- return StatCollector.translateToLocal(
- "guide." + Variables.MODID + ".tab.oretoingot");
+ return StatCollector.translateToLocal("guide."
+ + Variables.MODID + ".tab.oretoingot");
}
/**
@@ -40,27 +40,39 @@ public class GuiTabOresToIngots extends GuiTab { public void drawBackground(GuiGuide gui, int x, int y, int page) {
int xPos = page % 2 == 0 ? 107 : -35;
GL11.glEnable(GL11.GL_BLEND);
- GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
+ GL11.glBlendFunc(GL11.GL_SRC_ALPHA,
+ GL11.GL_ONE_MINUS_SRC_ALPHA);
int i = 0;
- for (ItemStack ore : JewelrycraftUtil.oreToIngot.keySet()) {
+ for (ItemStack ore : JewelrycraftUtil.oreToIngot
+ .keySet()) {
if (i >= (page - 1) * 5 && i < page * 5) {
- gui.renderItem(ore, gui.getLeft() + xPos + 10,
- gui.getTop() + 12 + 32 * (i - 5 * (page - 1)), 30f,
- true, 0, 0, 0);
- gui.renderItem(JewelrycraftUtil.oreToIngot.get(ore),
+ gui.renderItem(ore,
gui.getLeft() + xPos + 10,
- gui.getTop() + 28 + 32 * (i - 5 * (page - 1)), 30f,
- true, 0, 0, 0);
- gui.getFont().drawString(
- String.format("%-1.18s", ore.getDisplayName()),
+ gui.getTop() + 12 + 32 * (i
+ - 5 * (page - 1)),
+ 30f, true, 0, 0, 0);
+ gui.renderItem(JewelrycraftUtil.oreToIngot
+ .get(ore),
+ gui.getLeft() + xPos + 10,
+ gui.getTop() + 28 + 32 * (i
+ - 5 * (page - 1)),
+ 30f, true, 0, 0, 0);
+ gui.getFont().drawString(String.format(
+ "%-1.18s",
+ ore.getDisplayName()),
gui.getLeft() + xPos + 20,
- gui.getTop() + 2 + 32 * (i - 5 * (page - 1)), 0);
- gui.getFont().drawString(
- String.format("%-1.18s",
- JewelrycraftUtil.oreToIngot.get(ore)
- .getDisplayName()),
+ gui.getTop() + 2 + 32 * (i
+ - 5 * (page - 1)),
+ 0);
+ gui.getFont().drawString(String.format(
+ "%-1.18s",
+ JewelrycraftUtil.oreToIngot
+ .get(ore)
+ .getDisplayName()),
gui.getLeft() + xPos + 20,
- gui.getTop() + 18 + 32 * (i - 5 * (page - 1)), 0);
+ gui.getTop() + 18 + 32 * (i
+ - 5 * (page - 1)),
+ 0);
GL11.glDisable(GL11.GL_LIGHTING);
}
i++;
diff --git a/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabRitual.java b/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabRitual.java index dd4df87..863aa09 100755 --- a/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabRitual.java +++ b/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabRitual.java @@ -15,8 +15,8 @@ public class GuiTabRitual extends GuiTab { @Override
public String getName() {
- return StatCollector.translateToLocal(
- "guide." + Variables.MODID + ".tab.ritual");
+ return StatCollector.translateToLocal("guide."
+ + Variables.MODID + ".tab.ritual");
}
@Override
@@ -30,199 +30,389 @@ public class GuiTabRitual extends GuiTab { switch (page) {
case 1:
Page.drawText(gui,
- EnumChatFormatting.DARK_BLUE + "\u00a7n"
+ EnumChatFormatting.DARK_BLUE
+ + "\u00a7n"
+ "Layer 1",
- gui.getLeft() + xPos + 35, gui.getTop() - 30);
+ gui.getLeft() + xPos + 35,
+ gui.getTop() - 30);
for (int i = -1; i < 10; i++)
for (int j = 0; j < 11; j++)
- Page.addSlotItem(gui,
- gui.getLeft() + xPos + 11 * i,
- gui.getTop() + 11 * j, x, y,
- new ItemStack(Blocks.air), 0, 0, 0);
- Page.addSlotItem(gui, gui.getLeft() + xPos + 11 * 8,
- gui.getTop() + 11 * 1, x, y,
- new ItemStack(Blocks.stonebrick), 0, 0, 0);
- Page.addSlotItem(gui, gui.getLeft() + xPos + 11 * 0,
- gui.getTop() + 11 * 1, x, y,
- new ItemStack(Blocks.stonebrick), 0, 0, 0);
- Page.addSlotItem(gui, gui.getLeft() + xPos + 11 * 8,
- gui.getTop() + 11 * 9, x, y,
- new ItemStack(Blocks.stonebrick), 0, 0, 0);
- Page.addSlotItem(gui, gui.getLeft() + xPos + 11 * 0,
- gui.getTop() + 11 * 9, x, y,
- new ItemStack(Blocks.stonebrick), 0, 0, 0);
+ Page.addSlotItem(gui, gui
+ .getLeft()
+ + xPos
+ + 11 * i,
+ gui.getTop() + 11
+ * j,
+ x, y,
+ new ItemStack(Blocks.air),
+ 0, 0, 0);
+ Page.addSlotItem(gui,
+ gui.getLeft() + xPos
+ + 11 * 8,
+ gui.getTop() + 11 * 1, x,
+ y,
+ new ItemStack(Blocks.stonebrick),
+ 0, 0, 0);
+ Page.addSlotItem(gui,
+ gui.getLeft() + xPos
+ + 11 * 0,
+ gui.getTop() + 11 * 1, x,
+ y,
+ new ItemStack(Blocks.stonebrick),
+ 0, 0, 0);
+ Page.addSlotItem(gui,
+ gui.getLeft() + xPos
+ + 11 * 8,
+ gui.getTop() + 11 * 9, x,
+ y,
+ new ItemStack(Blocks.stonebrick),
+ 0, 0, 0);
+ Page.addSlotItem(gui,
+ gui.getLeft() + xPos
+ + 11 * 0,
+ gui.getTop() + 11 * 9, x,
+ y,
+ new ItemStack(Blocks.stonebrick),
+ 0, 0, 0);
// Top
- Page.addSlotItem(gui, gui.getLeft() + xPos + 11 * 2,
- gui.getTop() + 11 * 1, x, y,
- new ItemStack(BlockList.handPedestal), 0, 45, 0);
- Page.addSlotItem(gui, gui.getLeft() + xPos + 11 * 4,
- gui.getTop() + 11 * 0, x, y,
- new ItemStack(BlockList.handPedestal), 0, 0, 0);
- Page.addSlotItem(gui, gui.getLeft() + xPos + 11 * 6,
- gui.getTop() + 11 * 1, x, y,
- new ItemStack(BlockList.handPedestal), 0, -45, 0);
+ Page.addSlotItem(gui,
+ gui.getLeft() + xPos
+ + 11 * 2,
+ gui.getTop() + 11 * 1, x,
+ y,
+ new ItemStack(BlockList.handPedestal),
+ 0, 45, 0);
+ Page.addSlotItem(gui,
+ gui.getLeft() + xPos
+ + 11 * 4,
+ gui.getTop() + 11 * 0, x,
+ y,
+ new ItemStack(BlockList.handPedestal),
+ 0, 0, 0);
+ Page.addSlotItem(gui,
+ gui.getLeft() + xPos
+ + 11 * 6,
+ gui.getTop() + 11 * 1, x,
+ y,
+ new ItemStack(BlockList.handPedestal),
+ 0, -45, 0);
// Left
- Page.addSlotItem(gui, gui.getLeft() + xPos + 11 * 0,
- gui.getTop() + 11 * 3, x, y,
- new ItemStack(BlockList.handPedestal), 0, 45, 0);
- Page.addSlotItem(gui, gui.getLeft() + xPos + 11 * -1,
- gui.getTop() + 11 * 5, x, y,
- new ItemStack(BlockList.handPedestal), 0, 90, 0);
- Page.addSlotItem(gui, gui.getLeft() + xPos + 11 * 0,
- gui.getTop() + 11 * 7, x, y,
- new ItemStack(BlockList.handPedestal), 0, 135, 0);
+ Page.addSlotItem(gui,
+ gui.getLeft() + xPos
+ + 11 * 0,
+ gui.getTop() + 11 * 3, x,
+ y,
+ new ItemStack(BlockList.handPedestal),
+ 0, 45, 0);
+ Page.addSlotItem(gui,
+ gui.getLeft() + xPos
+ + 11 * -1,
+ gui.getTop() + 11 * 5, x,
+ y,
+ new ItemStack(BlockList.handPedestal),
+ 0, 90, 0);
+ Page.addSlotItem(gui,
+ gui.getLeft() + xPos
+ + 11 * 0,
+ gui.getTop() + 11 * 7, x,
+ y,
+ new ItemStack(BlockList.handPedestal),
+ 0, 135, 0);
// Bottom
- Page.addSlotItem(gui, gui.getLeft() + xPos + 11 * 2,
- gui.getTop() + 11 * 9, x, y,
- new ItemStack(BlockList.handPedestal), 0, 135, 0);
- Page.addSlotItem(gui, gui.getLeft() + xPos + 11 * 4,
- gui.getTop() + 11 * 10, x, y,
- new ItemStack(BlockList.handPedestal), 0, 180, 0);
- Page.addSlotItem(gui, gui.getLeft() + xPos + 11 * 6,
- gui.getTop() + 11 * 9, x, y,
- new ItemStack(BlockList.handPedestal), 0, 225, 0);
+ Page.addSlotItem(gui,
+ gui.getLeft() + xPos
+ + 11 * 2,
+ gui.getTop() + 11 * 9, x,
+ y,
+ new ItemStack(BlockList.handPedestal),
+ 0, 135, 0);
+ Page.addSlotItem(gui,
+ gui.getLeft() + xPos
+ + 11 * 4,
+ gui.getTop() + 11 * 10, x,
+ y,
+ new ItemStack(BlockList.handPedestal),
+ 0, 180, 0);
+ Page.addSlotItem(gui,
+ gui.getLeft() + xPos
+ + 11 * 6,
+ gui.getTop() + 11 * 9, x,
+ y,
+ new ItemStack(BlockList.handPedestal),
+ 0, 225, 0);
// Right
- Page.addSlotItem(gui, gui.getLeft() + xPos + 11 * 8,
- gui.getTop() + 11 * 3, x, y,
- new ItemStack(BlockList.handPedestal), 0, -35, 0);
- Page.addSlotItem(gui, gui.getLeft() + xPos + 11 * 9,
- gui.getTop() + 11 * 5, x, y,
- new ItemStack(BlockList.handPedestal), 0, 270, 0);
- Page.addSlotItem(gui, gui.getLeft() + xPos + 11 * 8,
- gui.getTop() + 11 * 7, x, y,
- new ItemStack(BlockList.handPedestal), 0, 225, 0);
-
- Page.addSlotItem(gui, gui.getLeft() + xPos + 11 * 2,
- gui.getTop() + 11 * 5, x, y,
- new ItemStack(Blocks.stonebrick), 0, 0, 0);
- Page.addSlotItem(gui, gui.getLeft() + xPos + 11 * 4,
- gui.getTop() + 11 * 5, x, y,
- new ItemStack(BlockList.handPedestal), 0, 0, 0);
- Page.addSlotItem(gui, gui.getLeft() + xPos + 11 * 6,
- gui.getTop() + 11 * 5, x, y,
- new ItemStack(Blocks.stonebrick), 0, 0, 0);
+ Page.addSlotItem(gui,
+ gui.getLeft() + xPos
+ + 11 * 8,
+ gui.getTop() + 11 * 3, x,
+ y,
+ new ItemStack(BlockList.handPedestal),
+ 0, -35, 0);
+ Page.addSlotItem(gui,
+ gui.getLeft() + xPos
+ + 11 * 9,
+ gui.getTop() + 11 * 5, x,
+ y,
+ new ItemStack(BlockList.handPedestal),
+ 0, 270, 0);
+ Page.addSlotItem(gui,
+ gui.getLeft() + xPos
+ + 11 * 8,
+ gui.getTop() + 11 * 7, x,
+ y,
+ new ItemStack(BlockList.handPedestal),
+ 0, 225, 0);
+
+ Page.addSlotItem(gui,
+ gui.getLeft() + xPos
+ + 11 * 2,
+ gui.getTop() + 11 * 5, x,
+ y,
+ new ItemStack(Blocks.stonebrick),
+ 0, 0, 0);
+ Page.addSlotItem(gui,
+ gui.getLeft() + xPos
+ + 11 * 4,
+ gui.getTop() + 11 * 5, x,
+ y,
+ new ItemStack(BlockList.handPedestal),
+ 0, 0, 0);
+ Page.addSlotItem(gui,
+ gui.getLeft() + xPos
+ + 11 * 6,
+ gui.getTop() + 11 * 5, x,
+ y,
+ new ItemStack(Blocks.stonebrick),
+ 0, 0, 0);
break;
case 2:
Page.drawText(gui,
- EnumChatFormatting.DARK_BLUE + "\u00a7n"
+ EnumChatFormatting.DARK_BLUE
+ + "\u00a7n"
+ "Layer 2",
- gui.getLeft() + xPos + 35, gui.getTop() - 30);
+ gui.getLeft() + xPos + 35,
+ gui.getTop() - 30);
for (int i = -1; i < 10; i++)
for (int j = 0; j < 11; j++)
- Page.addSlotItem(gui,
- gui.getLeft() + xPos + 11 * i,
- gui.getTop() + 11 * j, x, y,
- new ItemStack(Blocks.air), 0, 0, 0);
- Page.addSlotItem(gui, gui.getLeft() + xPos + 11 * 8,
- gui.getTop() + 11 * 1, x, y,
- new ItemStack(Blocks.stonebrick), 0, 0, 0);
- Page.addSlotItem(gui, gui.getLeft() + xPos + 11 * 0,
- gui.getTop() + 11 * 1, x, y,
- new ItemStack(Blocks.stonebrick), 0, 0, 0);
- Page.addSlotItem(gui, gui.getLeft() + xPos + 11 * 8,
- gui.getTop() + 11 * 9, x, y,
- new ItemStack(Blocks.stonebrick), 0, 0, 0);
- Page.addSlotItem(gui, gui.getLeft() + xPos + 11 * 0,
- gui.getTop() + 11 * 9, x, y,
- new ItemStack(Blocks.stonebrick), 0, 0, 0);
-
- Page.addSlotItem(gui, gui.getLeft() + xPos + 11 * 2,
- gui.getTop() + 11 * 5, x, y,
- new ItemStack(Blocks.stonebrick), 0, 0, 0);
- Page.addSlotItem(gui, gui.getLeft() + xPos + 11 * 6,
- gui.getTop() + 11 * 5, x, y,
- new ItemStack(Blocks.stonebrick), 0, 0, 0);
+ Page.addSlotItem(gui, gui
+ .getLeft()
+ + xPos
+ + 11 * i,
+ gui.getTop() + 11
+ * j,
+ x, y,
+ new ItemStack(Blocks.air),
+ 0, 0, 0);
+ Page.addSlotItem(gui,
+ gui.getLeft() + xPos
+ + 11 * 8,
+ gui.getTop() + 11 * 1, x,
+ y,
+ new ItemStack(Blocks.stonebrick),
+ 0, 0, 0);
+ Page.addSlotItem(gui,
+ gui.getLeft() + xPos
+ + 11 * 0,
+ gui.getTop() + 11 * 1, x,
+ y,
+ new ItemStack(Blocks.stonebrick),
+ 0, 0, 0);
+ Page.addSlotItem(gui,
+ gui.getLeft() + xPos
+ + 11 * 8,
+ gui.getTop() + 11 * 9, x,
+ y,
+ new ItemStack(Blocks.stonebrick),
+ 0, 0, 0);
+ Page.addSlotItem(gui,
+ gui.getLeft() + xPos
+ + 11 * 0,
+ gui.getTop() + 11 * 9, x,
+ y,
+ new ItemStack(Blocks.stonebrick),
+ 0, 0, 0);
+
+ Page.addSlotItem(gui,
+ gui.getLeft() + xPos
+ + 11 * 2,
+ gui.getTop() + 11 * 5, x,
+ y,
+ new ItemStack(Blocks.stonebrick),
+ 0, 0, 0);
+ Page.addSlotItem(gui,
+ gui.getLeft() + xPos
+ + 11 * 6,
+ gui.getTop() + 11 * 5, x,
+ y,
+ new ItemStack(Blocks.stonebrick),
+ 0, 0, 0);
break;
case 3:
Page.drawText(gui,
- EnumChatFormatting.DARK_BLUE + "\u00a7n"
+ EnumChatFormatting.DARK_BLUE
+ + "\u00a7n"
+ "Layer 3",
- gui.getLeft() + xPos + 35, gui.getTop() - 30);
+ gui.getLeft() + xPos + 35,
+ gui.getTop() - 30);
for (int i = -1; i < 10; i++)
for (int j = 0; j < 11; j++)
- Page.addSlotItem(gui,
- gui.getLeft() + xPos + 11 * i,
- gui.getTop() + 11 * j, x, y,
- new ItemStack(Blocks.air), 0, 0, 0);
- Page.addSlotItem(gui, gui.getLeft() + xPos + 11 * 8,
- gui.getTop() + 11 * 1, x, y,
- new ItemStack(BlockList.shadowBlock), 0, 0, 0);
- Page.addSlotItem(gui, gui.getLeft() + xPos + 11 * 0,
- gui.getTop() + 11 * 1, x, y,
- new ItemStack(BlockList.shadowBlock), 0, 0, 0);
- Page.addSlotItem(gui, gui.getLeft() + xPos + 11 * 8,
- gui.getTop() + 11 * 9, x, y,
- new ItemStack(BlockList.shadowBlock), 0, 0, 0);
- Page.addSlotItem(gui, gui.getLeft() + xPos + 11 * 0,
- gui.getTop() + 11 * 9, x, y,
- new ItemStack(BlockList.shadowBlock), 0, 0, 0);
-
- Page.addSlotItem(gui, gui.getLeft() + xPos + 11 * 2,
- gui.getTop() + 11 * 5, x, y,
- new ItemStack(Blocks.stonebrick), 0, 0, 0);
- Page.addSlotItem(gui, gui.getLeft() + xPos + 11 * 6,
- gui.getTop() + 11 * 5, x, y,
- new ItemStack(Blocks.stonebrick), 0, 0, 0);
+ Page.addSlotItem(gui, gui
+ .getLeft()
+ + xPos
+ + 11 * i,
+ gui.getTop() + 11
+ * j,
+ x, y,
+ new ItemStack(Blocks.air),
+ 0, 0, 0);
+ Page.addSlotItem(gui,
+ gui.getLeft() + xPos
+ + 11 * 8,
+ gui.getTop() + 11 * 1, x,
+ y,
+ new ItemStack(BlockList.shadowBlock),
+ 0, 0, 0);
+ Page.addSlotItem(gui,
+ gui.getLeft() + xPos
+ + 11 * 0,
+ gui.getTop() + 11 * 1, x,
+ y,
+ new ItemStack(BlockList.shadowBlock),
+ 0, 0, 0);
+ Page.addSlotItem(gui,
+ gui.getLeft() + xPos
+ + 11 * 8,
+ gui.getTop() + 11 * 9, x,
+ y,
+ new ItemStack(BlockList.shadowBlock),
+ 0, 0, 0);
+ Page.addSlotItem(gui,
+ gui.getLeft() + xPos
+ + 11 * 0,
+ gui.getTop() + 11 * 9, x,
+ y,
+ new ItemStack(BlockList.shadowBlock),
+ 0, 0, 0);
+
+ Page.addSlotItem(gui,
+ gui.getLeft() + xPos
+ + 11 * 2,
+ gui.getTop() + 11 * 5, x,
+ y,
+ new ItemStack(Blocks.stonebrick),
+ 0, 0, 0);
+ Page.addSlotItem(gui,
+ gui.getLeft() + xPos
+ + 11 * 6,
+ gui.getTop() + 11 * 5, x,
+ y,
+ new ItemStack(Blocks.stonebrick),
+ 0, 0, 0);
break;
case 4:
Page.drawText(gui,
- EnumChatFormatting.DARK_BLUE + "\u00a7n"
+ EnumChatFormatting.DARK_BLUE
+ + "\u00a7n"
+ "Layer 4",
- gui.getLeft() + xPos + 35, gui.getTop() - 30);
+ gui.getLeft() + xPos + 35,
+ gui.getTop() - 30);
for (int i = -1; i < 10; i++)
for (int j = 0; j < 11; j++)
- Page.addSlotItem(gui,
- gui.getLeft() + xPos + 11 * i,
- gui.getTop() + 11 * j, x, y,
- new ItemStack(Blocks.air), 0, 0, 0);
- Page.addSlotItem(gui, gui.getLeft() + xPos + 11 * 2,
- gui.getTop() + 11 * 5, x, y,
- new ItemStack(Blocks.stone_brick_stairs), 0, 90,
- 0);
- Page.addSlotItem(gui, gui.getLeft() + xPos + 11 * 3,
- gui.getTop() + 11 * 5, x, y,
- new ItemStack(Blocks.stone_brick_stairs), 0, -90,
- 180);
- Page.addSlotItem(gui, gui.getLeft() + xPos + 11 * 4,
- gui.getTop() + 11 * 5, x, y,
- new ItemStack(BlockList.shadowEye), 0, 90, 0);
- Page.addSlotItem(gui, gui.getLeft() + xPos + 11 * 5,
- gui.getTop() + 11 * 5, x, y,
- new ItemStack(Blocks.stone_brick_stairs), 0, 90,
- 180);
- Page.addSlotItem(gui, gui.getLeft() + xPos + 11 * 6,
- gui.getTop() + 11 * 5, x, y,
- new ItemStack(Blocks.stone_brick_stairs), 0, -90,
- 0);
+ Page.addSlotItem(gui, gui
+ .getLeft()
+ + xPos
+ + 11 * i,
+ gui.getTop() + 11
+ * j,
+ x, y,
+ new ItemStack(Blocks.air),
+ 0, 0, 0);
+ Page.addSlotItem(gui,
+ gui.getLeft() + xPos
+ + 11 * 2,
+ gui.getTop() + 11 * 5, x,
+ y,
+ new ItemStack(Blocks.stone_brick_stairs),
+ 0, 90, 0);
+ Page.addSlotItem(gui,
+ gui.getLeft() + xPos
+ + 11 * 3,
+ gui.getTop() + 11 * 5, x,
+ y,
+ new ItemStack(Blocks.stone_brick_stairs),
+ 0, -90, 180);
+ Page.addSlotItem(gui,
+ gui.getLeft() + xPos
+ + 11 * 4,
+ gui.getTop() + 11 * 5, x,
+ y,
+ new ItemStack(BlockList.shadowEye),
+ 0, 90, 0);
+ Page.addSlotItem(gui,
+ gui.getLeft() + xPos
+ + 11 * 5,
+ gui.getTop() + 11 * 5, x,
+ y,
+ new ItemStack(Blocks.stone_brick_stairs),
+ 0, 90, 180);
+ Page.addSlotItem(gui,
+ gui.getLeft() + xPos
+ + 11 * 6,
+ gui.getTop() + 11 * 5, x,
+ y,
+ new ItemStack(Blocks.stone_brick_stairs),
+ 0, -90, 0);
break;
case 5:
Page.drawText(gui,
- EnumChatFormatting.DARK_BLUE + "\u00a7n"
+ EnumChatFormatting.DARK_BLUE
+ + "\u00a7n"
+ "Layer 5",
- gui.getLeft() + xPos + 35, gui.getTop() - 30);
+ gui.getLeft() + xPos + 35,
+ gui.getTop() - 30);
for (int i = -1; i < 10; i++)
for (int j = 0; j < 11; j++)
- Page.addSlotItem(gui,
- gui.getLeft() + xPos + 11 * i,
- gui.getTop() + 11 * j, x, y,
- new ItemStack(Blocks.air), 0, 0, 0);
- Page.addSlotItem(gui, gui.getLeft() + xPos + 11 * 3,
- gui.getTop() + 11 * 5, x, y,
- new ItemStack(Blocks.stone_slab, 1, 5), 0, 0, 0);
- Page.addSlotItem(gui, gui.getLeft() + xPos + 11 * 4,
- gui.getTop() + 11 * 5, x, y,
- new ItemStack(Blocks.stone_slab, 1, 5), 0, 0, 0);
- Page.addSlotItem(gui, gui.getLeft() + xPos + 11 * 5,
- gui.getTop() + 11 * 5, x, y,
- new ItemStack(Blocks.stone_slab, 1, 5), 0, 0, 0);
+ Page.addSlotItem(gui, gui
+ .getLeft()
+ + xPos
+ + 11 * i,
+ gui.getTop() + 11
+ * j,
+ x, y,
+ new ItemStack(Blocks.air),
+ 0, 0, 0);
+ Page.addSlotItem(gui,
+ gui.getLeft() + xPos
+ + 11 * 3,
+ gui.getTop() + 11 * 5, x,
+ y,
+ new ItemStack(Blocks.stone_slab,
+ 1, 5),
+ 0, 0, 0);
+ Page.addSlotItem(gui,
+ gui.getLeft() + xPos
+ + 11 * 4,
+ gui.getTop() + 11 * 5, x,
+ y,
+ new ItemStack(Blocks.stone_slab,
+ 1, 5),
+ 0, 0, 0);
+ Page.addSlotItem(gui,
+ gui.getLeft() + xPos
+ + 11 * 5,
+ gui.getTop() + 11 * 5, x,
+ y,
+ new ItemStack(Blocks.stone_slab,
+ 1, 5),
+ 0, 0, 0);
break;
}
}
diff --git a/src/main/java/darkknight/jewelrycraft/client/gui/container/ContainerJewelryModifier.java b/src/main/java/darkknight/jewelrycraft/client/gui/container/ContainerJewelryModifier.java index 652d628..975dbd2 100755 --- a/src/main/java/darkknight/jewelrycraft/client/gui/container/ContainerJewelryModifier.java +++ b/src/main/java/darkknight/jewelrycraft/client/gui/container/ContainerJewelryModifier.java @@ -10,15 +10,18 @@ import net.minecraft.item.ItemStack; public class ContainerJewelryModifier extends Container {
public IInventory modInv;
- public ContainerJewelryModifier(InventoryPlayer inv, IInventory mod) {
+ public ContainerJewelryModifier(InventoryPlayer inv,
+ IInventory mod) {
int x, y;
modInv = mod;
for (x = 0; x < 9; x++)
- addSlotToContainer(new Slot(inv, x, 26 + 18 * x, 225));
+ addSlotToContainer(new Slot(inv, x, 26 + 18 * x,
+ 225));
for (y = 0; y < 3; y++)
for (x = 0; x < 9; x++)
- addSlotToContainer(new Slot(inv, x + 9 + y * 9,
- 26 + 18 * x, 167 + y * 18));
+ addSlotToContainer(new Slot(inv,
+ x + 9 + y * 9, 26 + 18 * x,
+ 167 + y * 18));
addSlotToContainer(new Slot(mod, 36, 37, 9));
}
@@ -36,10 +39,12 @@ public class ContainerJewelryModifier extends Container { ItemStack itemstack1 = slot.getStack();
itemstack = itemstack1.copy();
if (par2 < 27) {
- if (!mergeItemStack(itemstack1, 27, inventorySlots.size(),
+ if (!mergeItemStack(itemstack1, 27,
+ inventorySlots.size(),
true))
return null;
- } else if (!mergeItemStack(itemstack1, 0, 27, false))
+ } else if (!mergeItemStack(itemstack1, 0, 27,
+ false))
return null;
if (itemstack1.stackSize == 0)
slot.putStack((ItemStack) null);
diff --git a/src/main/java/darkknight/jewelrycraft/client/gui/container/ContainerJewelryTab.java b/src/main/java/darkknight/jewelrycraft/client/gui/container/ContainerJewelryTab.java index 3061bfd..d3fbab1 100755 --- a/src/main/java/darkknight/jewelrycraft/client/gui/container/ContainerJewelryTab.java +++ b/src/main/java/darkknight/jewelrycraft/client/gui/container/ContainerJewelryTab.java @@ -23,25 +23,28 @@ public class ContainerJewelryTab extends Container { int x, y;
// Rings
for (x = 0; x <= 9; x++)
- addSlotToContainer(new SlotRing(extra, x, 8 + x * 18, 7));
+ addSlotToContainer(new SlotRing(extra, x,
+ 8 + x * 18, 7));
// Bracelets
for (x = 10; x <= 13; x++)
- addSlotToContainer(
- new SlotBracelet(extra, x, 8 + (x - 10) * 18, 26));
+ addSlotToContainer(new SlotBracelet(extra, x,
+ 8 + (x - 10) * 18, 26));
// Necklaces
for (x = 14; x <= 16; x++)
- addSlotToContainer(
- new SlotNecklace(extra, x, 8 + (x - 14) * 18, 45));
+ addSlotToContainer(new SlotNecklace(extra, x,
+ 8 + (x - 14) * 18, 45));
// Earrings
addSlotToContainer(new SlotEarrings(extra, 17, 8, 64));
// Hotbar
for (x = 0; x < 9; ++x)
- addSlotToContainer(new Slot(inv, x, 17 + x * 18, 142));
+ addSlotToContainer(new Slot(inv, x, 17 + x * 18,
+ 142));
// Inventory
for (x = 0; x < 3; ++x)
for (y = 0; y < 9; ++y)
- addSlotToContainer(new Slot(inv, 9 + y + x * 9,
- 17 + y * 18, 84 + x * 18));
+ addSlotToContainer(new Slot(inv,
+ 9 + y + x * 9, 17 + y * 18,
+ 84 + x * 18));
}
@Override
@@ -52,36 +55,49 @@ public class ContainerJewelryTab extends Container { @Override
public ItemStack slotClick(int slotID, int j, int k,
EntityPlayer player) {
- if (slotID >= 0 && slotID <= 17 && !player.worldObj.isRemote) {
+ if (slotID >= 0 && slotID <= 17
+ && !player.worldObj.isRemote) {
try {
if (player.inventory.getItemStack() == null
- && inventoryItemStacks.get(slotID) != null
- && ((ItemStack) inventoryItemStacks.get(slotID))
- .getItem() instanceof ItemBaseJewelry)
+ && inventoryItemStacks.get(
+ slotID) != null
+ && ((ItemStack) inventoryItemStacks
+ .get(slotID)).getItem() instanceof ItemBaseJewelry)
((ItemBaseJewelry) ((ItemStack) inventoryItemStacks
- .get(slotID)).getItem()).onJewelryUnequipped(
- (ItemStack) inventoryItemStacks
- .get(slotID));
- else if (player.inventory.getItemStack() != null
- && player.inventory.getItemStack()
+ .get(slotID)).getItem())
+ .onJewelryUnequipped(
+ (ItemStack) inventoryItemStacks
+ .get(slotID));
+ else if (player.inventory
+ .getItemStack() != null
+ && player.inventory
+ .getItemStack()
.getItem() instanceof ItemBaseJewelry
- && inventoryItemStacks.get(slotID) == null)
- ((ItemBaseJewelry) player.inventory.getItemStack()
+ && inventoryItemStacks.get(
+ slotID) == null)
+ ((ItemBaseJewelry) player.inventory
+ .getItemStack()
.getItem()).onJewelryEquipped(
player.inventory.getItemStack());
if (player.inventory.getItemStack() == null
- && inventoryItemStacks.get(slotID) != null
- && ((ItemStack) inventoryItemStacks.get(slotID))
- .getItem() instanceof IJewelryItem)
+ && inventoryItemStacks.get(
+ slotID) != null
+ && ((ItemStack) inventoryItemStacks
+ .get(slotID)).getItem() instanceof IJewelryItem)
((IJewelryItem) ((ItemStack) inventoryItemStacks
- .get(slotID)).getItem()).onJewelryUnequipped(
- (ItemStack) inventoryItemStacks
- .get(slotID));
- else if (player.inventory.getItemStack() != null
- && player.inventory.getItemStack()
+ .get(slotID)).getItem())
+ .onJewelryUnequipped(
+ (ItemStack) inventoryItemStacks
+ .get(slotID));
+ else if (player.inventory
+ .getItemStack() != null
+ && player.inventory
+ .getItemStack()
.getItem() instanceof IJewelryItem
- && inventoryItemStacks.get(slotID) == null)
- ((IJewelryItem) player.inventory.getItemStack()
+ && inventoryItemStacks.get(
+ slotID) == null)
+ ((IJewelryItem) player.inventory
+ .getItemStack()
.getItem()).onJewelryEquipped(
player.inventory.getItemStack());
} catch (Exception e) {
@@ -94,7 +110,8 @@ public class ContainerJewelryTab extends Container { }
@Override
- public ItemStack transferStackInSlot(EntityPlayer player, int slotID) {
+ public ItemStack transferStackInSlot(EntityPlayer player,
+ int slotID) {
ItemStack itemstack = null;
Slot slot = (Slot) inventorySlots.get(slotID);
if (slot != null && slot.getHasStack()) {
@@ -103,38 +120,52 @@ public class ContainerJewelryTab extends Container { if (slotID >= 18) {
if (itemstack.getItem() instanceof ItemRing
|| (itemstack.getItem() instanceof IJewelryItem
- && ((IJewelryItem) itemstack.getItem())
- .type() == 0)) {
- if (!mergeItemStack(itemstack, 0, 10, false)
+ && ((IJewelryItem) itemstack
+ .getItem()).type() == 0)) {
+ if (!mergeItemStack(itemstack, 0,
+ 10, false)
&& !slot.getHasStack())
return null;
- } else if (itemstack.getItem() instanceof ItemBracelet
+ } else if (itemstack
+ .getItem() instanceof ItemBracelet
|| (itemstack.getItem() instanceof IJewelryItem
- && ((IJewelryItem) itemstack.getItem())
- .type() == 1)) {
- if (!mergeItemStack(itemstack, 10, 14, false)
+ && ((IJewelryItem) itemstack
+ .getItem()).type() == 1)) {
+ if (!mergeItemStack(itemstack, 10,
+ 14, false)
&& !slot.getHasStack())
return null;
- } else if (itemstack.getItem() instanceof ItemNecklace
+ } else if (itemstack
+ .getItem() instanceof ItemNecklace
|| (itemstack.getItem() instanceof IJewelryItem
- && ((IJewelryItem) itemstack.getItem())
- .type() == 2)) {
- if (!mergeItemStack(itemstack, 14, 17, false)
+ && ((IJewelryItem) itemstack
+ .getItem()).type() == 2)) {
+ if (!mergeItemStack(itemstack, 14,
+ 17, false)
&& !slot.getHasStack())
return null;
- } else if (itemstack.getItem() instanceof ItemEarrings
+ } else if (itemstack
+ .getItem() instanceof ItemEarrings
|| (itemstack.getItem() instanceof IJewelryItem
- && ((IJewelryItem) itemstack.getItem())
- .type() == 3)) {
- if (!mergeItemStack(itemstack, 17, 18, false)
+ && ((IJewelryItem) itemstack
+ .getItem()).type() == 3)) {
+ if (!mergeItemStack(itemstack, 17,
+ 18, false)
&& !slot.getHasStack())
return null;
} else {
if (slotID < 27) {
- if (!mergeItemStack(itemstack, 27, 36 + 18, false))
+ if (!mergeItemStack(
+ itemstack,
+ 27,
+ 36 + 18,
+ false))
return null;
} else {
- if (!mergeItemStack(itemstack, 18, 27, false))
+ if (!mergeItemStack(
+ itemstack,
+ 18, 27,
+ false))
return null;
}
}
diff --git a/src/main/java/darkknight/jewelrycraft/client/gui/container/ContainerRingChest.java b/src/main/java/darkknight/jewelrycraft/client/gui/container/ContainerRingChest.java index e848b38..825b737 100755 --- a/src/main/java/darkknight/jewelrycraft/client/gui/container/ContainerRingChest.java +++ b/src/main/java/darkknight/jewelrycraft/client/gui/container/ContainerRingChest.java @@ -15,20 +15,24 @@ public class ContainerRingChest extends Container { * @param inv * @param chest */ - public ContainerRingChest(InventoryPlayer inv, TileEntityChest chest) { + public ContainerRingChest(InventoryPlayer inv, + TileEntityChest chest) { theChest = chest; int x, y; for (x = 0; x < 9; x++) - addSlotToContainer(new SlotRingChest(inv, x, 8 + 18 * x, 142, + addSlotToContainer(new SlotRingChest(inv, x, + 8 + 18 * x, 142, x == inv.currentItem)); for (y = 0; y < 3; y++) for (x = 0; x < 9; x++) - addSlotToContainer(new Slot(inv, x + 9 + y * 9, 8 + 18 * x, + addSlotToContainer(new Slot(inv, + x + 9 + y * 9, 8 + 18 * x, 84 + y * 18)); for (y = 0; y < 3; y++) for (x = 0; x < 9; x++) addSlotToContainer(new SlotRingChest(chest, - 26 - (x + y * 9), 8 + 18 * (8 - x), + 26 - (x + y * 9), + 8 + 18 * (8 - x), 17 + (2 - y) * 18, false)); } @@ -55,10 +59,12 @@ public class ContainerRingChest extends Container { ItemStack itemstack1 = slot.getStack(); itemstack = itemstack1.copy(); if (par2 < 27) { - if (!mergeItemStack(itemstack1, 27, inventorySlots.size(), + if (!mergeItemStack(itemstack1, 27, + inventorySlots.size(), true)) return null; - } else if (!mergeItemStack(itemstack1, 0, 27, false)) + } else if (!mergeItemStack(itemstack1, 0, 27, + false)) return null; if (itemstack1.stackSize == 0) slot.putStack((ItemStack) null); diff --git a/src/main/java/darkknight/jewelrycraft/client/gui/container/slots/SlotBracelet.java b/src/main/java/darkknight/jewelrycraft/client/gui/container/slots/SlotBracelet.java index 2f3a9cc..ab09015 100755 --- a/src/main/java/darkknight/jewelrycraft/client/gui/container/slots/SlotBracelet.java +++ b/src/main/java/darkknight/jewelrycraft/client/gui/container/slots/SlotBracelet.java @@ -25,9 +25,10 @@ public class SlotBracelet extends Slot { */
@Override
public boolean isItemValid(ItemStack stack) {
- return stack.getItem() instanceof ItemBracelet
- || (stack.getItem() instanceof IJewelryItem
- && ((IJewelryItem) stack.getItem()).type() == 1);
+ return stack.getItem() instanceof ItemBracelet || (stack
+ .getItem() instanceof IJewelryItem
+ && ((IJewelryItem) stack.getItem())
+ .type() == 1);
}
/**
diff --git a/src/main/java/darkknight/jewelrycraft/client/gui/container/slots/SlotEarrings.java b/src/main/java/darkknight/jewelrycraft/client/gui/container/slots/SlotEarrings.java index c563f4d..1527e29 100755 --- a/src/main/java/darkknight/jewelrycraft/client/gui/container/slots/SlotEarrings.java +++ b/src/main/java/darkknight/jewelrycraft/client/gui/container/slots/SlotEarrings.java @@ -25,9 +25,10 @@ public class SlotEarrings extends Slot { */
@Override
public boolean isItemValid(ItemStack stack) {
- return stack.getItem() instanceof ItemEarrings
- || (stack.getItem() instanceof IJewelryItem
- && ((IJewelryItem) stack.getItem()).type() == 3);
+ return stack.getItem() instanceof ItemEarrings || (stack
+ .getItem() instanceof IJewelryItem
+ && ((IJewelryItem) stack.getItem())
+ .type() == 3);
}
/**
diff --git a/src/main/java/darkknight/jewelrycraft/client/gui/container/slots/SlotNecklace.java b/src/main/java/darkknight/jewelrycraft/client/gui/container/slots/SlotNecklace.java index ab2d04e..ba39329 100755 --- a/src/main/java/darkknight/jewelrycraft/client/gui/container/slots/SlotNecklace.java +++ b/src/main/java/darkknight/jewelrycraft/client/gui/container/slots/SlotNecklace.java @@ -25,9 +25,10 @@ public class SlotNecklace extends Slot { */
@Override
public boolean isItemValid(ItemStack stack) {
- return stack.getItem() instanceof ItemNecklace
- || (stack.getItem() instanceof IJewelryItem
- && ((IJewelryItem) stack.getItem()).type() == 2);
+ return stack.getItem() instanceof ItemNecklace || (stack
+ .getItem() instanceof IJewelryItem
+ && ((IJewelryItem) stack.getItem())
+ .type() == 2);
}
/**
diff --git a/src/main/java/darkknight/jewelrycraft/client/gui/container/slots/SlotRing.java b/src/main/java/darkknight/jewelrycraft/client/gui/container/slots/SlotRing.java index 6c16509..41381b1 100755 --- a/src/main/java/darkknight/jewelrycraft/client/gui/container/slots/SlotRing.java +++ b/src/main/java/darkknight/jewelrycraft/client/gui/container/slots/SlotRing.java @@ -25,9 +25,10 @@ public class SlotRing extends Slot { */
@Override
public boolean isItemValid(ItemStack stack) {
- return stack.getItem() instanceof ItemRing
- || (stack.getItem() instanceof IJewelryItem
- && ((IJewelryItem) stack.getItem()).type() == 0);
+ return stack.getItem() instanceof ItemRing || (stack
+ .getItem() instanceof IJewelryItem
+ && ((IJewelryItem) stack.getItem())
+ .type() == 0);
}
/**
diff --git a/src/main/java/darkknight/jewelrycraft/commands/JewelrycraftCommands.java b/src/main/java/darkknight/jewelrycraft/commands/JewelrycraftCommands.java index 2bafd5f..6407dd4 100755 --- a/src/main/java/darkknight/jewelrycraft/commands/JewelrycraftCommands.java +++ b/src/main/java/darkknight/jewelrycraft/commands/JewelrycraftCommands.java @@ -47,26 +47,31 @@ public class JewelrycraftCommands extends CommandBase { public void processCommand(ICommandSender commandSender,
String[] astring) {
if (astring.length == 0 || astring[0].equals("help"))
- throw new WrongUsageException(getCommandUsage(commandSender));
+ throw new WrongUsageException(
+ getCommandUsage(commandSender));
if (astring[0].equals("getCursePoints")) {
- EntityPlayerMP entityplayermp =
- getPlayer(commandSender, astring[1]);
- commandSender.addChatMessage(new ChatComponentTranslation(
- Integer.toString(JewelrycraftUtil
- .getCursePoints(entityplayermp))));
+ EntityPlayerMP entityplayermp = getPlayer(
+ commandSender, astring[1]);
+ commandSender.addChatMessage(
+ new ChatComponentTranslation(
+ Integer.toString(
+ JewelrycraftUtil.getCursePoints(
+ entityplayermp))));
} else if (astring[0].equals("addCursePoints")) {
- int points = CommandBase.parseIntWithMin(commandSender,
- astring[2], 0);
- EntityPlayerMP entityplayermp =
- getPlayer(commandSender, astring[1]);
- JewelrycraftUtil.addCursePoints(entityplayermp, points);
+ int points = CommandBase.parseIntWithMin(
+ commandSender, astring[2], 0);
+ EntityPlayerMP entityplayermp = getPlayer(
+ commandSender, astring[1]);
+ JewelrycraftUtil.addCursePoints(entityplayermp,
+ points);
} else if (astring[0].equals("setCursePoints")) {
- int points = CommandBase.parseIntWithMin(commandSender,
- astring[2], 0);
- EntityPlayerMP entityplayermp =
- getPlayer(commandSender, astring[1]);
- JewelrycraftUtil.addCursePoints(entityplayermp, points
- - JewelrycraftUtil.getCursePoints(entityplayermp));
+ int points = CommandBase.parseIntWithMin(
+ commandSender, astring[2], 0);
+ EntityPlayerMP entityplayermp = getPlayer(
+ commandSender, astring[1]);
+ JewelrycraftUtil.addCursePoints(entityplayermp,
+ points - JewelrycraftUtil
+ .getCursePoints(entityplayermp));
}
}
@@ -74,16 +79,21 @@ public class JewelrycraftCommands extends CommandBase { public List addTabCompletionOptions(ICommandSender icommandsender,
String[] astring) {
final List<String> MATCHES = new LinkedList<String>();
- final String ARG_LC = astring[astring.length - 1].toLowerCase();
+ final String ARG_LC = astring[astring.length - 1]
+ .toLowerCase();
if (astring.length == 1) {
- if ("addCursePoints".toLowerCase().startsWith(ARG_LC))
+ if ("addCursePoints".toLowerCase()
+ .startsWith(ARG_LC))
MATCHES.add("addCursePoints");
- if ("getCursePoints".toLowerCase().startsWith(ARG_LC))
+ if ("getCursePoints".toLowerCase()
+ .startsWith(ARG_LC))
MATCHES.add("getCursePoints");
- if ("setCursePoints".toLowerCase().startsWith(ARG_LC))
+ if ("setCursePoints".toLowerCase()
+ .startsWith(ARG_LC))
MATCHES.add("setCursePoints");
} else if (astring.length == 2) {
- for (String un : MinecraftServer.getServer().getAllUsernames())
+ for (String un : MinecraftServer.getServer()
+ .getAllUsernames())
if (un.toLowerCase().startsWith(ARG_LC))
MATCHES.add(un);
}
diff --git a/src/main/java/darkknight/jewelrycraft/config/ConfigGui.java b/src/main/java/darkknight/jewelrycraft/config/ConfigGui.java index c8e69de..8ef6c47 100755 --- a/src/main/java/darkknight/jewelrycraft/config/ConfigGui.java +++ b/src/main/java/darkknight/jewelrycraft/config/ConfigGui.java @@ -11,17 +11,20 @@ import net.minecraftforge.common.config.ConfigElement; public class ConfigGui extends GuiConfig {
public ConfigGui(GuiScreen parent) {
- super(parent, getElements(), Variables.MODID, Variables.MODID,
- false, false, Variables.MODNAME + " Config");
+ super(parent, getElements(), Variables.MODID,
+ Variables.MODID, false, false,
+ Variables.MODNAME + " Config");
}
- @SuppressWarnings({ "rawtypes" })
+ @SuppressWarnings({
+ "rawtypes"
+ })
private static List<IConfigElement> getElements() {
List<IConfigElement> list = new ArrayList<IConfigElement>(
ConfigHandler.categories.length);
for (String category : ConfigHandler.categories)
- list.add(new ConfigElement(
- ConfigHandler.config.getCategory(category)));
+ list.add(new ConfigElement(ConfigHandler.config
+ .getCategory(category)));
return list;
}
}
\ No newline at end of file diff --git a/src/main/java/darkknight/jewelrycraft/config/ConfigGuiFactory.java b/src/main/java/darkknight/jewelrycraft/config/ConfigGuiFactory.java index 2e8f86f..1ff4a6f 100755 --- a/src/main/java/darkknight/jewelrycraft/config/ConfigGuiFactory.java +++ b/src/main/java/darkknight/jewelrycraft/config/ConfigGuiFactory.java @@ -22,8 +22,8 @@ public class ConfigGuiFactory implements IModGuiFactory { }
@Override
- public RuntimeOptionGuiHandler
- getHandlerFor(RuntimeOptionCategoryElement element) {
+ public RuntimeOptionGuiHandler getHandlerFor(
+ RuntimeOptionCategoryElement element) {
return null;
}
}
\ No newline at end of file diff --git a/src/main/java/darkknight/jewelrycraft/config/ConfigHandler.java b/src/main/java/darkknight/jewelrycraft/config/ConfigHandler.java index 45feab0..ac524e6 100755 --- a/src/main/java/darkknight/jewelrycraft/config/ConfigHandler.java +++ b/src/main/java/darkknight/jewelrycraft/config/ConfigHandler.java @@ -7,78 +7,83 @@ import darkknight.jewelrycraft.util.Variables; import net.minecraftforge.common.config.Configuration;
public class ConfigHandler {
- public static Configuration config;
- public static final ConfigHandler INSTANCE = new ConfigHandler();
- public static final String[] categories = {
- "Timers", "Village Generation", "Misc", "World Generation",
- "Curses" };
-
- public static int INGOT_COOLING_TIME;
- public static int INGOT_MELTING_TIME;
- public static int GEM_PLACEMENT_TIME;
- public static int RITUAL_TIME;
- public static int HEART_DESPAWN_TIME;
-
- public static boolean GENERATE_VILLAGE_NETHERSTAR;
- public static boolean CAN_FURNACE_GENERATE_INGOTS;
- public static int MAX_VILLAGE_JEWELERS;
- public static int JEWELER_WEIGHT;
- public static int INGOT_CHEST_MIN;
- public static int INGOT_CHEST_MAX;
- public static int INGOT_CHEST_MAX_STACK;
- public static int GEM_CHEST_MIN;
- public static int GEM_CHEST_MAX;
- public static int FURNACE_MIN_INGOT_STACK;
- public static int FURNACE_MAX_INGOT_STACK;
-
- public static int MAX_BLACK_HEARTS_PICKUP;
- public static int MAX_BLUE_HEARTS_PICKUP;
- public static boolean CAN_BLUE_HEARTS_SPAWN;
- public static boolean CAN_BLACK_HEARTS_SPAWN;
- public static boolean CAN_HOLY_HEARTS_SPAWN;
- public static boolean CAN_RED_HEARTS_SPAWN;
-
- public static boolean CRYSTAL_GLOW;
- public static boolean CRYSTAL_PARTICLES;
- public static boolean HEARTS_DESPAWN;
- public static boolean JEWELRY_INFO;
-
- public static boolean CURSES_ENABLED = true;
- public static boolean CURSE_ROTTEN_HEART = true;
- public static boolean CURSE_FLAMING_SOUL = true;
- public static boolean CURSE_GREED = true;
- public static boolean CURSE_BLIND = true;
- public static boolean CURSE_INFAMY = true;
- public static boolean CURSE_MIDAS_TOUCH = true;
- public static boolean CURSE_RABBIT_PAW = true;
- public static boolean CURSE_PENTAGRAM = true;
- public static boolean CURSE_VAMPIRE_HUNGER = true;
- public static boolean CURSE_HUMBLE_BUNDLE = true;
- public static boolean CURSE_DEATHS_TOUCH = true;
- public static boolean CURSE_DOUBLE_DOWN = true;
- public static boolean CURSE_INCREDIBLE_DEVOTION = true;
- public static float DEVOTION_FACTOR = 10.0f;
- public static boolean CURSE_MONEY_EQUALS_POWER = true;
- public static boolean CURSE_SCION_OF_HELL = true;
-
- public static boolean ENABLE_WORLD_GEN = true;
- public static boolean ORE_GEN = true;
- public static boolean CRYSTAL_GEN = true;
- public static boolean STRUCTURES[] = {
- true, true, true, true, true, true };
- public static int STRUCTURES_SPAWN_CHANCE[] = { 6,
- 5, 7, 10, 6, 10 };
+ public static Configuration config;
+ public static final ConfigHandler INSTANCE = new ConfigHandler();
+ public static final String[] categories = {
+ "Timers", "Village Generation", "Misc",
+ "World Generation", "Curses"
+ };
+
+ public static int INGOT_COOLING_TIME;
+ public static int INGOT_MELTING_TIME;
+ public static int GEM_PLACEMENT_TIME;
+ public static int RITUAL_TIME;
+ public static int HEART_DESPAWN_TIME;
+
+ public static boolean GENERATE_VILLAGE_NETHERSTAR;
+ public static boolean CAN_FURNACE_GENERATE_INGOTS;
+ public static int MAX_VILLAGE_JEWELERS;
+ public static int JEWELER_WEIGHT;
+ public static int INGOT_CHEST_MIN;
+ public static int INGOT_CHEST_MAX;
+ public static int INGOT_CHEST_MAX_STACK;
+ public static int GEM_CHEST_MIN;
+ public static int GEM_CHEST_MAX;
+ public static int FURNACE_MIN_INGOT_STACK;
+ public static int FURNACE_MAX_INGOT_STACK;
+
+ public static int MAX_BLACK_HEARTS_PICKUP;
+ public static int MAX_BLUE_HEARTS_PICKUP;
+ public static boolean CAN_BLUE_HEARTS_SPAWN;
+ public static boolean CAN_BLACK_HEARTS_SPAWN;
+ public static boolean CAN_HOLY_HEARTS_SPAWN;
+ public static boolean CAN_RED_HEARTS_SPAWN;
+
+ public static boolean CRYSTAL_GLOW;
+ public static boolean CRYSTAL_PARTICLES;
+ public static boolean HEARTS_DESPAWN;
+ public static boolean JEWELRY_INFO;
+
+ public static boolean CURSES_ENABLED = true;
+ public static boolean CURSE_ROTTEN_HEART = true;
+ public static boolean CURSE_FLAMING_SOUL = true;
+ public static boolean CURSE_GREED = true;
+ public static boolean CURSE_BLIND = true;
+ public static boolean CURSE_INFAMY = true;
+ public static boolean CURSE_MIDAS_TOUCH = true;
+ public static boolean CURSE_RABBIT_PAW = true;
+ public static boolean CURSE_PENTAGRAM = true;
+ public static boolean CURSE_VAMPIRE_HUNGER = true;
+ public static boolean CURSE_HUMBLE_BUNDLE = true;
+ public static boolean CURSE_DEATHS_TOUCH = true;
+ public static boolean CURSE_DOUBLE_DOWN = true;
+ public static boolean CURSE_INCREDIBLE_DEVOTION = true;
+ public static float DEVOTION_FACTOR = 10.0f;
+ public static boolean CURSE_MONEY_EQUALS_POWER = true;
+ public static boolean CURSE_SCION_OF_HELL = true;
+
+ public static boolean ENABLE_WORLD_GEN = true;
+ public static boolean ORE_GEN = true;
+ public static boolean CRYSTAL_GEN = true;
+ public static boolean STRUCTURES[] = {
+ true, true, true, true, true, true
+ };
+ public static int STRUCTURES_SPAWN_CHANCE[] = {
+ 6, 5, 7, 10, 6, 10
+ };
public void loadConfig(FMLPreInitializationEvent event) {
- config = new Configuration(event.getSuggestedConfigurationFile(),
+ config = new Configuration(
+ event.getSuggestedConfigurationFile(),
true);
config.load();
syncConfigs();
}
private void syncConfigs() {
- INGOT_COOLING_TIME = config.getInt("Molder Ingot Cooling Time",
- categories[0], 100, 5, Integer.MAX_VALUE,
+ INGOT_COOLING_TIME = config.getInt(
+ "Molder Ingot Cooling Time", categories[0],
+ 100, 5, Integer.MAX_VALUE,
"This sets the number of ticks you need to wait before the mold is cooled.");
INGOT_MELTING_TIME = config.getInt("Ingot Melting Time",
categories[0], 1500, 5, Integer.MAX_VALUE,
@@ -86,100 +91,119 @@ public class ConfigHandler { GEM_PLACEMENT_TIME = config.getInt("Jewelry Crafting Time",
categories[0], 200, 5, Integer.MAX_VALUE,
"This sets the number of ticks it takes for a jewel to be modified.");
- RITUAL_TIME = config.getInt("Ritual Time", categories[0], 500, 5,
- Integer.MAX_VALUE,
+ RITUAL_TIME = config.getInt("Ritual Time", categories[0],
+ 500, 5, Integer.MAX_VALUE,
"This sets the number of ticks it takes for the ritual to end.");
HEART_DESPAWN_TIME = config.getInt("Hearts Despawn Time",
categories[0], 900, 20, Integer.MAX_VALUE,
"This sets the number of ticks it takes for hearts to despawn, 20=1 second");
GENERATE_VILLAGE_NETHERSTAR = config.getBoolean(
- "Netherstar Generation", categories[1], false,
+ "Netherstar Generation", categories[1],
+ false,
"If set to true Nether Stars will be able to generate in Jewelers chests.");
CAN_FURNACE_GENERATE_INGOTS = config.getBoolean(
- "Furnace Ingots Generation", categories[1], true,
+ "Furnace Ingots Generation", categories[1],
+ true,
"If set to true jewelers will generate ingots in furnaces.");
MAX_VILLAGE_JEWELERS = config.getInt("Maximum Jewelers",
categories[1], 1, 0, Integer.MAX_VALUE,
"Sets how many jewelers can be in a village.");
- JEWELER_WEIGHT = config.getInt("Jewelers Weight", categories[1],
- 30, 0, Integer.MAX_VALUE,
+ JEWELER_WEIGHT = config.getInt("Jewelers Weight",
+ categories[1], 30, 0, Integer.MAX_VALUE,
"Chance of getting a jeweler in a village. The higher the value, the higher the chance.");
- INGOT_CHEST_MIN = config.getInt("Ingot Chest Min", categories[1],
- 1, 0, Integer.MAX_VALUE,
+ INGOT_CHEST_MIN = config.getInt("Ingot Chest Min",
+ categories[1], 1, 0, Integer.MAX_VALUE,
"Minimum number of ingots that can be found in a chest from the Jeweler. (It's the chest from the back part)");
- INGOT_CHEST_MAX = config.getInt("Ingot Chest Max", categories[1],
- 4, 0, Integer.MAX_VALUE,
+ INGOT_CHEST_MAX = config.getInt("Ingot Chest Max",
+ categories[1], 4, 0, Integer.MAX_VALUE,
"Maximum number of ingots that can be found in a chest from the Jeweler. (It's the chest from the back part)");
- INGOT_CHEST_MAX_STACK = config.getInt("Ingot Chest Max Stack",
- categories[1], 2, 0, Integer.MAX_VALUE,
+ INGOT_CHEST_MAX_STACK = config.getInt(
+ "Ingot Chest Max Stack", categories[1], 2,
+ 0, Integer.MAX_VALUE,
"Maximum number of the stack the ingots can be. For example: if set to 2 and ingots have a chance of generating, you have a chance of getting a stack of max 2 ingots in a chest.");
- GEM_CHEST_MIN = config.getInt("Jewelers Chest Min", categories[1],
- 2, 0, Integer.MAX_VALUE,
+ GEM_CHEST_MIN = config.getInt("Jewelers Chest Min",
+ categories[1], 2, 0, Integer.MAX_VALUE,
"Determines the minimum nuber of jewels/modifiers that can be generated in the front chests of a Jeweler.");
- GEM_CHEST_MAX = config.getInt("Jewelers Chest Max", categories[1],
- 5, 0, Integer.MAX_VALUE,
+ GEM_CHEST_MAX = config.getInt("Jewelers Chest Max",
+ categories[1], 5, 0, Integer.MAX_VALUE,
"Determines the maximum nuber of jewels/modifiers that can be generated in the front chests of a Jeweler.");
- FURNACE_MIN_INGOT_STACK = config.getInt("Ingot Furnace Min",
- categories[1], 2, 0, Integer.MAX_VALUE,
+ FURNACE_MIN_INGOT_STACK = config.getInt(
+ "Ingot Furnace Min", categories[1], 2, 0,
+ Integer.MAX_VALUE,
"Determines the minimum number of ingots that can generate in a furnace.");
- FURNACE_MAX_INGOT_STACK = config.getInt("Ingot Furnace Max",
- categories[1], 5, 0, Integer.MAX_VALUE,
+ FURNACE_MAX_INGOT_STACK = config.getInt(
+ "Ingot Furnace Max", categories[1], 5, 0,
+ Integer.MAX_VALUE,
"Determines the maximum number of ingots that can generate in a furnace.");
- CRYSTAL_GLOW = config.getBoolean("Crystal Glow", categories[2],
- false,
+ CRYSTAL_GLOW = config.getBoolean("Crystal Glow",
+ categories[2], false,
"If true, then crystal will slowly glow (can cause lag)");
CRYSTAL_PARTICLES = config.getBoolean("Crystal Particles",
categories[2], true,
"If false, then crystal will no longer spawn particles");
- HEARTS_DESPAWN = config.getBoolean("Hearts Despawn", categories[2],
- true,
+ HEARTS_DESPAWN = config.getBoolean("Hearts Despawn",
+ categories[2], true,
"If false, then Hearts and Half-hearts will no longer despawn");
- JEWELRY_INFO = config.getBoolean("Jewelry Info", categories[2],
- true,
+ JEWELRY_INFO = config.getBoolean("Jewelry Info",
+ categories[2], true,
"If false, then extra info won't be show when hovering over a jewelery.");
- MAX_BLACK_HEARTS_PICKUP = config.getInt("Max Black Hearts Pickup",
- categories[2], Integer.MAX_VALUE, 0, Integer.MAX_VALUE,
+ MAX_BLACK_HEARTS_PICKUP = config.getInt(
+ "Max Black Hearts Pickup", categories[2],
+ Integer.MAX_VALUE, 0, Integer.MAX_VALUE,
"Determines how many black hearts can a player pick up.");
- MAX_BLUE_HEARTS_PICKUP = config.getInt("Max Blue Hearts Pickup",
- categories[2], Integer.MAX_VALUE, 0, Integer.MAX_VALUE,
+ MAX_BLUE_HEARTS_PICKUP = config.getInt(
+ "Max Blue Hearts Pickup", categories[2],
+ Integer.MAX_VALUE, 0, Integer.MAX_VALUE,
"Determines how many blue hearts can a player pick up.");
- CAN_BLUE_HEARTS_SPAWN = config.getBoolean("Can Blue Hearts Spawn",
- categories[2], true,
+ CAN_BLUE_HEARTS_SPAWN = config.getBoolean(
+ "Can Blue Hearts Spawn", categories[2],
+ true,
"Determines if blue hearts can spawn.");
CAN_BLACK_HEARTS_SPAWN = config.getBoolean(
- "Can Black Hearts Spawn", categories[2], true,
+ "Can Black Hearts Spawn", categories[2],
+ true,
"Determines if black hearts can spawn.");
- CAN_HOLY_HEARTS_SPAWN = config.getBoolean("Can Holy Hearts Spawn",
- categories[2], true,
+ CAN_HOLY_HEARTS_SPAWN = config.getBoolean(
+ "Can Holy Hearts Spawn", categories[2],
+ true,
"Determines if holy hearts can spawn.");
- CAN_RED_HEARTS_SPAWN = config.getBoolean("Can Red Hearts Spawn",
- categories[2], true,
+ CAN_RED_HEARTS_SPAWN = config.getBoolean(
+ "Can Red Hearts Spawn", categories[2],
+ true,
"Determines if red hearts can spawn.");
ENABLE_WORLD_GEN = config.getBoolean("World Generation",
categories[3], true,
"If false, nothing will generate (this includes ore)");
- ORE_GEN = config.getBoolean("Ore Generation", categories[3], true,
+ ORE_GEN = config.getBoolean("Ore Generation",
+ categories[3], true,
"If false, ores won't generate");
CRYSTAL_GEN = config.getBoolean("Crystal Generation",
- categories[3], true, "If false, crystals won't generate");
+ categories[3], true,
+ "If false, crystals won't generate");
for (int i = 0; i < STRUCTURES.length; i++)
STRUCTURES[i] = config.getBoolean(
- "Structure " + (i + 1) + " Generation", categories[3],
- true, "If false, structure no." + (i + 1)
+ "Structure " + (i + 1)
+ + " Generation",
+ categories[3], true,
+ "If false, structure no." + (i + 1)
+ " won't generate");
for (int i = 0; i < STRUCTURES.length; i++)
STRUCTURES_SPAWN_CHANCE[i] = config.getInt(
- "Structure " + (i + 1) + " Spawn Chance",
- categories[3], STRUCTURES_SPAWN_CHANCE[i], 1,
+ "Structure " + (i + 1)
+ + " Spawn Chance",
+ categories[3],
+ STRUCTURES_SPAWN_CHANCE[i], 1,
Integer.MAX_VALUE,
- "Determines the chance for structure no." + (i + 1)
+ "Determines the chance for structure no."
+ + (i + 1)
+ " to generate. Lower = higher chance and vice versa.");
- CURSES_ENABLED = config.getBoolean("Curses", categories[4], true,
+ CURSES_ENABLED = config.getBoolean("Curses", categories[4],
+ true,
"If set to false curses will be deactivated.");
CURSE_ROTTEN_HEART = config.getBoolean("Rotten Heart",
categories[4], true,
@@ -187,18 +211,24 @@ public class ConfigHandler { CURSE_FLAMING_SOUL = config.getBoolean("Flaming Soul",
categories[4], true,
"If set to false this curse will be deactivated.");
- CURSE_GREED = config.getBoolean("Greed", categories[4], true,
+ CURSE_GREED = config.getBoolean("Greed", categories[4],
+ true,
+ "If set to false this curse will be deactivated.");
+ CURSE_BLIND = config.getBoolean("Blind", categories[4],
+ true,
+ "If set to false this curse will be deactivated.");
+ CURSE_INFAMY = config.getBoolean("Infamy", categories[4],
+ true,
"If set to false this curse will be deactivated.");
- CURSE_BLIND = config.getBoolean("Blind", categories[4], true,
+ CURSE_MIDAS_TOUCH = config.getBoolean("Midas Touch",
+ categories[4], true,
"If set to false this curse will be deactivated.");
- CURSE_INFAMY = config.getBoolean("Infamy", categories[4], true,
+ CURSE_RABBIT_PAW = config.getBoolean("Rabbit's Paw",
+ categories[4], true,
+ "If set to false this curse will be deactivated.");
+ CURSE_PENTAGRAM = config.getBoolean("Pentagram",
+ categories[4], true,
"If set to false this curse will be deactivated.");
- CURSE_MIDAS_TOUCH = config.getBoolean("Midas Touch", categories[4],
- true, "If set to false this curse will be deactivated.");
- CURSE_RABBIT_PAW = config.getBoolean("Rabbit's Paw", categories[4],
- true, "If set to false this curse will be deactivated.");
- CURSE_PENTAGRAM = config.getBoolean("Pentagram", categories[4],
- true, "If set to false this curse will be deactivated.");
CURSE_VAMPIRE_HUNGER = config.getBoolean("Vampire Hunger",
categories[4], true,
"If set to false this curse will be deactivated.");
@@ -208,15 +238,17 @@ public class ConfigHandler { CURSE_DEATHS_TOUCH = config.getBoolean("Death's Touch",
categories[4], true,
"If set to false this curse will be deactivated.");
- CURSE_DOUBLE_DOWN = config.getBoolean("Double Down", categories[4],
- true, "If set to false this curse will be deactivated.");
+ CURSE_DOUBLE_DOWN = config.getBoolean("Double Down",
+ categories[4], true,
+ "If set to false this curse will be deactivated.");
CURSE_INCREDIBLE_DEVOTION = config.getBoolean(
"Incredible Devotion", categories[4], true,
"If set to false this curse will be deactivated.");
- DEVOTION_FACTOR = config.getFloat("Devotion Factor", categories[4],
- 10.0f, 0.0f, Float.MAX_VALUE, "How devoted are mobs?");
- CURSE_MONEY_EQUALS_POWER = config.getBoolean("Money = Power",
- categories[4], true,
+ DEVOTION_FACTOR = config.getFloat("Devotion Factor",
+ categories[4], 10.0f, 0.0f,
+ Float.MAX_VALUE, "How devoted are mobs?");
+ CURSE_MONEY_EQUALS_POWER = config.getBoolean(
+ "Money = Power", categories[4], true,
"If set to false this curse will be deactivated.");
CURSE_SCION_OF_HELL = config.getBoolean("Scion of Hell",
categories[4], true,
diff --git a/src/main/java/darkknight/jewelrycraft/curses/CurseBlind.java b/src/main/java/darkknight/jewelrycraft/curses/CurseBlind.java index 8996605..adaf528 100755 --- a/src/main/java/darkknight/jewelrycraft/curses/CurseBlind.java +++ b/src/main/java/darkknight/jewelrycraft/curses/CurseBlind.java @@ -18,17 +18,17 @@ public class CurseBlind extends Curse { @Override
public void action(World world, EntityPlayer player) {
- if (!player.isPotionActive(Potion.blindness)
- || player.getActivePotionEffect(Potion.blindness)
- .getDuration() < 30)
- player.addPotionEffect(
- new PotionEffect(Potion.blindness.id, 60));
+ if (!player.isPotionActive(Potion.blindness) || player
+ .getActivePotionEffect(Potion.blindness)
+ .getDuration() < 30)
+ player.addPotionEffect(new PotionEffect(
+ Potion.blindness.id, 60));
}
@Override
public String getDescription() {
- return StatCollector.translateToLocal(
- "curse." + Variables.MODID + ".blind.description");
+ return StatCollector.translateToLocal("curse."
+ + Variables.MODID + ".blind.description");
}
@Override
@@ -46,13 +46,14 @@ public class CurseBlind extends Curse { }
@Override
- public int weight(World world, EntityPlayer player, Random random) {
+ public int weight(World world, EntityPlayer player,
+ Random random) {
return 7;
}
@Override
public String getDisplayName() {
- return StatCollector
- .translateToLocal("curse." + Variables.MODID + ".blind");
+ return StatCollector.translateToLocal(
+ "curse." + Variables.MODID + ".blind");
}
}
diff --git a/src/main/java/darkknight/jewelrycraft/curses/CurseDeathsTouch.java b/src/main/java/darkknight/jewelrycraft/curses/CurseDeathsTouch.java index aeb3e22..6281db1 100755 --- a/src/main/java/darkknight/jewelrycraft/curses/CurseDeathsTouch.java +++ b/src/main/java/darkknight/jewelrycraft/curses/CurseDeathsTouch.java @@ -17,10 +17,11 @@ public class CurseDeathsTouch extends Curse { @Override
public boolean attackedByPlayerActionCancelable(
- LivingAttackEvent event, World world, EntityPlayer player,
- Entity target) {
+ LivingAttackEvent event, World world,
+ EntityPlayer player, Entity target) {
if (!world.isRemote) {
- target.attackEntityFrom(DamageSource.wither, event.ammount);
+ target.attackEntityFrom(DamageSource.wither,
+ event.ammount);
}
return true;
@@ -28,14 +29,15 @@ public class CurseDeathsTouch extends Curse { @Override
public String getDescription() {
- return StatCollector.translateToLocal(
- "curse." + Variables.MODID + ".deathsTouch.description");
+ return StatCollector.translateToLocal("curse."
+ + Variables.MODID
+ + ".deathsTouch.description");
}
@Override
public String getDisplayName() {
- return StatCollector.translateToLocal(
- "curse." + Variables.MODID + ".deathsTouch");
+ return StatCollector.translateToLocal("curse."
+ + Variables.MODID + ".deathsTouch");
}
@Override
diff --git a/src/main/java/darkknight/jewelrycraft/curses/CurseDoubleDown.java b/src/main/java/darkknight/jewelrycraft/curses/CurseDoubleDown.java index d1d872b..202d8bf 100755 --- a/src/main/java/darkknight/jewelrycraft/curses/CurseDoubleDown.java +++ b/src/main/java/darkknight/jewelrycraft/curses/CurseDoubleDown.java @@ -44,14 +44,15 @@ public class CurseDoubleDown extends Curse { @Override public String getDescription() { - return StatCollector.translateToLocal( - "curse." + Variables.MODID + ".doubledown.description"); + return StatCollector.translateToLocal("curse." + + Variables.MODID + + ".doubledown.description"); } @Override public String getDisplayName() { - return StatCollector.translateToLocal( - "curse." + Variables.MODID + ".doubledown"); + return StatCollector.translateToLocal("curse." + + Variables.MODID + ".doubledown"); } @Override diff --git a/src/main/java/darkknight/jewelrycraft/curses/CurseFlamingSoul.java b/src/main/java/darkknight/jewelrycraft/curses/CurseFlamingSoul.java index e808c84..9811eb8 100755 --- a/src/main/java/darkknight/jewelrycraft/curses/CurseFlamingSoul.java +++ b/src/main/java/darkknight/jewelrycraft/curses/CurseFlamingSoul.java @@ -13,15 +13,16 @@ public class CurseFlamingSoul extends Curse { super(name, txtID, pack);
}
- public void attackedByPlayerAction(World world, EntityPlayer player,
- Entity target) {
+ public void attackedByPlayerAction(World world,
+ EntityPlayer player, Entity target) {
player.setFire(5);
}
@Override
public String getDescription() {
- return StatCollector.translateToLocal(
- "curse." + Variables.MODID + ".flamingsoul.description");
+ return StatCollector.translateToLocal("curse."
+ + Variables.MODID
+ + ".flamingsoul.description");
}
@Override
@@ -31,7 +32,7 @@ public class CurseFlamingSoul extends Curse { @Override
public String getDisplayName() {
- return StatCollector.translateToLocal(
- "curse." + Variables.MODID + ".flamingsoul");
+ return StatCollector.translateToLocal("curse."
+ + Variables.MODID + ".flamingsoul");
}
}
diff --git a/src/main/java/darkknight/jewelrycraft/curses/CurseGreed.java b/src/main/java/darkknight/jewelrycraft/curses/CurseGreed.java index 5d8d29c..4ea7ba3 100755 --- a/src/main/java/darkknight/jewelrycraft/curses/CurseGreed.java +++ b/src/main/java/darkknight/jewelrycraft/curses/CurseGreed.java @@ -24,8 +24,8 @@ public class CurseGreed extends Curse { @Override
public String getDescription() {
- return StatCollector.translateToLocal(
- "curse." + Variables.MODID + ".greed.description");
+ return StatCollector.translateToLocal("curse."
+ + Variables.MODID + ".greed.description");
}
@Override
@@ -35,7 +35,7 @@ public class CurseGreed extends Curse { @Override
public String getDisplayName() {
- return StatCollector
- .translateToLocal("curse." + Variables.MODID + ".greed");
+ return StatCollector.translateToLocal(
+ "curse." + Variables.MODID + ".greed");
}
}
diff --git a/src/main/java/darkknight/jewelrycraft/curses/CurseHumbleBundle.java b/src/main/java/darkknight/jewelrycraft/curses/CurseHumbleBundle.java index 3ad73f2..76487a6 100755 --- a/src/main/java/darkknight/jewelrycraft/curses/CurseHumbleBundle.java +++ b/src/main/java/darkknight/jewelrycraft/curses/CurseHumbleBundle.java @@ -42,15 +42,17 @@ public class CurseHumbleBundle extends Curse { for (ItemStack item : event.drops) {
ItemStack drop = item.copy();
- if (drop.getItem() != Item.getItemFromBlock(event.block))
- dropItem(event.world, event.x, event.y, event.z, drop);
+ if (drop.getItem() != Item
+ .getItemFromBlock(event.block))
+ dropItem(event.world, event.x, event.y,
+ event.z, drop);
}
}
public void dropItem(World world, double x, double y, double z,
ItemStack stack) {
- EntityItem entityitem =
- new EntityItem(world, x + 0.5D, y + 0.5D, z + 0.5D, stack);
+ EntityItem entityitem = new EntityItem(world, x + 0.5D,
+ y + 0.5D, z + 0.5D, stack);
entityitem.motionX = 0;
entityitem.motionZ = 0;
entityitem.motionY = 0.11000000298023224D;
@@ -59,14 +61,15 @@ public class CurseHumbleBundle extends Curse { @Override
public String getDescription() {
- return StatCollector.translateToLocal(
- "curse." + Variables.MODID + ".humblebundle.description");
+ return StatCollector.translateToLocal("curse."
+ + Variables.MODID
+ + ".humblebundle.description");
}
@Override
public String getDisplayName() {
- return StatCollector.translateToLocal(
- "curse." + Variables.MODID + ".humblebundle");
+ return StatCollector.translateToLocal("curse."
+ + Variables.MODID + ".humblebundle");
}
@Override
diff --git a/src/main/java/darkknight/jewelrycraft/curses/CurseIncredibleDevotion.java b/src/main/java/darkknight/jewelrycraft/curses/CurseIncredibleDevotion.java index 43fa756..da88c50 100755 --- a/src/main/java/darkknight/jewelrycraft/curses/CurseIncredibleDevotion.java +++ b/src/main/java/darkknight/jewelrycraft/curses/CurseIncredibleDevotion.java @@ -18,22 +18,24 @@ public class CurseIncredibleDevotion extends Curse { public void entityDeathAction(World world, EntityLivingBase target, EntityPlayer player) { if (rand.nextInt(10) == 0) { - world.createExplosion(target, target.posX, target.posY, - target.posZ, target.getMaxHealth() / (10.0f - * (1 / ConfigHandler.DEVOTION_FACTOR)), + world.createExplosion(target, target.posX, + target.posY, target.posZ, + target.getMaxHealth() / (10.0f * (1 + / ConfigHandler.DEVOTION_FACTOR)), true); } } @Override public String getDisplayName() { - return StatCollector.translateToLocal( - "curse." + Variables.MODID + ".incredibledevotion"); + return StatCollector.translateToLocal("curse." + + Variables.MODID + ".incredibledevotion"); } @Override public String getDescription() { - return StatCollector.translateToLocal("curse." + Variables.MODID + return StatCollector.translateToLocal("curse." + + Variables.MODID + ".incredibledevotion.description"); } } diff --git a/src/main/java/darkknight/jewelrycraft/curses/CurseInfamy.java b/src/main/java/darkknight/jewelrycraft/curses/CurseInfamy.java index 8d99006..720ea6f 100755 --- a/src/main/java/darkknight/jewelrycraft/curses/CurseInfamy.java +++ b/src/main/java/darkknight/jewelrycraft/curses/CurseInfamy.java @@ -41,26 +41,32 @@ public class CurseInfamy extends Curse { && !(target instanceof EntityHalfHeart)
&& target.canAttackWithItem()) {
NBTTagCompound playerInfo = PlayerUtils
- .getModPlayerPersistTag(player, Variables.MODID);
+ .getModPlayerPersistTag(player,
+ Variables.MODID);
playerInfo.setFloat("BlackHeart",
- playerInfo.getFloat("BlackHeart") + 1.0F);
+ playerInfo.getFloat("BlackHeart")
+ + 1.0F);
if (player.getMaxHealth() >= 3F) {
player.getEntityAttribute(
SharedMonsterAttributes.maxHealth)
- .setBaseValue(player.getMaxHealth() - 1.0F);
+ .setBaseValue(player
+ .getMaxHealth()
+ - 1.0F);
- player.setHealth(player.getHealth() - 1.0F);
+ player.setHealth(
+ player.getHealth() - 1.0F);
}
JewelrycraftUtil.addCursePoints(player, 10);
- JewelrycraftMod.netWrapper
- .sendToAll(new PacketSendServerPlayersInfo());
+ JewelrycraftMod.netWrapper.sendToAll(
+ new PacketSendServerPlayersInfo());
JewelrycraftMod.netWrapper.sendTo(
- new PacketSendClientPlayerInfo(playerInfo),
+ new PacketSendClientPlayerInfo(
+ playerInfo),
(EntityPlayerMP) player);
}
}
@@ -71,15 +77,18 @@ public class CurseInfamy extends Curse { MaskRender mask = new MaskRender();
float yaw = player.prevRotationYawHead
- + (player.rotationYawHead - player.prevRotationYawHead)
+ + (player.rotationYawHead
+ - player.prevRotationYawHead)
* event.partialRenderTick;
float yawOffset = player.prevRenderYawOffset
- + (player.renderYawOffset - player.prevRenderYawOffset)
+ + (player.renderYawOffset
+ - player.prevRenderYawOffset)
* event.partialRenderTick;
float pitch = player.prevRotationPitch
- + (player.rotationPitch - player.prevRotationPitch)
+ + (player.rotationPitch
+ - player.prevRotationPitch)
* event.partialRenderTick;
GL11.glPushMatrix();
GL11.glColor4f(1, 1, 1, 1);
@@ -96,14 +105,14 @@ public class CurseInfamy extends Curse { @Override
public String getDescription() {
- return StatCollector.translateToLocal(
- "curse." + Variables.MODID + ".infamy.description");
+ return StatCollector.translateToLocal("curse."
+ + Variables.MODID + ".infamy.description");
}
@Override
public String getDisplayName() {
- return StatCollector
- .translateToLocal("curse." + Variables.MODID + ".infamy");
+ return StatCollector.translateToLocal(
+ "curse." + Variables.MODID + ".infamy");
}
@Override
diff --git a/src/main/java/darkknight/jewelrycraft/curses/CurseMidasTouch.java b/src/main/java/darkknight/jewelrycraft/curses/CurseMidasTouch.java index ef78b12..d576803 100755 --- a/src/main/java/darkknight/jewelrycraft/curses/CurseMidasTouch.java +++ b/src/main/java/darkknight/jewelrycraft/curses/CurseMidasTouch.java @@ -44,19 +44,26 @@ public class CurseMidasTouch extends Curse { if (!world.isRemote && target instanceof EntityLivingBase
&& !(target instanceof EntityHeart)
&& !(target instanceof EntityHalfHeart)
- && player.inventory.getCurrentItem() == null) {
- world.setBlock(MathHelper.floor_double(target.posX),
- MathHelper.floor_double(target.posY),
- MathHelper.floor_double(target.posZ),
+ && player.inventory
+ .getCurrentItem() == null) {
+ world.setBlock(MathHelper
+ .floor_double(target.posX),
+ MathHelper.floor_double(
+ target.posY),
+ MathHelper.floor_double(
+ target.posZ),
BlockList.midasTouchBlock, 0, 2);
- TileEntityMidasTouch midasTouchVictim =
- new TileEntityMidasTouch();
+ TileEntityMidasTouch midasTouchVictim = new TileEntityMidasTouch();
midasTouchVictim.setEntity(target);
- world.setTileEntity(MathHelper.floor_double(target.posX),
- MathHelper.floor_double(target.posY),
- MathHelper.floor_double(target.posZ),
+ world.setTileEntity(
+ MathHelper.floor_double(
+ target.posX),
+ MathHelper.floor_double(
+ target.posY),
+ MathHelper.floor_double(
+ target.posZ),
midasTouchVictim);
target.setDead();
@@ -67,13 +74,15 @@ public class CurseMidasTouch extends Curse { public void action(World world, EntityPlayer player) {
ItemStack curItem = player.inventory.getCurrentItem();
- if (curItem != null && curItem.getItem() != ItemList.goldObj
+ if (curItem != null
+ && curItem.getItem() != ItemList.goldObj
&& !isGoldenObject(curItem.getItem())) {
int index = player.inventory.currentItem;
ItemStack item = curItem;
ItemStack result = new ItemStack(ItemList.goldObj,
- item.stackSize, item.getItemDamage());
+ item.stackSize,
+ item.getItemDamage());
JewelryNBT.addItem(result, item);
@@ -81,69 +90,99 @@ public class CurseMidasTouch extends Curse { result = changeItem(curItem);
}
- player.inventory.setInventorySlotContents(index, result);
+ player.inventory.setInventorySlotContents(index,
+ result);
}
}
public ItemStack changeItem(ItemStack currItem) {
if (currItem.getItem() instanceof ItemSword) {
- return new ItemStack(Items.golden_sword, currItem.stackSize,
+ return new ItemStack(Items.golden_sword,
+ currItem.stackSize,
currItem.getItemDamage());
} else if (currItem.getItem() instanceof ItemSpade) {
- return new ItemStack(Items.golden_shovel, currItem.stackSize,
+ return new ItemStack(Items.golden_shovel,
+ currItem.stackSize,
currItem.getItemDamage());
} else if (currItem.getItem() instanceof ItemPickaxe) {
- return new ItemStack(Items.golden_pickaxe, currItem.stackSize,
+ return new ItemStack(Items.golden_pickaxe,
+ currItem.stackSize,
currItem.getItemDamage());
} else if (currItem.getItem() instanceof ItemAxe) {
- return new ItemStack(Items.golden_axe, currItem.stackSize,
+ return new ItemStack(Items.golden_axe,
+ currItem.stackSize,
currItem.getItemDamage());
} else if (currItem.getItem() instanceof ItemHoe) {
- return new ItemStack(Items.golden_hoe, currItem.stackSize,
+ return new ItemStack(Items.golden_hoe,
+ currItem.stackSize,
currItem.getItemDamage());
} else if (currItem.getItem() instanceof ItemArmor
- && ((ItemArmor) currItem.getItem()).armorType == 0) {
- return new ItemStack(Items.golden_helmet, currItem.stackSize,
+ && ((ItemArmor) currItem
+ .getItem()).armorType == 0) {
+ return new ItemStack(Items.golden_helmet,
+ currItem.stackSize,
currItem.getItemDamage());
} else if (currItem.getItem() instanceof ItemArmor
- && ((ItemArmor) currItem.getItem()).armorType == 1) {
+ && ((ItemArmor) currItem
+ .getItem()).armorType == 1) {
return new ItemStack(Items.golden_chestplate,
- currItem.stackSize, currItem.getItemDamage());
+ currItem.stackSize,
+ currItem.getItemDamage());
} else if (currItem.getItem() instanceof ItemArmor
- && ((ItemArmor) currItem.getItem()).armorType == 2) {
- return new ItemStack(Items.golden_leggings, currItem.stackSize,
+ && ((ItemArmor) currItem
+ .getItem()).armorType == 2) {
+ return new ItemStack(Items.golden_leggings,
+ currItem.stackSize,
currItem.getItemDamage());
} else if (currItem.getItem() instanceof ItemArmor
- && ((ItemArmor) currItem.getItem()).armorType == 3) {
- return new ItemStack(Items.golden_boots, currItem.stackSize,
+ && ((ItemArmor) currItem
+ .getItem()).armorType == 3) {
+ return new ItemStack(Items.golden_boots,
+ currItem.stackSize,
currItem.getItemDamage());
- } else if (currItem.getItem().getUnlocalizedName().toLowerCase()
- .contains("horsearmor")) {
+ } else if (currItem.getItem().getUnlocalizedName()
+ .toLowerCase().contains("horsearmor")) {
return new ItemStack(Items.golden_horse_armor,
currItem.stackSize, 0);
- } else if (currItem.getItem().getUnlocalizedName().toLowerCase()
- .contains("nugget")
- || currItem.getItem().getItemStackDisplayName(currItem)
- .toLowerCase().contains(" nugget")
- || currItem.getItem().getItemStackDisplayName(currItem)
- .toLowerCase().contains("nugget ")) {
- return new ItemStack(Items.gold_nugget, currItem.stackSize, 0);
- } else if (currItem.getItem().getUnlocalizedName().toLowerCase()
- .contains("ingot")
- || currItem.getItem().getItemStackDisplayName(currItem)
- .toLowerCase().contains(" ingot")
- || currItem.getItem().getItemStackDisplayName(currItem)
- .toLowerCase().contains("ingot ")) {
- return new ItemStack(Items.gold_ingot, currItem.stackSize, 0);
- } else if (Block.getBlockFromItem(
- currItem.getItem()) instanceof BlockPressurePlate
+ } else if (currItem.getItem().getUnlocalizedName()
+ .toLowerCase().contains("nugget")
+ || currItem.getItem()
+ .getItemStackDisplayName(
+ currItem)
+ .toLowerCase()
+ .contains(" nugget")
+ || currItem.getItem()
+ .getItemStackDisplayName(
+ currItem)
+ .toLowerCase()
+ .contains("nugget ")) {
+ return new ItemStack(Items.gold_nugget,
+ currItem.stackSize, 0);
+ } else if (currItem.getItem().getUnlocalizedName()
+ .toLowerCase().contains("ingot")
+ || currItem.getItem()
+ .getItemStackDisplayName(
+ currItem)
+ .toLowerCase()
+ .contains(" ingot")
+ || currItem.getItem()
+ .getItemStackDisplayName(
+ currItem)
+ .toLowerCase()
+ .contains("ingot ")) {
+ return new ItemStack(Items.gold_ingot,
+ currItem.stackSize, 0);
+ } else if (Block.getBlockFromItem(currItem
+ .getItem()) instanceof BlockPressurePlate
|| Block.getBlockFromItem(currItem
.getItem()) instanceof BlockPressurePlateWeighted) {
- return new ItemStack(Blocks.light_weighted_pressure_plate,
+ return new ItemStack(
+ Blocks.light_weighted_pressure_plate,
+ currItem.stackSize, 0);
+ } else if (Block.getBlockFromItem(currItem
+ .getItem()) instanceof BlockCompressed) {
+ return new ItemStack(Blocks.gold_block,
currItem.stackSize, 0);
- } else if (Block.getBlockFromItem(
- currItem.getItem()) instanceof BlockCompressed) {
- return new ItemStack(Blocks.gold_block, currItem.stackSize, 0);
}
return null;
@@ -163,21 +202,23 @@ public class CurseMidasTouch extends Curse { || item.equals(Items.golden_apple)
|| item.equals(Items.golden_hoe)
|| item.equals(Items.golden_horse_armor)
- || Block.getBlockFromItem(item).equals(Blocks.gold_block)
|| Block.getBlockFromItem(item)
- .equals(Blocks.light_weighted_pressure_plate);
+ .equals(Blocks.gold_block)
+ || Block.getBlockFromItem(item).equals(
+ Blocks.light_weighted_pressure_plate);
}
@Override
public String getDescription() {
- return StatCollector.translateToLocal(
- "curse." + Variables.MODID + ".midastouch.description");
+ return StatCollector.translateToLocal("curse."
+ + Variables.MODID
+ + ".midastouch.description");
}
@Override
public String getDisplayName() {
- return StatCollector.translateToLocal(
- "curse." + Variables.MODID + ".midastouch");
+ return StatCollector.translateToLocal("curse."
+ + Variables.MODID + ".midastouch");
}
@Override
@@ -195,7 +236,8 @@ public class CurseMidasTouch extends Curse { }
@Override
- public int weight(World world, EntityPlayer player, Random random) {
+ public int weight(World world, EntityPlayer player,
+ Random random) {
return 2;
}
}
diff --git a/src/main/java/darkknight/jewelrycraft/curses/CursePentagram.java b/src/main/java/darkknight/jewelrycraft/curses/CursePentagram.java index a65517d..bf40d55 100755 --- a/src/main/java/darkknight/jewelrycraft/curses/CursePentagram.java +++ b/src/main/java/darkknight/jewelrycraft/curses/CursePentagram.java @@ -38,73 +38,91 @@ public class CursePentagram extends Curse { super.action(world, player);
if (!world.isRemote) {
NBTTagCompound playerInfo = PlayerUtils
- .getModPlayerPersistTag(player, Variables.MODID);
+ .getModPlayerPersistTag(player,
+ Variables.MODID);
for (Object entity : world
- .getEntitiesWithinAABBExcludingEntity(player,
+ .getEntitiesWithinAABBExcludingEntity(
+ player,
AxisAlignedBB.getBoundingBox(
- player.boundingBox.minX - 0.5F,
+ player.boundingBox.minX
+ - 0.5F,
player.boundingBox.minY,
- player.boundingBox.minZ - 0.5F,
- player.boundingBox.maxX + 0.5F,
+ player.boundingBox.minZ
+ - 0.5F,
+ player.boundingBox.maxX
+ + 0.5F,
player.boundingBox.maxY,
- player.boundingBox.maxZ + 0.5F))) {
+ player.boundingBox.maxZ
+ + 0.5F))) {
if (entity instanceof EntityLivingBase) {
- NBTTagCompound target =
- ((EntityLivingBase) entity).getEntityData();
-
- if (target
- .getInteger("stolenHealth") < (JewelrycraftUtil
- .AchievemtUnlocked(player,
- AchievementsList.pentagram) ? 3
- : 2)
- && rand.nextInt(40) == 0) {
+ NBTTagCompound target = ((EntityLivingBase) entity)
+ .getEntityData();
+
+ int maxHealthStolen = JewelrycraftUtil
+ .isAchievementUnlocked(
+ player,
+ AchievementsList.pentagram)
+ ? 3
+ : 2;
+
+ boolean canStealHealth = target
+ .getInteger("stolenHealth") < maxHealthStolen;
+
+ if (canStealHealth && rand.nextInt(
+ 40) == 0) {
((EntityLivingBase) entity)
.getEntityAttribute(
SharedMonsterAttributes.maxHealth)
.setBaseValue(((EntityLivingBase) entity)
- .getMaxHealth() - 2f);
+ .getMaxHealth()
+ - 2f);
- target.setInteger("stolenHealth",
+ target.setInteger(
+ "stolenHealth",
target.hasKey("stolenHealth")
- ? target.getInteger("stolenHealth")
+ ? target.getInteger(
+ "stolenHealth")
+ 1
: 1);
- playerInfo
- .setInteger("heartsStolen",
- playerInfo.hasKey("heartsStolen")
- ? playerInfo.getInteger(
- "heartsStolen") + 1
- : 1);
+ playerInfo.setInteger(
+ "heartsStolen",
+ playerInfo.hasKey(
+ "heartsStolen") ? playerInfo.getInteger("heartsStolen") + 1 : 1);
if (player.shouldHeal()) {
player.heal(2F);
} else {
player.getEntityAttribute(
SharedMonsterAttributes.maxHealth)
- .setBaseValue(
- player.getMaxHealth() + 2f);
+ .setBaseValue(player
+ .getMaxHealth()
+ + 2f);
}
}
}
}
- if (!playerInfo
- .getBoolean(AchievementsList.pentagram.statId)) {
- if (ticksActive > 24000
- && playerInfo.getInteger("heartsStolen") <= 0)
- player.addStat(AchievementsList.pentagram, 1);
+ if (!playerInfo.getBoolean(
+ AchievementsList.pentagram.statId)) {
+ if (ticksActive > 24000 && playerInfo
+ .getInteger("heartsStolen") <= 0)
+ player.addStat(AchievementsList.pentagram,
+ 1);
else {
player.addChatComponentMessage(
- new ChatComponentText(EnumChatFormatting.RED
- + StatCollector.translateToLocal(
- "challenge.failed")
- + " " + EnumChatFormatting.GOLD
- + StatCollector.translateToLocal(
- AchievementsList.pentagram.statId)));
+ new ChatComponentText(
+ EnumChatFormatting.RED
+ + StatCollector.translateToLocal(
+ "challenge.failed")
+ + " "
+ + EnumChatFormatting.GOLD
+ + StatCollector.translateToLocal(
+ AchievementsList.pentagram.statId)));
playerInfo.setBoolean(
- AchievementsList.pentagram.statId, true);
+ AchievementsList.pentagram.statId,
+ true);
}
}
}
@@ -114,19 +132,22 @@ public class CursePentagram extends Curse { @Override
public void playerRender(EntityPlayer player,
RenderPlayerEvent.Specials.Post event) {
- ResourceLocation PENTAGRAM_TEXTURE =
- new ResourceLocation(Variables.MODID,
- "textures/gui/" + getTexturePack() + ".png");
+ ResourceLocation PENTAGRAM_TEXTURE = new ResourceLocation(
+ Variables.MODID,
+ "textures/gui/" + getTexturePack()
+ + ".png");
GL11.glPushMatrix();
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_SRC_COLOR);
Tessellator tessellator = Tessellator.instance;
- TextureManager texturemanager =
- Minecraft.getMinecraft().getTextureManager();
+ TextureManager texturemanager = Minecraft.getMinecraft()
+ .getTextureManager();
texturemanager.bindTexture(PENTAGRAM_TEXTURE);
GL11.glRotatef(rot, 0F, 1F, 0F);
GL11.glTranslatef(-0.8F,
- (player.isSneaking() ? 0.1625F : 0F) + 1.5F, -0.8F);
+ (player.isSneaking() ? 0.1625F : 0F)
+ + 1.5F,
+ -0.8F);
GL11.glRotatef(90F, 1F, 0F, 0F);
GL11.glScalef(0.05F, 0.05F, 0.05F);
rot += 3F;
@@ -149,11 +170,13 @@ public class CursePentagram extends Curse { (double) (y + height), (double) 0,
(double) ((float) (u + width) * f),
(double) ((float) (v + height) * f1));
- tessellator.addVertexWithUV((double) (x + width), (double) (y + 0),
- (double) 0, (double) ((float) (u + width) * f),
+ tessellator.addVertexWithUV((double) (x + width),
+ (double) (y + 0), (double) 0,
+ (double) ((float) (u + width) * f),
(double) ((float) (v + 0) * f1));
- tessellator.addVertexWithUV((double) (x + 0), (double) (y + 0),
- (double) 0, (double) ((float) (u + 0) * f),
+ tessellator.addVertexWithUV((double) (x + 0),
+ (double) (y + 0), (double) 0,
+ (double) ((float) (u + 0) * f),
(double) ((float) (v + 0) * f1));
tessellator.draw();
GL11.glDisable(GL11.GL_BLEND);
@@ -166,19 +189,23 @@ public class CursePentagram extends Curse { public void playerHandRender(EntityPlayer player,
RenderHandEvent event) {
if (Minecraft.getMinecraft().gameSettings.thirdPersonView == 0) {
- ResourceLocation PENTAGRAM_TEXTURE =
- new ResourceLocation(Variables.MODID,
- "textures/gui/" + getTexturePack() + ".png");
+ ResourceLocation PENTAGRAM_TEXTURE = new ResourceLocation(
+ Variables.MODID,
+ "textures/gui/" + getTexturePack()
+ + ".png");
GL11.glPushMatrix();
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_SRC_COLOR);
Tessellator tessellator = Tessellator.instance;
- TextureManager texturemanager =
- Minecraft.getMinecraft().getTextureManager();
+ TextureManager texturemanager = Minecraft
+ .getMinecraft()
+ .getTextureManager();
texturemanager.bindTexture(PENTAGRAM_TEXTURE);
GL11.glRotatef(rot, 0F, 1F, 0F);
GL11.glTranslatef(-0.8F,
- (player.isSneaking() ? 0.1625F : 0F) - 1.6F, -0.8F);
+ (player.isSneaking() ? 0.1625F
+ : 0F) - 1.6F,
+ -0.8F);
GL11.glRotatef(90F, 1F, 0F, 0F);
GL11.glScalef(0.05F, 0.05F, 0.05F);
rot += 3F;
@@ -196,17 +223,20 @@ public class CursePentagram extends Curse { tessellator.addVertexWithUV((double) (x + 0),
(double) (y + height), (double) 0,
(double) ((float) (u + 0) * f),
- (double) ((float) (v + height) * f1));
+ (double) ((float) (v + height)
+ * f1));
tessellator.addVertexWithUV((double) (x + width),
(double) (y + height), (double) 0,
(double) ((float) (u + width) * f),
- (double) ((float) (v + height) * f1));
+ (double) ((float) (v + height)
+ * f1));
tessellator.addVertexWithUV((double) (x + width),
(double) (y + 0), (double) 0,
(double) ((float) (u + width) * f),
(double) ((float) (v + 0) * f1));
- tessellator.addVertexWithUV((double) (x + 0), (double) (y + 0),
- (double) 0, (double) ((float) (u + 0) * f),
+ tessellator.addVertexWithUV((double) (x + 0),
+ (double) (y + 0), (double) 0,
+ (double) ((float) (u + 0) * f),
(double) ((float) (v + 0) * f1));
tessellator.draw();
GL11.glDisable(GL11.GL_BLEND);
@@ -216,8 +246,9 @@ public class CursePentagram extends Curse { @Override
public String getDescription() {
- return StatCollector.translateToLocal(
- "curse." + Variables.MODID + ".pentagram.description");
+ return StatCollector.translateToLocal("curse."
+ + Variables.MODID
+ + ".pentagram.description");
}
@Override
diff --git a/src/main/java/darkknight/jewelrycraft/curses/CurseRabbitsPaw.java b/src/main/java/darkknight/jewelrycraft/curses/CurseRabbitsPaw.java index c185df3..da61cd7 100755 --- a/src/main/java/darkknight/jewelrycraft/curses/CurseRabbitsPaw.java +++ b/src/main/java/darkknight/jewelrycraft/curses/CurseRabbitsPaw.java @@ -39,8 +39,10 @@ public class CurseRabbitsPaw extends Curse { public void entityDeathAction(World world, EntityLivingBase target,
EntityPlayer player) {
if (rand.nextInt(3) == 0)
- world.spawnEntityInWorld(new EntityXPOrb(world, target.posX,
- target.posY, target.posZ, 1 + rand.nextInt(40)));
+ world.spawnEntityInWorld(new EntityXPOrb(world,
+ target.posX, target.posY,
+ target.posZ,
+ 1 + rand.nextInt(40)));
}
@Override
@@ -50,14 +52,15 @@ public class CurseRabbitsPaw extends Curse { @Override
public String getDescription() {
- return StatCollector.translateToLocal(
- "curse." + Variables.MODID + ".rabbitspaw.description");
+ return StatCollector.translateToLocal("curse."
+ + Variables.MODID
+ + ".rabbitspaw.description");
}
@Override
public String getDisplayName() {
- return StatCollector.translateToLocal(
- "curse." + Variables.MODID + ".rabbitspaw");
+ return StatCollector.translateToLocal("curse."
+ + Variables.MODID + ".rabbitspaw");
}
@Override
diff --git a/src/main/java/darkknight/jewelrycraft/curses/CurseRottenHeart.java b/src/main/java/darkknight/jewelrycraft/curses/CurseRottenHeart.java index 050605d..78d10bc 100755 --- a/src/main/java/darkknight/jewelrycraft/curses/CurseRottenHeart.java +++ b/src/main/java/darkknight/jewelrycraft/curses/CurseRottenHeart.java @@ -17,20 +17,23 @@ public class CurseRottenHeart extends Curse { @Override
public void action(World world, EntityPlayer player) {
if (!player.isPotionActive(Potion.poison) || player
- .getActivePotionEffect(Potion.poison).getDuration() < 30)
- player.addPotionEffect(new PotionEffect(Potion.poison.id, 80));
+ .getActivePotionEffect(Potion.poison)
+ .getDuration() < 30)
+ player.addPotionEffect(new PotionEffect(
+ Potion.poison.id, 80));
}
@Override
public String getDescription() {
- return StatCollector.translateToLocal(
- "curse." + Variables.MODID + ".rottenheart.description");
+ return StatCollector.translateToLocal("curse."
+ + Variables.MODID
+ + ".rottenheart.description");
}
@Override
public String getDisplayName() {
- return StatCollector.translateToLocal(
- "curse." + Variables.MODID + ".rottenheart");
+ return StatCollector.translateToLocal("curse."
+ + Variables.MODID + ".rottenheart");
}
@Override
diff --git a/src/main/java/darkknight/jewelrycraft/curses/CurseSacredOath.java b/src/main/java/darkknight/jewelrycraft/curses/CurseSacredOath.java index 8faf314..2465b89 100644 --- a/src/main/java/darkknight/jewelrycraft/curses/CurseSacredOath.java +++ b/src/main/java/darkknight/jewelrycraft/curses/CurseSacredOath.java @@ -12,15 +12,16 @@ public class CurseSacredOath extends Curse { @Override public String getDescription() { - return StatCollector.translateToLocal( - "curse." + Variables.MODID + ".sacredoath.description"); + return StatCollector.translateToLocal("curse." + + Variables.MODID + + ".sacredoath.description"); } @Override public String getDisplayName() { - return StatCollector.translateToLocal( - "curse." + Variables.MODID + ".sacredoath"); + return StatCollector.translateToLocal("curse." + + Variables.MODID + ".sacredoath"); } - + // TODO implement sacred oath to do something } diff --git a/src/main/java/darkknight/jewelrycraft/curses/CurseScionOfHell.java b/src/main/java/darkknight/jewelrycraft/curses/CurseScionOfHell.java index 4162001..2264017 100755 --- a/src/main/java/darkknight/jewelrycraft/curses/CurseScionOfHell.java +++ b/src/main/java/darkknight/jewelrycraft/curses/CurseScionOfHell.java @@ -10,7 +10,8 @@ import net.minecraft.world.World; import net.minecraftforge.event.entity.living.LivingHealEvent; public class CurseScionOfHell extends Curse { - public CurseScionOfHell(String name, int txtID, String texturepack) { + public CurseScionOfHell(String name, int txtID, + String texturepack) { super(name, txtID, texturepack); } @@ -18,7 +19,8 @@ public class CurseScionOfHell extends Curse { public void entityDeathAction(World world, EntityLivingBase target, EntityPlayer player) { player.setHealth(Math.max(player.getMaxHealth(), - player.getHealth() + target.getMaxHealth() / 5.0f)); + player.getHealth() + target.getMaxHealth() + / 5.0f)); } @Override @@ -34,13 +36,14 @@ public class CurseScionOfHell extends Curse { @Override public String getDescription() { - return StatCollector.translateToLocal( - "curse." + Variables.MODID + ".scionofhell.description"); + return StatCollector.translateToLocal("curse." + + Variables.MODID + + ".scionofhell.description"); } @Override public String getDisplayName() { - return StatCollector.translateToLocal( - "curse." + Variables.MODID + ".scionofhell"); + return StatCollector.translateToLocal("curse." + + Variables.MODID + ".scionofhell"); } } diff --git a/src/main/java/darkknight/jewelrycraft/curses/CurseVampireHunger.java b/src/main/java/darkknight/jewelrycraft/curses/CurseVampireHunger.java index 6707bc0..9b8c1f3 100755 --- a/src/main/java/darkknight/jewelrycraft/curses/CurseVampireHunger.java +++ b/src/main/java/darkknight/jewelrycraft/curses/CurseVampireHunger.java @@ -22,33 +22,36 @@ public class CurseVampireHunger extends Curse { super(name, txtID, texturepack);
}
- public void attackedByPlayerAction(World world, EntityPlayer player,
- Entity target) {
+ public void attackedByPlayerAction(World world,
+ EntityPlayer player, Entity target) {
if (player.shouldHeal() && rand.nextBoolean())
player.heal(1F);
}
@Override
public void action(World world, EntityPlayer player) {
- if (!player.capabilities.isCreativeMode && world.isDaytime()
- && !world.isRaining()
- && world.canBlockSeeTheSky(
- MathHelper.floor_double(player.posX),
- MathHelper.floor_double(player.posY + 1F),
- MathHelper.floor_double(player.posZ)))
+ if (!player.capabilities.isCreativeMode
+ && world.isDaytime() && !world.isRaining()
+ && world.canBlockSeeTheSky(MathHelper
+ .floor_double(player.posX),
+ MathHelper.floor_double(
+ player.posY + 1F),
+ MathHelper.floor_double(
+ player.posZ)))
player.setFire(8);
}
@Override
public String getDescription() {
- return StatCollector.translateToLocal(
- "curse." + Variables.MODID + ".vampirehunger.description");
+ return StatCollector.translateToLocal("curse."
+ + Variables.MODID
+ + ".vampirehunger.description");
}
@Override
public String getDisplayName() {
- return StatCollector.translateToLocal(
- "curse." + Variables.MODID + ".vampirehunger");
+ return StatCollector.translateToLocal("curse."
+ + Variables.MODID + ".vampirehunger");
}
@Override
diff --git a/src/main/java/darkknight/jewelrycraft/damage/DamageSourceList.java b/src/main/java/darkknight/jewelrycraft/damage/DamageSourceList.java index 64f696c..e156755 100755 --- a/src/main/java/darkknight/jewelrycraft/damage/DamageSourceList.java +++ b/src/main/java/darkknight/jewelrycraft/damage/DamageSourceList.java @@ -7,7 +7,8 @@ import net.minecraft.util.DamageSource; * @author Sorin
*/
public class DamageSourceList {
- public static DamageSource shadows, weak, blackHeart, doubleDown;
+ public static DamageSource shadows, weak, blackHeart,
+ doubleDown;
private static boolean isInitialized = false;
/**
@@ -15,11 +16,14 @@ public class DamageSourceList { */
public static void postInit(FMLPostInitializationEvent e) {
if (!isInitialized) {
- shadows = new DamageSource("shadows").setDamageBypassesArmor()
+ shadows = new DamageSource("shadows")
+ .setDamageBypassesArmor()
.setDamageIsAbsolute();
blackHeart = new DamageSource("blackHeart")
- .setDamageBypassesArmor().setDamageIsAbsolute();
- weak = new DamageSource("weak").setDamageBypassesArmor();
+ .setDamageBypassesArmor()
+ .setDamageIsAbsolute();
+ weak = new DamageSource("weak")
+ .setDamageBypassesArmor();
doubleDown = new DamageSource("doubleDown");
isInitialized = true;
}
diff --git a/src/main/java/darkknight/jewelrycraft/effects/EffectBlazePowder.java b/src/main/java/darkknight/jewelrycraft/effects/EffectBlazePowder.java index c735b2c..ebfa48c 100755 --- a/src/main/java/darkknight/jewelrycraft/effects/EffectBlazePowder.java +++ b/src/main/java/darkknight/jewelrycraft/effects/EffectBlazePowder.java @@ -21,26 +21,32 @@ public class EffectBlazePowder extends ModifierEffects { }
@Override
- public void action(ItemStack item, EntityPlayer player, Item jewelry) {
+ public void action(ItemStack item, EntityPlayer player,
+ Item jewelry) {
if (jewelry instanceof ItemNecklace) {
// Positive for necklace
- if (player.isBurning() && rand
- .nextInt(JewelryNBT.numberOfModifiers(item)) == 0)
+ if (player.isBurning() && rand.nextInt(JewelryNBT
+ .numberOfModifiers(item)) == 0)
player.extinguish();
// Negative for necklace
if (player.isInWater())
- player.attackEntityFrom(DamageSource.drown, 1f
- + (JewelryNBT.numberOfModifiers(item) - 1) * 0.1F);
+ player.attackEntityFrom(DamageSource.drown,
+ 1f + (JewelryNBT.numberOfModifiers(
+ item) - 1)
+ * 0.1F);
}
// Negative for bracelet
- if (jewelry instanceof ItemBracelet && player.isInWater()) {
- double slowAmount = 0.6D
- + (JewelryNBT.numberOfModifiers(item) - 1) * 0.05D;
+ if (jewelry instanceof ItemBracelet
+ && player.isInWater()) {
+ double slowAmount = 0.6D + (JewelryNBT
+ .numberOfModifiers(item) - 1)
+ * 0.05D;
player.motionX *= slowAmount;
player.motionY *= slowAmount;
player.motionZ *= slowAmount;
- player.motionY -= (0.02D
- + (JewelryNBT.numberOfModifiers(item) - 1) * 0.005D);
+ player.motionY -= (0.02D + (JewelryNBT
+ .numberOfModifiers(item) - 1)
+ * 0.005D);
if (player.isCollidedHorizontally)
player.motionY = 0.30000001192092896D;
}
@@ -49,8 +55,8 @@ public class EffectBlazePowder extends ModifierEffects { if (player.getAir() >= 300)
player.setAir(player.getAir() / 2);
else
- player.setAir(player.getAir()
- - JewelryNBT.numberOfModifiers(item));
+ player.setAir(player.getAir() - JewelryNBT
+ .numberOfModifiers(item));
}
}
@@ -60,24 +66,28 @@ public class EffectBlazePowder extends ModifierEffects { float amount) {
// Balanced for ring
if (jewelry instanceof ItemRing && !player.isInWater()
- && rand.nextInt(JewelryNBT.numberOfModifiers(item)) == 0)
+ && rand.nextInt(JewelryNBT
+ .numberOfModifiers(
+ item)) == 0)
target.setFire(2);
return false;
}
@Override
public boolean onPlayerAttackedCancellable(ItemStack item,
- EntityPlayer player, DamageSource source, Item jewelry,
- float amount) {
+ EntityPlayer player, DamageSource source,
+ Item jewelry, float amount) {
if (jewelry instanceof ItemEarrings && rand.nextInt(4) == 0
&& source == DamageSource.lava
|| source == DamageSource.inFire
|| source == DamageSource.onFire) {
// Positive for earrings
- int stackSize = JewelryNBT.modifierSize(item, modifier);
+ int stackSize = JewelryNBT.modifierSize(item,
+ modifier);
- player.heal(stackSize * 0.05F
- - (JewelryNBT.numberOfModifiers(item) - 1) * 0.01F);
+ player.heal(stackSize * 0.05F - (JewelryNBT
+ .numberOfModifiers(item) - 1)
+ * 0.01F);
return true;
}
@@ -86,24 +96,26 @@ public class EffectBlazePowder extends ModifierEffects { if (source == DamageSource.inFire
|| source == DamageSource.onFire
|| source == DamageSource.lava
- && player.worldObj.isMaterialInBB(
- AxisAlignedBB.getBoundingBox(
- player.boundingBox.minX,
- player.boundingBox.minY,
- player.boundingBox.minZ,
- player.boundingBox.maxX,
- player.boundingBox.maxY - 0.7,
- player.boundingBox.maxZ),
- Material.lava)
- && !player.worldObj.isMaterialInBB(
- AxisAlignedBB.getBoundingBox(
- player.boundingBox.minX,
- player.boundingBox.minY + 0.9,
- player.boundingBox.minZ,
- player.boundingBox.maxX,
- player.boundingBox.maxY,
- player.boundingBox.maxZ),
- Material.lava)) {
+ && player.worldObj
+ .isMaterialInBB(AxisAlignedBB
+ .getBoundingBox(player.boundingBox.minX,
+ player.boundingBox.minY,
+ player.boundingBox.minZ,
+ player.boundingBox.maxX,
+ player.boundingBox.maxY
+ - 0.7,
+ player.boundingBox.maxZ),
+ Material.lava)
+ && !player.worldObj
+ .isMaterialInBB(AxisAlignedBB
+ .getBoundingBox(player.boundingBox.minX,
+ player.boundingBox.minY
+ + 0.9,
+ player.boundingBox.minZ,
+ player.boundingBox.maxX,
+ player.boundingBox.maxY,
+ player.boundingBox.maxZ),
+ Material.lava)) {
return true;
}
diff --git a/src/main/java/darkknight/jewelrycraft/effects/EffectEnderEye.java b/src/main/java/darkknight/jewelrycraft/effects/EffectEnderEye.java index 6fcfac6..4f24e8f 100755 --- a/src/main/java/darkknight/jewelrycraft/effects/EffectEnderEye.java +++ b/src/main/java/darkknight/jewelrycraft/effects/EffectEnderEye.java @@ -37,8 +37,7 @@ public class EffectEnderEye extends ModifierEffects { if (jewelry instanceof ItemRing) {
int viewDistance;
- if (Minecraft
- .getMinecraft().gameSettings.renderDistanceChunks <= 2) {
+ if (Minecraft.getMinecraft().gameSettings.renderDistanceChunks <= 2) {
viewDistance = 10;
} else {
viewDistance = Minecraft
@@ -52,127 +51,167 @@ public class EffectEnderEye extends ModifierEffects { @Override
public void onJewelryUnequipped(ItemStack item, Item jewelry) {
if (jewelry instanceof ItemRing)
- Minecraft.getMinecraft().gameSettings.setOptionFloatValue(
- Options.RENDER_DISTANCE, getViewDistance(item));
+ Minecraft.getMinecraft().gameSettings
+ .setOptionFloatValue(
+ Options.RENDER_DISTANCE,
+ getViewDistance(item));
}
@SuppressWarnings("cast")
@Override
- public void action(ItemStack item, EntityPlayer player, Item jewelry) {
- if (jewelry instanceof ItemEarrings && !player.worldObj.isRemote) {
- for (Object e : player.worldObj.getEntitiesWithinAABB(
- EntityEnderman.class,
- player.boundingBox.expand(100D, 0D, 100D))) {
+ public void action(ItemStack item, EntityPlayer player,
+ Item jewelry) {
+ if (jewelry instanceof ItemEarrings
+ && !player.worldObj.isRemote) {
+ for (Object e : player.worldObj
+ .getEntitiesWithinAABB(
+ EntityEnderman.class,
+ player.boundingBox
+ .expand(100D, 0D,
+ 100D))) {
EntityEnderman enderman = (EntityEnderman) e;
- ReflectionHelper.setPrivateValue(EntityEnderman.class,
- enderman, -1, "stareTimer", "field_70826_g");
+ ReflectionHelper.setPrivateValue(
+ EntityEnderman.class,
+ enderman, -1, "stareTimer",
+ "field_70826_g");
- Vec3 vec3 = player.getLook(1.0F).normalize();
+ Vec3 vec3 = player.getLook(1.0F)
+ .normalize();
Vec3 vec31 = Vec3.createVectorHelper(
enderman.posX - player.posX,
enderman.boundingBox.minY
- + (double) (enderman.height / 2.0F)
- - (player.posY
- + (double) player.getEyeHeight()),
+ + (double) (enderman.height
+ / 2.0F)
+ - (player.posY + (double) player
+ .getEyeHeight()),
enderman.posZ - player.posZ);
double d0 = vec31.lengthVector();
vec31 = vec31.normalize();
double d1 = vec3.dotProduct(vec31);
if (d1 > 1.0D - 0.025D / d0
- && player.canEntityBeSeen(enderman)) {
+ && player.canEntityBeSeen(
+ enderman)) {
// Positive earrings
- if (rand.nextInt(
- JewelryNBT.numberOfModifiers(item)) == 0)
+ if (rand.nextInt(JewelryNBT
+ .numberOfModifiers(
+ item)) == 0)
enderman.setTarget(null);
// Negative earrings
- if (!player.isPotionActive(Potion.confusion) || player
- .getActivePotionEffect(Potion.confusion)
- .getDuration() <= 80)
- player.addPotionEffect(new PotionEffect(
- Potion.confusion.id, 300,
- 2 + JewelryNBT.numberOfModifiers(item)
- / 4));
+ if (!player.isPotionActive(
+ Potion.confusion)
+ || player.getActivePotionEffect(
+ Potion.confusion)
+ .getDuration() <= 80)
+ player.addPotionEffect(
+ new PotionEffect(
+ Potion.confusion.id,
+ 300,
+ 2 + JewelryNBT.numberOfModifiers(
+ item)
+ / 4));
}
}
}
// Positive necklace
- if (jewelry instanceof ItemNecklace && !player.worldObj.isRemote) {
+ if (jewelry instanceof ItemNecklace
+ && !player.worldObj.isRemote) {
ChunkPosition chunkposition = player.worldObj
- .findClosestStructure("Stronghold", (int) player.posX,
- (int) player.posY, (int) player.posZ);
+ .findClosestStructure("Stronghold",
+ (int) player.posX,
+ (int) player.posY,
+ (int) player.posZ);
if (chunkposition != null) {
Minecraft.getMinecraft().thePlayer.motionX += 0.01D
* Math.signum((double) chunkposition.chunkPosX
- player.posX)
- * (rand.nextInt(
- JewelryNBT.numberOfModifiers(item)) == 0
- ? 1 : -1);
+ * (rand.nextInt(JewelryNBT
+ .numberOfModifiers(
+ item)) == 0 ? 1
+ : -1);
Minecraft.getMinecraft().thePlayer.motionZ += 0.01D
* Math.signum((double) chunkposition.chunkPosZ
- player.posZ)
- * (rand.nextInt(
- JewelryNBT.numberOfModifiers(item)) == 0
- ? 1 : -1);
+ * (rand.nextInt(JewelryNBT
+ .numberOfModifiers(
+ item)) == 0 ? 1
+ : -1);
}
}
// Positive bracelet
- if (jewelry instanceof ItemBracelet && !player.worldObj.isRemote
- && player.worldObj.getBiomeGenForCoords((int) player.posX,
+ if (jewelry instanceof ItemBracelet
+ && !player.worldObj.isRemote
+ && player.worldObj.getBiomeGenForCoords(
+ (int) player.posX,
(int) player.posZ) == BiomeGenBase.sky
- && (!player.isPotionActive(Potion.moveSpeed)
- || player.getActivePotionEffect(Potion.moveSpeed)
+ && (!player.isPotionActive(
+ Potion.moveSpeed)
+ || player.getActivePotionEffect(
+ Potion.moveSpeed)
.getDuration() < 30))
- player.addPotionEffect(new PotionEffect(Potion.moveSpeed.id,
- 150 - JewelryNBT.numberOfModifiers(item) * 10,
- 2 - JewelryNBT.numberOfModifiers(item) / 5));
+ player.addPotionEffect(new PotionEffect(
+ Potion.moveSpeed.id,
+ 150 - JewelryNBT.numberOfModifiers(
+ item) * 10,
+ 2 - JewelryNBT.numberOfModifiers(
+ item) / 5));
// Negative bracelet
- if (jewelry instanceof ItemBracelet && !player.worldObj.isRemote
- && rand.nextInt(520
- - JewelryNBT.numberOfModifiers(item) * 20) == 15)
- player.setPositionAndUpdate(
- player.posX + rand.nextInt(30)
- * (rand.nextBoolean() ? -1 : 1),
- player.posY, player.posZ + rand.nextInt(30)
- * (rand.nextBoolean() ? -1 : 1));
+ if (jewelry instanceof ItemBracelet
+ && !player.worldObj.isRemote
+ && rand.nextInt(520 - JewelryNBT
+ .numberOfModifiers(item)
+ * 20) == 15)
+ player.setPositionAndUpdate(player.posX + rand
+ .nextInt(30)
+ * (rand.nextBoolean() ? -1 : 1),
+ player.posY,
+ player.posZ + rand.nextInt(30)
+ * (rand.nextBoolean()
+ ? -1
+ : 1));
// Negative ring
if (jewelry instanceof ItemRing && Minecraft
.getMinecraft().gameSettings.renderDistanceChunks != 2.2F
- - JewelryNBT.numberOfModifiers(item) * 0.1F)
- Minecraft.getMinecraft().gameSettings.setOptionFloatValue(
- Options.RENDER_DISTANCE,
- 2.2F - JewelryNBT.numberOfModifiers(item) * 0.1F);
+ - JewelryNBT.numberOfModifiers(
+ item)
+ * 0.1F)
+ Minecraft.getMinecraft().gameSettings
+ .setOptionFloatValue(
+ Options.RENDER_DISTANCE,
+ 2.2F - JewelryNBT
+ .numberOfModifiers(
+ item)
+ * 0.1F);
// Positive ring
if (jewelry instanceof ItemRing && rand.nextInt(
- 180 + JewelryNBT.numberOfModifiers(item) * 20) == 12) {
- for (int i = (int) player.posX - 2; i <= (int) player.posX + 2;
- i++)
- for (int j = (int) player.posY - 2;
- j <= (int) player.posY + 2; j++)
- for (int k = (int) player.posZ - 2;
- k <= (int) player.posZ + 2; k++)
- if (player.worldObj.getBlock(i, j,
- k) instanceof BlockOre)
+ 180 + JewelryNBT.numberOfModifiers(item)
+ * 20) == 12) {
+ for (int i = (int) player.posX
+ - 2; i <= (int) player.posX
+ + 2; i++)
+ for (int j = (int) player.posY
+ - 2; j <= (int) player.posY
+ + 2; j++)
+ for (int k = (int) player.posZ
+ - 2; k <= (int) player.posZ
+ + 2; k++)
+ if (player.worldObj
+ .getBlock(i, j, k) instanceof BlockOre)
player.addChatComponentMessage(
new ChatComponentText(
EnumChatFormatting.GRAY
- + StatCollector
- .translateToLocal(
- "chatmessage."
- + Variables.MODID
- + ".effect.endereye.1")
+ + StatCollector.translateToLocal(
+ "chatmessage." + Variables.MODID
+ + ".effect.endereye.1")
+ " "
+ player.worldObj
- .getBlock(i, j,
- k)
+ .getBlock(i, j, k)
.getLocalizedName()
+ " "
- + StatCollector
- .translateToLocal(
- "chatmessage."
- + Variables.MODID
- + ".effect.endereye.2")));
+ + StatCollector.translateToLocal(
+ "chatmessage." + Variables.MODID
+ + ".effect.endereye.2")));
}
}
@@ -180,12 +219,17 @@ public class EffectEnderEye extends ModifierEffects { public void onPlayerAttacked(ItemStack item, EntityPlayer player,
DamageSource source, Item jewelry, float amount) {
// Negative necklace
- if (jewelry instanceof ItemNecklace && !player.worldObj.isRemote)
- player.addPotionEffect(new PotionEffect(Potion.blindness.id,
- 100 + JewelryNBT.numberOfModifiers(item) * 30, 1));
+ if (jewelry instanceof ItemNecklace
+ && !player.worldObj.isRemote)
+ player.addPotionEffect(new PotionEffect(
+ Potion.blindness.id,
+ 100 + JewelryNBT.numberOfModifiers(
+ item) * 30,
+ 1));
}
- public static void setViewDistance(ItemStack item, int viewDistance) {
+ public static void setViewDistance(ItemStack item,
+ int viewDistance) {
NBTTagCompound itemStackData;
if (item.hasTagCompound())
itemStackData = item.getTagCompound();
diff --git a/src/main/java/darkknight/jewelrycraft/effects/EffectEnderPearl.java b/src/main/java/darkknight/jewelrycraft/effects/EffectEnderPearl.java index 0b48ba2..562d83e 100755 --- a/src/main/java/darkknight/jewelrycraft/effects/EffectEnderPearl.java +++ b/src/main/java/darkknight/jewelrycraft/effects/EffectEnderPearl.java @@ -27,57 +27,86 @@ public class EffectEnderPearl extends ModifierEffects { }
@Override
- public void action(ItemStack item, EntityPlayer player, Item jewelry) {
+ public void action(ItemStack item, EntityPlayer player,
+ Item jewelry) {
if (jewelry instanceof ItemEarrings) {
- AxisAlignedBB axisalignedbb =
- player.boundingBox.expand(2.0D, 2.0D, 2.0D);
- List<?> list = player.worldObj.getEntitiesWithinAABB(
- EntityArrow.class, axisalignedbb);
+ AxisAlignedBB axisalignedbb = player.boundingBox
+ .expand(2.0D, 2.0D, 2.0D);
+ List<?> list = player.worldObj
+ .getEntitiesWithinAABB(
+ EntityArrow.class,
+ axisalignedbb);
if (!player.worldObj.isRemote && list != null
&& !list.isEmpty()) {
Iterator<?> iterator = list.iterator();
while (iterator.hasNext()) {
- EntityArrow arrow = (EntityArrow) iterator.next();
+ EntityArrow arrow = (EntityArrow) iterator
+ .next();
if (arrow.shootingEntity == null
- || !(arrow.shootingEntity.equals(player)))
+ || !(arrow.shootingEntity
+ .equals(player)))
// Negative earrings
- if (rand.nextInt(30) == 0) {
- arrow.worldObj.createExplosion(new EntityTNTPrimed(arrow.worldObj), arrow.posX, arrow.posY, arrow.posZ, 2F, true);
- arrow.setDead();
+ if (rand.nextInt(
+ 30) == 0) {
+ arrow.worldObj.createExplosion(
+ new EntityTNTPrimed(
+ arrow.worldObj),
+ arrow.posX,
+ arrow.posY,
+ arrow.posZ,
+ 2F,
+ true);
+ arrow.setDead();
}
// Positive earrings
else
- arrow.setPosition(arrow.posX + rand.nextInt(16) - rand.nextInt(16), arrow.posY + rand.nextInt(16), arrow.posZ + rand.nextInt(16) - rand.nextInt(16));
+ arrow.setPosition(
+ arrow.posX + rand
+ .nextInt(16)
+ - rand.nextInt(16),
+ arrow.posY + rand
+ .nextInt(16),
+ arrow.posZ + rand
+ .nextInt(16)
+ - rand.nextInt(16));
}
}
}
// Negative Necklace
if (jewelry instanceof ItemNecklace)
- player.addPotionEffect(
- new PotionEffect(Potion.resistance.id, 60, -10, true));
+ player.addPotionEffect(new PotionEffect(
+ Potion.resistance.id, 60, -10,
+ true));
// Negative bracelet
if (jewelry instanceof ItemBracelet && player.isInWater())
player.setPositionAndUpdate(
- player.posX + rand.nextInt(16) - rand.nextInt(16),
+ player.posX + rand.nextInt(16)
+ - rand.nextInt(16),
player.posY + rand.nextInt(4),
- player.posZ + rand.nextInt(16) - rand.nextInt(16));
+ player.posZ + rand.nextInt(16)
+ - rand.nextInt(16));
}
@Override
public void onPlayerAttacked(ItemStack item, EntityPlayer player,
DamageSource source, Item jewelry, float amount) {
// Positive Necklace
- if (jewelry instanceof ItemNecklace && source.getEntity() != null)
- source.getEntity().attackEntityFrom(source, amount);
+ if (jewelry instanceof ItemNecklace
+ && source.getEntity() != null)
+ source.getEntity().attackEntityFrom(source,
+ amount);
// Positive bracelet
- if (jewelry instanceof ItemBracelet && !player.worldObj.isRemote) {
+ if (jewelry instanceof ItemBracelet
+ && !player.worldObj.isRemote) {
int id = player.worldObj.provider.dimensionId;
if (player.getHealth() <= 6F)
if (player.getBedLocation(id) != null)
- player.setPositionAndUpdate(
- player.getBedLocation(id).posX,
- player.getBedLocation(id).posY,
- player.getBedLocation(id).posZ);
+ player.setPositionAndUpdate(player
+ .getBedLocation(id).posX,
+ player.getBedLocation(
+ id).posY,
+ player.getBedLocation(
+ id).posZ);
else
player.setPositionAndUpdate(
player.worldObj.getSpawnPoint().posX,
@@ -92,14 +121,19 @@ public class EffectEnderPearl extends ModifierEffects { if (jewelry instanceof ItemRing) {
// Negative ring
if (target instanceof EntityEnderman)
- player.addPotionEffect(new PotionEffect(Potion.weakness.id,
- 400, 2, true));
+ player.addPotionEffect(new PotionEffect(
+ Potion.weakness.id, 400, 2,
+ true));
// Positive ring
else
- target.setPosition(
- target.posX + rand.nextInt(16) - rand.nextInt(16),
- target.posY + rand.nextInt(4),
- target.posZ + rand.nextInt(16) - rand.nextInt(16));
+ target.setPosition(target.posX
+ + rand.nextInt(16)
+ - rand.nextInt(16),
+ target.posY + rand.nextInt(
+ 4),
+ target.posZ + rand.nextInt(
+ 16)
+ - rand.nextInt(16));
}
}
diff --git a/src/main/java/darkknight/jewelrycraft/effects/EffectFeather.java b/src/main/java/darkknight/jewelrycraft/effects/EffectFeather.java index a7f2c8e..5235b7d 100755 --- a/src/main/java/darkknight/jewelrycraft/effects/EffectFeather.java +++ b/src/main/java/darkknight/jewelrycraft/effects/EffectFeather.java @@ -34,23 +34,29 @@ public class EffectFeather extends ModifierEffects { }
@Override
- public void action(ItemStack item, EntityPlayer player, Item jewelry) {
+ public void action(ItemStack item, EntityPlayer player,
+ Item jewelry) {
// Positive earrings
if (jewelry instanceof ItemEarrings) {
- AxisAlignedBB axisalignedbb =
- player.boundingBox.expand(1.0D, 1.0D, 1.0D);
- List<?> list = player.worldObj.getEntitiesWithinAABB(
- EntityArrow.class, axisalignedbb);
+ AxisAlignedBB axisalignedbb = player.boundingBox
+ .expand(1.0D, 1.0D, 1.0D);
+ List<?> list = player.worldObj
+ .getEntitiesWithinAABB(
+ EntityArrow.class,
+ axisalignedbb);
if (!player.worldObj.isRemote && list != null
&& !list.isEmpty()) {
Iterator<?> iterator = list.iterator();
while (iterator.hasNext()) {
- EntityArrow arrow = (EntityArrow) iterator.next();
+ EntityArrow arrow = (EntityArrow) iterator
+ .next();
if ((arrow.shootingEntity == null
- || !(arrow.shootingEntity.equals(player))
+ || !(arrow.shootingEntity
+ .equals(player))
|| arrow.canBePickedUp == 0)
- && rand.nextInt(2 + JewelryNBT
- .numberOfModifiers(item)) == 0)
+ && rand.nextInt(2
+ + JewelryNBT.numberOfModifiers(
+ item)) == 0)
arrow.setDead();
}
}
@@ -58,19 +64,24 @@ public class EffectFeather extends ModifierEffects { if (jewelry instanceof ItemBracelet) {
// Positive bracelet
if (player.motionY < 0)
- player.motionY *=
- (0.6D + (JewelryNBT.numberOfModifiers(item) - 1)
- * 0.03D);
- if (rand.nextInt(JewelryNBT.numberOfModifiers(item)) == 0)
+ player.motionY *= (0.6D + (JewelryNBT
+ .numberOfModifiers(item)
+ - 1) * 0.03D);
+ if (rand.nextInt(JewelryNBT
+ .numberOfModifiers(item)) == 0)
player.fallDistance = 0F;
// Negative bracelet
if (!player.isPotionActive(Potion.moveSlowdown)
- || player.getActivePotionEffect(Potion.moveSlowdown)
+ || player.getActivePotionEffect(
+ Potion.moveSlowdown)
.getDuration() < 30)
player.addPotionEffect(new PotionEffect(
Potion.moveSlowdown.id,
- 80 + JewelryNBT.numberOfModifiers(item) * 10,
- 1 + JewelryNBT.numberOfModifiers(item) / 4));
+ 80 + JewelryNBT.numberOfModifiers(
+ item) * 10,
+ 1 + JewelryNBT.numberOfModifiers(
+ item)
+ / 4));
}
}
@@ -79,24 +90,33 @@ public class EffectFeather extends ModifierEffects { EntityPlayer player, Entity target, Item jewelry,
float amount) {
NBTTagCompound enemyData = target.getEntityData();
- if (jewelry instanceof ItemRing && !player.worldObj.isRemote) {
+ if (jewelry instanceof ItemRing
+ && !player.worldObj.isRemote) {
if (enemyData.getInteger("reAttacked") == 0) {
// Negative ring
enemyData.setInteger("reAttacked",
- enemyData.getInteger("reAttacked") + 1);
- target.attackEntityFrom(
- DamageSource.causePlayerDamage(player),
- amount / (2F
- + (JewelryNBT.numberOfModifiers(item) - 1)
- * 0.3F));
+ enemyData.getInteger(
+ "reAttacked")
+ + 1);
+ target.attackEntityFrom(DamageSource
+ .causePlayerDamage(player),
+ amount / (2F + (JewelryNBT
+ .numberOfModifiers(
+ item)
+ - 1)
+ * 0.3F));
// Positive ring
if (rand.nextInt(2) == 0
&& target instanceof EntityLivingBase)
- ((EntityLivingBase) target).addPotionEffect(
- new PotionEffect(PotionList.stun.id,
- (51 - JewelryNBT
- .numberOfModifiers(item)) * 2,
- 0, false));
+ ((EntityLivingBase) target)
+ .addPotionEffect(
+ new PotionEffect(
+ PotionList.stun.id,
+ (51 - JewelryNBT.numberOfModifiers(
+ item))
+ * 2,
+ 0,
+ false));
return true;
}
enemyData.setInteger("reAttacked", 0);
@@ -106,21 +126,21 @@ public class EffectFeather extends ModifierEffects { @Override
public boolean onPlayerAttackedCancellable(ItemStack item,
- EntityPlayer player, DamageSource source, Item jewelry,
- float amount) {
+ EntityPlayer player, DamageSource source,
+ Item jewelry, float amount) {
// Positive necklace
- if (jewelry instanceof ItemNecklace
- && rand.nextInt(
- 3 + JewelryNBT.numberOfModifiers(item)) == 0
+ if (jewelry instanceof ItemNecklace && rand.nextInt(3
+ + JewelryNBT.numberOfModifiers(item)) == 0
&& source != DamageSourceList.weak
&& source != DamageSource.inFire
&& source != DamageSource.onFire
&& source != DamageSource.lava) {
player.addChatComponentMessage(
- new ChatComponentText(EnumChatFormatting.GRAY
- + StatCollector.translateToLocal(
- "chatmessage." + Variables.MODID
- + ".effect.feather")));
+ new ChatComponentText(
+ EnumChatFormatting.GRAY
+ + StatCollector.translateToLocal(
+ "chatmessage." + Variables.MODID
+ + ".effect.feather")));
return true;
}
// Negative necklace
@@ -129,13 +149,19 @@ public class EffectFeather extends ModifierEffects { || source == DamageSource.onFire
|| source == DamageSource.lava)
&& source != DamageSourceList.weak)
- player.attackEntityFrom(DamageSourceList.weak, amount * (3F
- + (JewelryNBT.numberOfModifiers(item) - 1) * 0.1F));
+ player.attackEntityFrom(DamageSourceList.weak,
+ amount * (3F + (JewelryNBT
+ .numberOfModifiers(
+ item)
+ - 1) * 0.1F));
// Negative earrings
if (jewelry instanceof ItemEarrings
&& source.damageType.equals("arrow"))
- player.attackEntityFrom(DamageSourceList.weak, amount * (2F
- + (JewelryNBT.numberOfModifiers(item) - 1) * 0.1F));
+ player.attackEntityFrom(DamageSourceList.weak,
+ amount * (2F + (JewelryNBT
+ .numberOfModifiers(
+ item)
+ - 1) * 0.1F));
return false;
}
}
diff --git a/src/main/java/darkknight/jewelrycraft/effects/EffectObsidian.java b/src/main/java/darkknight/jewelrycraft/effects/EffectObsidian.java index be1d233..3b79390 100755 --- a/src/main/java/darkknight/jewelrycraft/effects/EffectObsidian.java +++ b/src/main/java/darkknight/jewelrycraft/effects/EffectObsidian.java @@ -25,53 +25,68 @@ public class EffectObsidian extends ModifierEffects { }
@Override
- public void action(ItemStack item, EntityPlayer player, Item jewelry) {
+ public void action(ItemStack item, EntityPlayer player,
+ Item jewelry) {
NBTTagCompound playerInfo = PlayerUtils
- .getModPlayerPersistTag(player, Variables.MODID);
+ .getModPlayerPersistTag(player,
+ Variables.MODID);
if (jewelry instanceof ItemNecklace) {
// Positive necklace
- player.addPotionEffect(
- new PotionEffect(Potion.resistance.id, 60, 2, true));
+ player.addPotionEffect(new PotionEffect(
+ Potion.resistance.id, 60, 2,
+ true));
// Negative necklace
if (player.isInWater()
&& !player.capabilities.isCreativeMode) {
- double slowAmount = 0.2D
- + (JewelryNBT.numberOfModifiers(item) - 1) * 0.05D;
+ double slowAmount = 0.2D + (JewelryNBT
+ .numberOfModifiers(item)
+ - 1) * 0.05D;
player.motionX *= slowAmount;
player.motionY *= slowAmount;
player.motionZ *= slowAmount;
player.motionY = -0.5D;
if (rand.nextInt(50) == 0)
- player.attackEntityFrom(DamageSourceList.weak, 2F);
+ player.attackEntityFrom(
+ DamageSourceList.weak,
+ 2F);
}
}
// Negative bracelet
- if (jewelry instanceof ItemBracelet && playerInfo.hasKey("falls")
+ if (jewelry instanceof ItemBracelet
+ && playerInfo.hasKey("falls")
&& playerInfo.getInteger("falls") >= 300)
- player.addPotionEffect(
- new PotionEffect(Potion.moveSlowdown.id, 60, 1, true));
+ player.addPotionEffect(new PotionEffect(
+ Potion.moveSlowdown.id, 60, 1,
+ true));
// Negative ring
- if (jewelry instanceof ItemRing && playerInfo.hasKey("strikes")
- && playerInfo.getInteger("strikes") >= 200) {
- player.addPotionEffect(
- new PotionEffect(Potion.weakness.id, 60, 0, true));
- player.addPotionEffect(
- new PotionEffect(Potion.digSlowdown.id, 60, 1, true));
+ if (jewelry instanceof ItemRing
+ && playerInfo.hasKey("strikes")
+ && playerInfo.getInteger(
+ "strikes") >= 200) {
+ player.addPotionEffect(new PotionEffect(
+ Potion.weakness.id, 60, 0, true));
+ player.addPotionEffect(new PotionEffect(
+ Potion.digSlowdown.id, 60, 1,
+ true));
}
}
@Override
public boolean onPlayerAttackedCancellable(ItemStack item,
- EntityPlayer player, DamageSource source, Item jewelry,
- float amount) {
+ EntityPlayer player, DamageSource source,
+ Item jewelry, float amount) {
NBTTagCompound playerInfo = PlayerUtils
- .getModPlayerPersistTag(player, Variables.MODID);
+ .getModPlayerPersistTag(player,
+ Variables.MODID);
if (jewelry instanceof ItemEarrings
&& (source == DamageSource.anvil
- || source.damageType.equals("arrow"))) {
+ || source.damageType
+ .equals("arrow"))) {
if (playerInfo.hasKey("protected")) {
playerInfo.setInteger("protected",
- playerInfo.getInteger("protected") + 1);
+ playerInfo.getInteger(
+ "protected")
+ + 1);
} else {
playerInfo.setInteger("protected", 1);
}
@@ -86,7 +101,9 @@ public class EffectObsidian extends ModifierEffects { && source == DamageSource.fall) {
if (playerInfo.hasKey("falls")) {
playerInfo.setInteger("falls",
- playerInfo.getInteger("falls") + 1);
+ playerInfo.getInteger(
+ "falls")
+ + 1);
} else {
playerInfo.setInteger("falls", 1);
}
@@ -101,7 +118,8 @@ public class EffectObsidian extends ModifierEffects { public void onPlayerDead(ItemStack item, EntityPlayer player,
DamageSource source, Item jewelry) {
NBTTagCompound playerInfo = PlayerUtils
- .getModPlayerPersistTag(player, Variables.MODID);
+ .getModPlayerPersistTag(player,
+ Variables.MODID);
playerInfo.setInteger("falls", 0);
playerInfo.setInteger("strikes", 0);
playerInfo.setInteger("protected", 0);
@@ -112,7 +130,8 @@ public class EffectObsidian extends ModifierEffects { EntityPlayer player, Entity target, Item jewelry,
float amount) {
NBTTagCompound playerInfo = PlayerUtils
- .getModPlayerPersistTag(player, Variables.MODID);
+ .getModPlayerPersistTag(player,
+ Variables.MODID);
NBTTagCompound enemyData = target.getEntityData();
// Positive ring
if (jewelry instanceof ItemRing
@@ -121,14 +140,19 @@ public class EffectObsidian extends ModifierEffects { if (enemyData.getInteger("reAttacked") == 0) {
if (playerInfo.hasKey("strikes"))
playerInfo.setInteger("strikes",
- playerInfo.getInteger("strikes") + 1);
+ playerInfo.getInteger(
+ "strikes")
+ + 1);
else
- playerInfo.setInteger("strikes", 1);
+ playerInfo.setInteger("strikes",
+ 1);
// Negative ring
enemyData.setInteger("reAttacked",
- enemyData.getInteger("reAttacked") + 1);
- target.attackEntityFrom(
- DamageSource.causePlayerDamage(player),
+ enemyData.getInteger(
+ "reAttacked")
+ + 1);
+ target.attackEntityFrom(DamageSource
+ .causePlayerDamage(player),
amount * 1.5F);
return true;
}
diff --git a/src/main/java/darkknight/jewelrycraft/entities/EntityHeart.java b/src/main/java/darkknight/jewelrycraft/entities/EntityHeart.java index cbfc21a..2590e55 100755 --- a/src/main/java/darkknight/jewelrycraft/entities/EntityHeart.java +++ b/src/main/java/darkknight/jewelrycraft/entities/EntityHeart.java @@ -57,10 +57,12 @@ public class EntityHeart extends EntityLiving { @Override
protected void collideWithEntity(Entity entity) {
super.collideWithEntity(entity);
- if (!this.worldObj.isRemote && entity instanceof EntityHeart
- && getType().equals(((EntityHeart) entity).getType())) {
- setQuantity(
- getQuantity() + ((EntityHeart) entity).getQuantity());
+ if (!this.worldObj.isRemote
+ && entity instanceof EntityHeart
+ && getType().equals(((EntityHeart) entity)
+ .getType())) {
+ setQuantity(getQuantity() + ((EntityHeart) entity)
+ .getQuantity());
entity.setDead();
}
}
@@ -69,49 +71,68 @@ public class EntityHeart extends EntityLiving { public void onCollideWithPlayer(EntityPlayer player) {
if (!this.worldObj.isRemote) {
NBTTagCompound playerInfo = PlayerUtils
- .getModPlayerPersistTag(player, Variables.MODID);
+ .getModPlayerPersistTag(player,
+ Variables.MODID);
if (playerInfo != null) {
- if (getType().equals("Red")
- && player.getHealth() < player.getMaxHealth()) {
- float healAmount =
- player.getMaxHealth() - player.getHealth();
+ if (getType().equals("Red") && player
+ .getHealth() < player
+ .getMaxHealth()) {
+ float healAmount = player
+ .getMaxHealth()
+ - player.getHealth();
if (getQuantity() > healAmount) {
player.heal(healAmount);
- this.setQuantity(getQuantity() - healAmount);
+ this.setQuantity(
+ getQuantity() - healAmount);
} else {
player.heal(getQuantity());
this.setDead();
}
} else if (getType().equals("White")
- && playerInfo.getFloat("WhiteHeart") > 0.1F) {
- playerInfo.setFloat(getType() + "Heart", 0F);
+ && playerInfo.getFloat(
+ "WhiteHeart") > 0.1F) {
+ playerInfo.setFloat(getType()
+ + "Heart", 0F);
if (player.getMaxHealth() < 40F) {
player.getEntityAttribute(
SharedMonsterAttributes.maxHealth)
- .setBaseValue(player.getMaxHealth() + 2f);
- player.setHealth(player.getHealth() + 2f);
+ .setBaseValue(player
+ .getMaxHealth()
+ + 2f);
+ player.setHealth(player
+ .getHealth()
+ + 2f);
}
JewelrycraftMod.netWrapper.sendTo(
- new PacketSendClientPlayerInfo(playerInfo),
+ new PacketSendClientPlayerInfo(
+ playerInfo),
(EntityPlayerMP) player);
this.setDead();
} else if (!getType().equals("Red")
- && ((getType().equals("Black")
+ && ((getType().equals(
+ "Black")
&& playerInfo.getFloat(
"BlackHeart") <= ConfigHandler.MAX_BLACK_HEARTS_PICKUP)
- || (getType().equals("Blue")
+ || (getType().equals(
+ "Blue")
&& playerInfo.getFloat(
"BlueHeart") <= ConfigHandler.MAX_BLUE_HEARTS_PICKUP)
- || getType().equals("White"))) {
- if (playerInfo.hasKey(getType() + "Heart"))
- playerInfo.setFloat(getType() + "Heart",
- playerInfo.getFloat(getType() + "Heart")
+ || getType().equals(
+ "White"))) {
+ if (playerInfo.hasKey(getType()
+ + "Heart"))
+ playerInfo.setFloat(
+ getType() + "Heart",
+ playerInfo.getFloat(
+ getType() + "Heart")
+ getQuantity());
else
- playerInfo.setFloat(getType() + "Heart",
+ playerInfo.setFloat(
+ getType() + "Heart",
getQuantity());
JewelrycraftMod.netWrapper.sendTo(
- new PacketSendClientPlayerInfo(playerInfo),
+ new PacketSendClientPlayerInfo(
+ playerInfo),
(EntityPlayerMP) player);
this.setDead();
}
@@ -122,12 +143,14 @@ public class EntityHeart extends EntityLiving { @Override
public void onDeath(DamageSource source) {
super.onDeath(source);
- if (source.getEntity() != null
- && source.getEntity() instanceof EntityPlayer)
+ if (source.getEntity() != null && source
+ .getEntity() instanceof EntityPlayer)
((EntityPlayer) source.getEntity()).addChatMessage(
- new ChatComponentText(StatCollector.translateToLocal(
- "chatmessage." + Variables.MODID
- + ".heartKilled." + this.getType())));
+ new ChatComponentText(StatCollector
+ .translateToLocal(
+ "chatmessage." + Variables.MODID
+ + ".heartKilled."
+ + this.getType())));
}
@Override
@@ -151,8 +174,8 @@ public class EntityHeart extends EntityLiving { }
/**
- * (abstract) Protected helper method to read subclass entity data from
- * NBT.
+ * (abstract) Protected helper method to read subclass entity data
+ * from NBT.
*/
@Override
public void readEntityFromNBT(NBTTagCompound nbt) {
diff --git a/src/main/java/darkknight/jewelrycraft/entities/EntityList.java b/src/main/java/darkknight/jewelrycraft/entities/EntityList.java index 8a23598..6df9ada 100755 --- a/src/main/java/darkknight/jewelrycraft/entities/EntityList.java +++ b/src/main/java/darkknight/jewelrycraft/entities/EntityList.java @@ -9,22 +9,23 @@ import net.minecraft.entity.EntityLiving; public class EntityList {
public static void preInit(FMLPreInitializationEvent e) {
- registerEntity(1, EntityHeart.class, "Heart", 0x000000, 0xFF0000); // Red
- ItemSpawnEgg.registerSpawnEgg(EntityHeart.class, "Heart", 2,
- 0x000000, 0xFFFFFF); // White
- ItemSpawnEgg.registerSpawnEgg(EntityHeart.class, "Heart", 3,
- 0x000000, 0x006BBD); // Blue
- ItemSpawnEgg.registerSpawnEgg(EntityHeart.class, "Heart", 4,
- 0x000000, 0x404040); // Black
-
- registerEntity(5, EntityHalfHeart.class, "HalfHeart", 0x000000,
+ registerEntity(1, EntityHeart.class, "Heart", 0x000000,
0xFF0000); // Red
- ItemSpawnEgg.registerSpawnEgg(EntityHalfHeart.class, "HalfHeart",
- 6, 0x000000, 0xFFFFFF); // White
- ItemSpawnEgg.registerSpawnEgg(EntityHalfHeart.class, "HalfHeart",
- 7, 0x000000, 0x006BBD); // Blue
- ItemSpawnEgg.registerSpawnEgg(EntityHalfHeart.class, "HalfHeart",
- 8, 0x000000, 0x404040); // Black
+ ItemSpawnEgg.registerSpawnEgg(EntityHeart.class, "Heart",
+ 2, 0x000000, 0xFFFFFF); // White
+ ItemSpawnEgg.registerSpawnEgg(EntityHeart.class, "Heart",
+ 3, 0x000000, 0x006BBD); // Blue
+ ItemSpawnEgg.registerSpawnEgg(EntityHeart.class, "Heart",
+ 4, 0x000000, 0x404040); // Black
+
+ registerEntity(5, EntityHalfHeart.class, "HalfHeart",
+ 0x000000, 0xFF0000); // Red
+ ItemSpawnEgg.registerSpawnEgg(EntityHalfHeart.class,
+ "HalfHeart", 6, 0x000000, 0xFFFFFF); // White
+ ItemSpawnEgg.registerSpawnEgg(EntityHalfHeart.class,
+ "HalfHeart", 7, 0x000000, 0x006BBD); // Blue
+ ItemSpawnEgg.registerSpawnEgg(EntityHalfHeart.class,
+ "HalfHeart", 8, 0x000000, 0x404040); // Black
}
@@ -35,8 +36,9 @@ public class EntityList { }
private static final void registerEntity(int id,
- Class<? extends EntityLiving> entityClass, String name,
- int eggBackgroundColor, int eggForegroundColor) {
+ Class<? extends EntityLiving> entityClass,
+ String name, int eggBackgroundColor,
+ int eggForegroundColor) {
registerEntity(id, entityClass, name);
ItemSpawnEgg.registerSpawnEgg(entityClass, name, id,
eggBackgroundColor, eggForegroundColor);
diff --git a/src/main/java/darkknight/jewelrycraft/entities/renders/HeartRender.java b/src/main/java/darkknight/jewelrycraft/entities/renders/HeartRender.java index 41f7a85..b5419a4 100755 --- a/src/main/java/darkknight/jewelrycraft/entities/renders/HeartRender.java +++ b/src/main/java/darkknight/jewelrycraft/entities/renders/HeartRender.java @@ -17,45 +17,53 @@ import net.minecraft.util.ResourceLocation; */
public class HeartRender extends RenderLiving {
protected ResourceLocation texture;
- Random rnd = new Random();
+ Random rnd = new Random();
public HeartRender(ModelBase modelBase, float shadowSize) {
super(modelBase, shadowSize);
}
@Override
- protected void renderModel(EntityLivingBase entity, float x, float y,
- float z, float rot1, float rot2, float rot3) {
+ protected void renderModel(EntityLivingBase entity, float x,
+ float y, float z, float rot1, float rot2,
+ float rot3) {
super.renderModel(entity, x, y, z, rot1, rot2, rot3);
rnd.setSeed(1542372345);
if (((EntityHeart) entity).getQuantity() > 2f) {
- for (int i = 0; i < ((EntityHeart) entity).getQuantity() / 10f;
- i++) {
+ for (int i = 0; i < ((EntityHeart) entity)
+ .getQuantity() / 10f; i++) {
float posX = rnd.nextFloat() * 0.2f
- * (rnd.nextBoolean() ? 1 : -1);
+ * (rnd.nextBoolean() ? 1
+ : -1);
float posY = rnd.nextFloat() * 0.2f
- * (rnd.nextBoolean() ? 1 : -1);
+ * (rnd.nextBoolean() ? 1
+ : -1);
float rotY = rnd.nextFloat() * 35f
- * (rnd.nextBoolean() ? 1 : -1);
+ * (rnd.nextBoolean() ? 1
+ : -1);
float rotZ = rnd.nextFloat() * 35f
- * (rnd.nextBoolean() ? 1 : -1);
+ * (rnd.nextBoolean() ? 1
+ : -1);
GL11.glTranslatef(-0.15F, 0.0F, 0.0F);
GL11.glTranslatef(posX, posY, 0F);
GL11.glRotatef(rotY, 0F, 1F, 0F);
GL11.glRotatef(rotZ, 0F, 0F, 1F);
GL11.glPushMatrix();
- this.mainModel.render(entity, x, y, z, rot1, rot2, rot3);
+ this.mainModel.render(entity, x, y, z,
+ rot1, rot2, rot3);
GL11.glPopMatrix();
}
}
}
@Override
- protected void preRenderCallback(EntityLivingBase entity, float f) {
+ protected void preRenderCallback(EntityLivingBase entity,
+ float f) {
preRenderCallbackHeart((EntityHeart) entity, f);
}
- protected void preRenderCallbackHeart(EntityHeart entity, float f) {
+ protected void preRenderCallbackHeart(EntityHeart entity,
+ float f) {
GL11.glScalef(0.4F, 0.4F, 0.4F);
GL11.glRotatef(55F, 1F, 0F, 0F);
String type = entity.getType();
diff --git a/src/main/java/darkknight/jewelrycraft/entities/renders/RenderHelper.java b/src/main/java/darkknight/jewelrycraft/entities/renders/RenderHelper.java index 8080251..cf2278a 100755 --- a/src/main/java/darkknight/jewelrycraft/entities/renders/RenderHelper.java +++ b/src/main/java/darkknight/jewelrycraft/entities/renders/RenderHelper.java @@ -16,10 +16,9 @@ public class RenderHelper { }
public static void translateToHeadLevel(EntityPlayer player) {
- GL11.glTranslated(0,
- (player != Minecraft.getMinecraft().thePlayer ? 1.62F : 0F)
- - player.getDefaultEyeHeight()
- + (player.isSneaking() ? 0.0625 : 0),
- 0);
+ GL11.glTranslated(0, (player != Minecraft
+ .getMinecraft().thePlayer ? 1.62F : 0F)
+ - player.getDefaultEyeHeight()
+ + (player.isSneaking() ? 0.0625 : 0), 0);
}
}
\ No newline at end of file diff --git a/src/main/java/darkknight/jewelrycraft/events/BlockEventHandler.java b/src/main/java/darkknight/jewelrycraft/events/BlockEventHandler.java index fc4cacc..964ebd2 100755 --- a/src/main/java/darkknight/jewelrycraft/events/BlockEventHandler.java +++ b/src/main/java/darkknight/jewelrycraft/events/BlockEventHandler.java @@ -24,27 +24,40 @@ public class BlockEventHandler { @SubscribeEvent
public void onBlockDestroyed(BlockEvent.BreakEvent event) {
if (event.getPlayer() != null) {
- ItemStack item = event.getPlayer().inventory.getCurrentItem();
- if (event.block instanceof BlockMidasTouch && item != null
- && item.getItem().getHarvestLevel(item,
- "pickaxe") >= event.block.getHarvestLevel(
- event.blockMetadata)) {
- TileEntityMidasTouch te =
- (TileEntityMidasTouch) event.world
- .getTileEntity(event.x, event.y, event.z);
+ ItemStack item = event.getPlayer().inventory
+ .getCurrentItem();
+ if (event.block instanceof BlockMidasTouch
+ && item != null
+ && item.getItem().getHarvestLevel(
+ item,
+ "pickaxe") >= event.block
+ .getHarvestLevel(
+ event.blockMetadata)) {
+ TileEntityMidasTouch te = (TileEntityMidasTouch) event.world
+ .getTileEntity(event.x,
+ event.y,
+ event.z);
if (te.target != null)
- dropItem(te.getWorldObj(), te.xCoord, te.yCoord,
+ dropItem(te.getWorldObj(),
+ te.xCoord,
+ te.yCoord,
te.zCoord,
new ItemStack(Items.gold_nugget,
(int) (te.target.width
- * te.target.height * 100),
+ * te.target.height
+ * 100),
0));
}
- NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(
- event.getPlayer(), Variables.MODID);
+ NBTTagCompound playerInfo = PlayerUtils
+ .getModPlayerPersistTag(
+ event.getPlayer(),
+ Variables.MODID);
for (Curse curse : Curse.getCurseList())
- if (playerInfo.getInteger(curse.getName()) > 0)
- curse.onBlockDestroyed(event.getPlayer(), event);
+ if (playerInfo.getInteger(
+ curse.getName()) > 0)
+ curse.onBlockDestroyed(
+ event.getPlayer(),
+ event);
}
}
@@ -53,17 +66,20 @@ public class BlockEventHandler { EntityPlayer player = event.harvester;
if (player != null) {
NBTTagCompound playerInfo = PlayerUtils
- .getModPlayerPersistTag(player, Variables.MODID);
+ .getModPlayerPersistTag(player,
+ Variables.MODID);
for (Curse curse : Curse.getCurseList())
- if (playerInfo.getInteger(curse.getName()) > 0)
- curse.onBlockItemsDrop(player, event);
+ if (playerInfo.getInteger(
+ curse.getName()) > 0)
+ curse.onBlockItemsDrop(player,
+ event);
}
}
public void dropItem(World world, double x, double y, double z,
ItemStack stack) {
- EntityItem entityitem =
- new EntityItem(world, x + 0.5D, y + 0.5D, z + 0.5D, stack);
+ EntityItem entityitem = new EntityItem(world, x + 0.5D,
+ y + 0.5D, z + 0.5D, stack);
entityitem.motionX = 0;
entityitem.motionZ = 0;
entityitem.motionY = 0.11000000298023224D;
diff --git a/src/main/java/darkknight/jewelrycraft/events/BucketHandler.java b/src/main/java/darkknight/jewelrycraft/events/BucketHandler.java index 1b79a0b..13948af 100755 --- a/src/main/java/darkknight/jewelrycraft/events/BucketHandler.java +++ b/src/main/java/darkknight/jewelrycraft/events/BucketHandler.java @@ -31,7 +31,8 @@ public class BucketHandler { @SubscribeEvent
public void onBucketFill(FillBucketEvent event) {
- ItemStack result = fillCustomBucket(event.world, event.target);
+ ItemStack result = fillCustomBucket(event.world,
+ event.target);
if (result == null)
return;
event.result = result;
@@ -40,7 +41,8 @@ public class BucketHandler { private ItemStack fillCustomBucket(World world,
MovingObjectPosition pos) {
- Block block = world.getBlock(pos.blockX, pos.blockY, pos.blockZ);
+ Block block = world.getBlock(pos.blockX, pos.blockY,
+ pos.blockZ);
Item bucket = buckets.get(block);
if (bucket != null
&& world.getBlock(pos.blockX, pos.blockY,
@@ -48,14 +50,17 @@ public class BucketHandler { && world.getBlock(pos.blockX, pos.blockY,
pos.blockZ) instanceof BlockMoltenMetal) {
ItemStack item = new ItemStack(bucket);
- if (BlockMoltenMetal.getTileEntity(world, pos.blockX,
- pos.blockY, pos.blockZ) != null)
- JewelryNBT.addMetal(item,
- BlockMoltenMetal
- .getTileEntity(world, pos.blockX,
- pos.blockY, pos.blockZ)
- .getMetal());
- world.setBlockToAir(pos.blockX, pos.blockY, pos.blockZ);
+ if (BlockMoltenMetal.getTileEntity(world,
+ pos.blockX, pos.blockY,
+ pos.blockZ) != null)
+ JewelryNBT.addMetal(item, BlockMoltenMetal
+ .getTileEntity(world,
+ pos.blockX,
+ pos.blockY,
+ pos.blockZ)
+ .getMetal());
+ world.setBlockToAir(pos.blockX, pos.blockY,
+ pos.blockZ);
return item;
} else
return null;
diff --git a/src/main/java/darkknight/jewelrycraft/events/EntityEventHandler.java b/src/main/java/darkknight/jewelrycraft/events/EntityEventHandler.java index 6806f65..e9809d0 100755 --- a/src/main/java/darkknight/jewelrycraft/events/EntityEventHandler.java +++ b/src/main/java/darkknight/jewelrycraft/events/EntityEventHandler.java @@ -51,64 +51,83 @@ import net.minecraftforge.event.entity.player.PlayerEvent; import net.minecraftforge.event.entity.player.PlayerSleepInBedEvent;
public class EntityEventHandler {
- int updateTime = 0,
- totalUnavailableCurses = 0, luck = 0;
+ int updateTime = 0, totalUnavailableCurses = 0, luck = 0;
- boolean addedCurses = false;
+ boolean addedCurses = false;
- public static Random rand = new Random();
+ public static Random rand = new Random();
- public static ArrayList<String> types = new ArrayList<String>();
+ public static ArrayList<String> types = new ArrayList<String>();
@SubscribeEvent
public void onEntityJoinWorld(EntityJoinWorldEvent event) {
if (event.entity instanceof EntityPlayer
&& !(event.entity instanceof EntityPlayerMP)) {
- JewelrycraftMod.netWrapper
- .sendToServer(new PacketRequestPlayerInfo());
+ JewelrycraftMod.netWrapper.sendToServer(
+ new PacketRequestPlayerInfo());
}
final Entity entity = event.entity;
- if (!event.world.isRemote && entity instanceof EntityPlayer) {
+ if (!event.world.isRemote
+ && entity instanceof EntityPlayer) {
EntityPlayer player = (EntityPlayer) entity;
NBTTagCompound persistTag = PlayerUtils
- .getModPlayerPersistTag(player, Variables.MODID);
+ .getModPlayerPersistTag(player,
+ Variables.MODID);
boolean shouldGiveManual = ItemList.guide != null
- && !persistTag.getBoolean("givenGuide");
+ && !persistTag.getBoolean(
+ "givenGuide");
if (shouldGiveManual) {
- ItemStack manual = new ItemStack(ItemList.guide);
-
- if (!player.inventory.addItemStackToInventory(manual)) {
- BlockUtils.dropItemStackInWorld(player.worldObj,
- player.posX, player.posY, player.posZ, manual);
+ ItemStack manual = new ItemStack(
+ ItemList.guide);
+
+ if (!player.inventory
+ .addItemStackToInventory(
+ manual)) {
+ BlockUtils.dropItemStackInWorld(
+ player.worldObj,
+ player.posX,
+ player.posY,
+ player.posZ,
+ manual);
}
persistTag.setBoolean("givenGuide", true);
}
- boolean render = persistTag.getBoolean("fancyRender");
+ boolean render = persistTag
+ .getBoolean("fancyRender");
JewelrycraftMod.fancyRender = render;
if (ConfigHandler.CURSES_ENABLED) {
for (Curse curse : Curse.getCurseList()) {
- if (curse.canCurseBeActivated(event.world)
- && !persistTag.hasKey(curse.getName())) {
- persistTag.setInteger(curse.getName(), 0);
+ if (curse.canCurseBeActivated(
+ event.world)
+ && !persistTag.hasKey(
+ curse.getName())) {
+ persistTag.setInteger(curse
+ .getName(),
+ 0);
}
}
}
for (Curse curse : Curse.getCurseList()) {
- if (!curse.canCurseBeActivated(event.world)) {
- Curse.availableCurses.remove(curse);
- persistTag.setInteger(curse.getName(), 0);
+ if (!curse.canCurseBeActivated(
+ event.world)) {
+ Curse.availableCurses
+ .remove(curse);
+ persistTag.setInteger(
+ curse.getName(),
+ 0);
totalUnavailableCurses++;
- } else if (!Curse.availableCurses.contains(curse))
+ } else if (!Curse.availableCurses
+ .contains(curse))
Curse.availableCurses.add(curse);
}
@@ -151,7 +170,8 @@ public class EntityEventHandler { EntityPlayer player = (EntityPlayer) entity;
NBTTagCompound playerInfo = PlayerUtils
- .getModPlayerPersistTag(player, Variables.MODID);
+ .getModPlayerPersistTag(player,
+ Variables.MODID);
playerInfo.setBoolean("fancyRender",
JewelrycraftMod.fancyRender);
@@ -161,20 +181,25 @@ public class EntityEventHandler { }
for (int i = 0; i < 18; i++) {
- if (getJewelryItems(playerInfo, i) != null) {
+ if (getJewelryItems(playerInfo,
+ i) != null) {
if (getJewelryItems(playerInfo, i)
.getItem() instanceof ItemBaseJewelry) {
- ((ItemBaseJewelry) getJewelryItems(playerInfo, i)
- .getItem()).action(
- getJewelryItems(playerInfo, i),
+ ((ItemBaseJewelry) getJewelryItems(
+ playerInfo,
+ i).getItem()).action(
+ getJewelryItems(playerInfo,
+ i),
player);
}
if (getJewelryItems(playerInfo, i)
.getItem() instanceof IJewelryItem) {
- ((IJewelryItem) getJewelryItems(playerInfo, i)
- .getItem()).onWearAction(
- getJewelryItems(playerInfo, i),
+ ((IJewelryItem) getJewelryItems(
+ playerInfo,
+ i).getItem()).onWearAction(
+ getJewelryItems(playerInfo,
+ i),
player);
}
}
@@ -191,11 +216,14 @@ public class EntityEventHandler { }
if (ConfigHandler.CURSES_ENABLED) {
- for (Curse curse : Curse.getCurseList()) {
- if (curse.canCurseBeActivated(player.worldObj)
- && playerInfo
- .getInteger(curse.getName()) > 0) {
- curse.action(player.worldObj, player);
+ for (Curse curse : Curse
+ .getCurseList()) {
+ if (curse.canCurseBeActivated(
+ player.worldObj)
+ && playerInfo.getInteger(
+ curse.getName()) > 0) {
+ curse.action(player.worldObj,
+ player);
}
}
}
@@ -206,66 +234,84 @@ public class EntityEventHandler { public void updateCurses(NBTTagCompound playerInfo,
EntityPlayer player) {
if (playerInfo.hasKey("playerCursePointsChanged")
- && playerInfo.getBoolean("playerCursePointsChanged")) {
+ && playerInfo.getBoolean(
+ "playerCursePointsChanged")) {
int points = playerInfo.getInteger("cursePoints");
- int maxCurses = playerInfo.getInteger("cursePoints")
- / Variables.CURSE_POINTS_PER_LEVEL + 1;
-
- if (points > 0
- && playerInfo.getInteger("activeCurses") < maxCurses) {
- while (playerInfo.getInteger("activeCurses") < maxCurses
- && Curse.availableCurses.size() > 0
- && playerInfo.getInteger("activeCurses") < Curse
- .getCurseList().size()) {
+ int maxCurses = playerInfo
+ .getInteger("cursePoints")
+ / Variables.CURSE_POINTS_PER_LEVEL
+ + 1;
+
+ if (points > 0 && playerInfo.getInteger(
+ "activeCurses") < maxCurses) {
+ while (playerInfo.getInteger(
+ "activeCurses") < maxCurses
+ && Curse.availableCurses
+ .size() > 0
+ && playerInfo.getInteger(
+ "activeCurses") < Curse
+ .getCurseList()
+ .size()) {
addCurse(player, playerInfo);
}
}
if (!playerInfo.hasKey("curseTime")
- || !playerInfo.hasKey("reselectCurses")
- || playerInfo.getBoolean("reselectCurses")) {
+ || !playerInfo.hasKey(
+ "reselectCurses")
+ || playerInfo.getBoolean(
+ "reselectCurses")) {
playerInfo.setInteger("curseTime", 23000);
- playerInfo.setBoolean("reselectCurses", false);
+ playerInfo.setBoolean("reselectCurses",
+ false);
}
JewelrycraftMod.netWrapper.sendTo(
- new PacketSendClientPlayerInfo(playerInfo),
+ new PacketSendClientPlayerInfo(
+ playerInfo),
(EntityPlayerMP) player);
if (addedCurses) {
- JewelrycraftMod.netWrapper
- .sendToAll(new PacketSendServerPlayersInfo());
- player.addChatMessage(new ChatComponentText(
- StatCollector.translateToLocal("curse."
- + Variables.MODID + ".activated")));
+ JewelrycraftMod.netWrapper.sendToAll(
+ new PacketSendServerPlayersInfo());
+ player.addChatMessage(
+ new ChatComponentText(
+ StatCollector.translateToLocal(
+ "curse." + Variables.MODID
+ + ".activated")));
addedCurses = false;
}
}
if (playerInfo.getBoolean("playerCursePointsChanged")) {
- playerInfo.setBoolean("playerCursePointsChanged", false);
+ playerInfo.setBoolean("playerCursePointsChanged",
+ false);
}
luck = calculateLuck(player);
}
public void timeUntilYouCanResetCurses(NBTTagCompound playerInfo) {
- if (playerInfo.hasKey("reselectCurses")
- && !playerInfo.getBoolean("reselectCurses")) {
+ if (playerInfo.hasKey("reselectCurses") && !playerInfo
+ .getBoolean("reselectCurses")) {
playerInfo.setInteger("curseTime",
- playerInfo.getInteger("curseTime") - 10000);
+ playerInfo.getInteger("curseTime")
+ - 10000);
if (playerInfo.getInteger("curseTime") <= 0)
- playerInfo.setBoolean("reselectCurses", true);
+ playerInfo.setBoolean("reselectCurses",
+ true);
}
}
- public ItemStack getJewelryItems(NBTTagCompound playerInfo, int i) {
+ public ItemStack getJewelryItems(NBTTagCompound playerInfo,
+ int i) {
if (playerInfo.hasKey("ext" + i)) {
NBTTagCompound nbt = (NBTTagCompound) playerInfo
.getTag("ext" + i);
- ItemStack item = ItemStack.loadItemStackFromNBT(nbt);
+ ItemStack item = ItemStack
+ .loadItemStackFromNBT(nbt);
if (item != null) {
return item;
@@ -277,16 +323,22 @@ public class EntityEventHandler { @SubscribeEvent
public void onEntityLivingDropItems(LivingDropsEvent event) {
- if (event.source.getEntity() != null
- && event.source.getEntity() instanceof EntityPlayer) {
- EntityPlayer player = (EntityPlayer) event.source.getEntity();
+ if (event.source.getEntity() != null && event.source
+ .getEntity() instanceof EntityPlayer) {
+ EntityPlayer player = (EntityPlayer) event.source
+ .getEntity();
NBTTagCompound playerInfo = PlayerUtils
- .getModPlayerPersistTag(player, Variables.MODID);
+ .getModPlayerPersistTag(player,
+ Variables.MODID);
if (ConfigHandler.CURSES_ENABLED)
for (Curse curse : Curse.getCurseList())
- if (curse.canCurseBeActivated(player.worldObj)
- && playerInfo.getInteger(curse.getName()) > 0)
- curse.entityDropItems(player, event.entityLiving,
+ if (curse.canCurseBeActivated(
+ player.worldObj)
+ && playerInfo.getInteger(
+ curse.getName()) > 0)
+ curse.entityDropItems(
+ player,
+ event.entityLiving,
event.drops);
}
}
@@ -295,130 +347,167 @@ public class EntityEventHandler { public void onEntityAttacked(LivingAttackEvent event) {
EntityLivingBase entity = event.entityLiving;
- if (event.source.getEntity() != null
- && event.source.getEntity() instanceof EntityLivingBase
- && ((EntityLivingBase) event.source.getEntity())
- .isPotionActive(PotionList.stun))
+ if (event.source.getEntity() != null && event.source
+ .getEntity() instanceof EntityLivingBase
+ && ((EntityLivingBase) event.source
+ .getEntity()).isPotionActive(
+ PotionList.stun))
event.setCanceled(true);
if (entity instanceof EntityPlayer) {
EntityPlayer player = (EntityPlayer) entity;
NBTTagCompound playerInfo = PlayerUtils
- .getModPlayerPersistTag(player, Variables.MODID);
+ .getModPlayerPersistTag(player,
+ Variables.MODID);
- if (!(event.source.getEntity() instanceof EntityPlayer)
+ if (!(event.source
+ .getEntity() instanceof EntityPlayer)
&& !player.capabilities.isCreativeMode) {
if (!player.worldObj.isRemote)
for (int i = 0; i < 18; i++)
- if (getJewelryItems(playerInfo, i) != null) {
- if (getJewelryItems(playerInfo, i)
- .getItem() instanceof ItemBaseJewelry) {
+ if (getJewelryItems(
+ playerInfo,
+ i) != null) {
+ if (getJewelryItems(
+ playerInfo,
+ i).getItem() instanceof ItemBaseJewelry) {
((ItemBaseJewelry) getJewelryItems(
- playerInfo, i).getItem())
- .onPlayerAttacked(
- getJewelryItems(
- playerInfo,
- i),
- player,
- event.source,
- event.ammount);
+ playerInfo,
+ i).getItem()).onPlayerAttacked(
+ getJewelryItems(playerInfo,
+ i),
+ player,
+ event.source,
+ event.ammount);
if (((ItemBaseJewelry) getJewelryItems(
- playerInfo, i).getItem())
- .onPlayerAttackedCacellable(
- getJewelryItems(
- playerInfo,
- i),
- player,
- event.source,
- event.ammount)) {
- event.setCanceled(true);
+ playerInfo,
+ i).getItem()).onPlayerAttackedCacellable(
+ getJewelryItems(playerInfo,
+ i),
+ player,
+ event.source,
+ event.ammount)) {
+ event.setCanceled(
+ true);
}
}
- if (getJewelryItems(playerInfo, i)
- .getItem() instanceof IJewelryItem) {
- ((IJewelryItem) getJewelryItems(playerInfo,
- i).getItem())
- .onPlayerAttackedAction(
- getJewelryItems(
- playerInfo,
- i),
- player,
- event.source,
- event.ammount);
+ if (getJewelryItems(
+ playerInfo,
+ i).getItem() instanceof IJewelryItem) {
+ ((IJewelryItem) getJewelryItems(
+ playerInfo,
+ i).getItem()).onPlayerAttackedAction(
+ getJewelryItems(playerInfo,
+ i),
+ player,
+ event.source,
+ event.ammount);
}
}
if (ConfigHandler.CURSES_ENABLED) {
- for (Curse curse : Curse.getCurseList()) {
- if (curse.canCurseBeActivated(player.worldObj)
- && playerInfo
- .getInteger(curse.getName()) > 0) {
- curse.attackedAction(player.worldObj, player,
- event, event.source.getEntity());
+ for (Curse curse : Curse
+ .getCurseList()) {
+ if (curse.canCurseBeActivated(
+ player.worldObj)
+ && playerInfo.getInteger(
+ curse.getName()) > 0) {
+ curse.attackedAction(
+ player.worldObj,
+ player,
+ event,
+ event.source.getEntity());
}
}
}
}
removeHearts(event, player, playerInfo);
- JewelrycraftMod.netWrapper
- .sendToAll(new PacketSendServerPlayersInfo());
+ JewelrycraftMod.netWrapper.sendToAll(
+ new PacketSendServerPlayersInfo());
JewelrycraftMod.netWrapper.sendTo(
- new PacketSendClientPlayerInfo(playerInfo),
+ new PacketSendClientPlayerInfo(
+ playerInfo),
(EntityPlayerMP) player);
}
if (event.source.getEntity() instanceof EntityPlayer) {
- EntityPlayer player = (EntityPlayer) event.source.getEntity();
+ EntityPlayer player = (EntityPlayer) event.source
+ .getEntity();
NBTTagCompound playerInfo = PlayerUtils
- .getModPlayerPersistTag(player, Variables.MODID);
+ .getModPlayerPersistTag(player,
+ Variables.MODID);
for (int i = 0; i < 18; i++)
- if (getJewelryItems(playerInfo, i) != null) {
+ if (getJewelryItems(playerInfo,
+ i) != null) {
if (getJewelryItems(playerInfo, i)
.getItem() instanceof ItemBaseJewelry) {
- ((ItemBaseJewelry) getJewelryItems(playerInfo, i)
- .getItem()).onEntityAttacked(
- getJewelryItems(playerInfo, i),
- player, entity, event.ammount);
- if (((ItemBaseJewelry) getJewelryItems(playerInfo,
+ ((ItemBaseJewelry) getJewelryItems(
+ playerInfo,
+ i).getItem()).onEntityAttacked(
+ getJewelryItems(playerInfo,
+ i),
+ player,
+ entity,
+ event.ammount);
+ if (((ItemBaseJewelry) getJewelryItems(
+ playerInfo,
i).getItem()).onEntityAttackedCacellable(
- getJewelryItems(playerInfo, i),
- player, entity, event.ammount))
- event.setCanceled(true);
+ getJewelryItems(playerInfo,
+ i),
+ player,
+ entity,
+ event.ammount))
+ event.setCanceled(
+ true);
}
if (getJewelryItems(playerInfo, i)
.getItem() instanceof IJewelryItem)
- ((IJewelryItem) getJewelryItems(playerInfo, i)
- .getItem()).onEntityAttackedByPlayer(
- getJewelryItems(playerInfo, i),
- player, entity, event.ammount);
+ ((IJewelryItem) getJewelryItems(
+ playerInfo,
+ i).getItem()).onEntityAttackedByPlayer(
+ getJewelryItems(playerInfo,
+ i),
+ player,
+ entity,
+ event.ammount);
}
if (ConfigHandler.CURSES_ENABLED)
for (Curse curse : Curse.getCurseList())
- if (curse.canCurseBeActivated(player.worldObj)
- && playerInfo
- .getInteger(curse.getName()) > 0) {
- curse.attackedByPlayerAction(event,
- entity.worldObj, player, entity);
- if (curse.attackedByPlayerActionCancelable(event,
- player.worldObj, player, entity))
- event.setCanceled(true);
+ if (curse.canCurseBeActivated(
+ player.worldObj)
+ && playerInfo.getInteger(
+ curse.getName()) > 0) {
+ curse.attackedByPlayerAction(
+ event,
+ entity.worldObj,
+ player,
+ entity);
+ if (curse.attackedByPlayerActionCancelable(
+ event,
+ player.worldObj,
+ player,
+ entity))
+ event.setCanceled(
+ true);
}
- if (entity instanceof EntityHeart && entity.getAge() < 30)
+ if (entity instanceof EntityHeart
+ && entity.getAge() < 30)
event.setCanceled(true);
if (event.source.getEntity() instanceof EntityPlayerMP) {
- JewelrycraftMod.netWrapper
- .sendToAll(new PacketSendServerPlayersInfo());
+ JewelrycraftMod.netWrapper.sendToAll(
+ new PacketSendServerPlayersInfo());
JewelrycraftMod.netWrapper.sendTo(
- new PacketSendClientPlayerInfo(playerInfo),
+ new PacketSendClientPlayerInfo(
+ playerInfo),
(EntityPlayerMP) player);
}
}
}
- public void removeHearts(LivingAttackEvent event, EntityPlayer player,
- NBTTagCompound playerInfo) {
+ public void removeHearts(LivingAttackEvent event,
+ EntityPlayer player, NBTTagCompound playerInfo) {
if (!player.worldObj.isRemote
&& !player.capabilities.isCreativeMode
&& (float) player.hurtResistantTime <= (float) player.maxHurtResistantTime
@@ -428,17 +517,21 @@ public class EntityEventHandler { }
if (playerInfo.getFloat("BlueHeart") > 0) {
- float damage = playerInfo.getFloat("BlueHeart")
+ float damage = playerInfo
+ .getFloat("BlueHeart")
- event.ammount;
if (damage >= 0) {
- playerInfo.setFloat("BlueHeart", damage);
+ playerInfo.setFloat("BlueHeart",
+ damage);
} else {
- playerInfo.setFloat("BlueHeart", 0f);
+ playerInfo.setFloat("BlueHeart",
+ 0f);
}
if (damage < 0) {
System.out.println(damage);
- player.attackEntityFrom(event.source,
+ player.attackEntityFrom(
+ event.source,
Math.abs(damage));
}
@@ -446,42 +539,56 @@ public class EntityEventHandler { player.hurtTime = player.maxHurtTime = 10;
player.worldObj.playSoundAtEntity(player,
"game.player.hurt", 1.0F,
- (EntityEventHandler.rand.nextFloat()
- - EntityEventHandler.rand.nextFloat())
- * 0.2F + 1.0F);
+ (EntityEventHandler.rand
+ .nextFloat()
+ - EntityEventHandler.rand
+ .nextFloat())
+ * 0.2F
+ + 1.0F);
event.setCanceled(true);
} else if (playerInfo.getFloat("BlackHeart") > 0) {
AxisAlignedBB axisalignedbb = player.boundingBox
.expand(6.0D, 6.0D, 6.0D);
List<?> enemies = player.worldObj
- .getEntitiesWithinAABBExcludingEntity(player,
+ .getEntitiesWithinAABBExcludingEntity(
+ player,
axisalignedbb,
EntitySelector.selectMonsters);
if (enemies != null && !enemies.isEmpty()
&& event.source != DamageSourceList.blackHeart) {
- Iterator<?> iterator = enemies.iterator();
+ Iterator<?> iterator = enemies
+ .iterator();
while (iterator.hasNext()) {
- Entity enemy = (Entity) iterator.next();
- enemy.attackEntityFrom(DamageSourceList.blackHeart,
+ Entity enemy = (Entity) iterator
+ .next();
+ enemy.attackEntityFrom(
+ DamageSourceList.blackHeart,
6f);
}
}
- float damage = playerInfo.getFloat("BlackHeart")
+ float damage = playerInfo
+ .getFloat("BlackHeart")
- event.ammount;
if (damage >= 0)
- playerInfo.setFloat("BlackHeart", damage);
+ playerInfo.setFloat("BlackHeart",
+ damage);
else
- playerInfo.setFloat("BlackHeart", 0f);
+ playerInfo.setFloat("BlackHeart",
+ 0f);
if (damage < 0)
- player.attackEntityFrom(event.source,
+ player.attackEntityFrom(
+ event.source,
Math.abs(damage));
player.hurtResistantTime = player.maxHurtResistantTime;
player.hurtTime = player.maxHurtTime = 10;
player.worldObj.playSoundAtEntity(player,
"game.player.hurt", 1.0F,
- (EntityEventHandler.rand.nextFloat()
- - EntityEventHandler.rand.nextFloat())
- * 0.2F + 1.0F);
+ (EntityEventHandler.rand
+ .nextFloat()
+ - EntityEventHandler.rand
+ .nextFloat())
+ * 0.2F
+ + 1.0F);
event.setCanceled(true);
}
}
@@ -492,25 +599,36 @@ public class EntityEventHandler { EntityPlayer player = event.entityPlayer;
if (!player.worldObj.isRemote) {
NBTTagCompound playerInfo = PlayerUtils
- .getModPlayerPersistTag(player, Variables.MODID);
+ .getModPlayerPersistTag(player,
+ Variables.MODID);
if (playerInfo.hasKey("cursePoints")) {
- int points = playerInfo.getInteger("cursePoints");
- int maxCurses = playerInfo.getInteger("cursePoints")
- / Variables.CURSE_POINTS_PER_LEVEL + 1;
- if (points > 0 && playerInfo
- .getInteger("activeCurses") < maxCurses)
- while (playerInfo
- .getInteger("activeCurses") < maxCurses
- && Curse.availableCurses.size() > 0
- && playerInfo
- .getInteger("activeCurses") < Curse
- .getCurseList().size())
+ int points = playerInfo
+ .getInteger("cursePoints");
+ int maxCurses = playerInfo
+ .getInteger("cursePoints")
+ / Variables.CURSE_POINTS_PER_LEVEL
+ + 1;
+ if (points > 0 && playerInfo.getInteger(
+ "activeCurses") < maxCurses)
+ while (playerInfo.getInteger(
+ "activeCurses") < maxCurses
+ && Curse.availableCurses
+ .size() > 0
+ && playerInfo.getInteger(
+ "activeCurses") < Curse
+ .getCurseList()
+ .size())
addCurse(player, playerInfo);
if (!playerInfo.hasKey("curseTime")
- || !playerInfo.hasKey("reselectCurses")
- || playerInfo.getBoolean("reselectCurses")) {
- playerInfo.setInteger("curseTime", 23000);
- playerInfo.setBoolean("reselectCurses", false);
+ || !playerInfo.hasKey(
+ "reselectCurses")
+ || playerInfo.getBoolean(
+ "reselectCurses")) {
+ playerInfo.setInteger("curseTime",
+ 23000);
+ playerInfo.setBoolean(
+ "reselectCurses",
+ false);
}
}
playerInfo.setFloat("BlueHeart", 0f);
@@ -518,42 +636,56 @@ public class EntityEventHandler { playerInfo.setFloat("WhiteHeart", 0f);
if (ConfigHandler.CURSES_ENABLED)
for (Curse curse : Curse.getCurseList())
- if (curse.canCurseBeActivated(player.worldObj)
- && playerInfo.getInteger(curse.getName()) > 0)
- curse.respawnAction(player.worldObj, player);
+ if (curse.canCurseBeActivated(
+ player.worldObj)
+ && playerInfo.getInteger(
+ curse.getName()) > 0)
+ curse.respawnAction(
+ player.worldObj,
+ player);
for (int i = 0; i < 18; i++)
- if (getJewelryItems(playerInfo, i) != null) {
+ if (getJewelryItems(playerInfo,
+ i) != null) {
if (getJewelryItems(playerInfo, i)
.getItem() instanceof ItemBaseJewelry)
- ((ItemBaseJewelry) getJewelryItems(playerInfo, i)
- .getItem()).onPlayerRespawn(
- getJewelryItems(playerInfo, i),
+ ((ItemBaseJewelry) getJewelryItems(
+ playerInfo,
+ i).getItem()).onPlayerRespawn(
+ getJewelryItems(playerInfo,
+ i),
event);
if (getJewelryItems(playerInfo, i)
.getItem() instanceof IJewelryItem)
- ((IJewelryItem) getJewelryItems(playerInfo, i)
- .getItem()).onPlayerRespawnAction(
- getJewelryItems(playerInfo, i),
+ ((IJewelryItem) getJewelryItems(
+ playerInfo,
+ i).getItem()).onPlayerRespawnAction(
+ getJewelryItems(playerInfo,
+ i),
event);
}
JewelrycraftMod.netWrapper.sendTo(
- new PacketSendClientPlayerInfo(playerInfo),
+ new PacketSendClientPlayerInfo(
+ playerInfo),
(EntityPlayerMP) player);
if (addedCurses) {
- JewelrycraftMod.netWrapper
- .sendToAll(new PacketSendServerPlayersInfo());
+ JewelrycraftMod.netWrapper.sendToAll(
+ new PacketSendServerPlayersInfo());
addedCurses = false;
}
}
}
- public void addCurse(EntityPlayer player, NBTTagCompound playerInfo) {
+ public void addCurse(EntityPlayer player,
+ NBTTagCompound playerInfo) {
if (ConfigHandler.CURSES_ENABLED
&& Curse.availableCurses.size() > 0) {
Curse cur = ((WeightedRandomCurse) WeightedRandom
- .getRandomItem(rand, JewelrycraftUtil
- .getCurses(player.worldObj, player, rand)))
- .getCurse(rand);
+ .getRandomItem(rand,
+ JewelrycraftUtil.getCurses(
+ player.worldObj,
+ player,
+ rand))).getCurse(
+ rand);
playerInfo.setInteger(cur.getName(), 1);
Curse.availableCurses.remove(cur);
addedCurses = true;
@@ -561,11 +693,14 @@ public class EntityEventHandler { playerInfo.setInteger("activeCurses", 1);
else
playerInfo.setInteger("activeCurses",
- playerInfo.getInteger("activeCurses") + 1);
- JewelrycraftMod.netWrapper
- .sendToAll(new PacketSendServerPlayersInfo());
+ playerInfo.getInteger(
+ "activeCurses")
+ + 1);
+ JewelrycraftMod.netWrapper.sendToAll(
+ new PacketSendServerPlayersInfo());
JewelrycraftMod.netWrapper.sendTo(
- new PacketSendClientPlayerInfo(playerInfo),
+ new PacketSendClientPlayerInfo(
+ playerInfo),
(EntityPlayerMP) player);
}
}
@@ -573,30 +708,38 @@ public class EntityEventHandler { @SubscribeEvent
public void itemToss(ItemTossEvent event) {
NBTTagCompound playerInfo = PlayerUtils
- .getModPlayerPersistTag(event.player, Variables.MODID);
+ .getModPlayerPersistTag(event.player,
+ Variables.MODID);
if (ConfigHandler.CURSES_ENABLED)
for (Curse curse : Curse.getCurseList())
- if (event.player != null
- && curse.canCurseBeActivated(event.player.worldObj)
- && playerInfo.getInteger(curse.getName()) > 0
+ if (event.player != null && curse
+ .canCurseBeActivated(
+ event.player.worldObj)
+ && playerInfo.getInteger(
+ curse.getName()) > 0
&& curse.itemToss()) {
EntityItem entityitem = new EntityItem(
event.player.worldObj,
- event.player.posX + 0.5D,
- event.player.posY + 0.5D,
- event.player.posZ + 0.5D,
+ event.player.posX
+ + 0.5D,
+ event.player.posY
+ + 0.5D,
+ event.player.posZ
+ + 0.5D,
event.entityItem.getEntityItem());
if (entityitem != null) {
entityitem.motionX = 0;
entityitem.motionZ = 0;
entityitem.motionY = 0.11000000298023224D;
event.player.worldObj
- .spawnEntityInWorld(entityitem);
+ .spawnEntityInWorld(
+ entityitem);
MinecraftServer.getServer()
.getConfigurationManager()
- .sendChatMsg(new ChatComponentText("<"
- + event.player.getDisplayName()
- + "> I shouldn't drop this. I might need it later."));
+ .sendChatMsg(new ChatComponentText(
+ "<" + event.player
+ .getDisplayName()
+ + "> I shouldn't drop this. I might need it later."));
event.setCanceled(true);
}
}
@@ -606,18 +749,21 @@ public class EntityEventHandler { public void playerFileSave(PlayerEvent.SaveToFile event) {
if (event.entity instanceof EntityPlayer
&& !(event.entity instanceof EntityPlayerMP))
- JewelrycraftMod.netWrapper
- .sendToServer(new PacketRequestPlayerInfo());
+ JewelrycraftMod.netWrapper.sendToServer(
+ new PacketRequestPlayerInfo());
}
public int calculateLuck(EntityPlayer player) {
int luck = 0;
NBTTagCompound playerInfo = PlayerUtils
- .getModPlayerPersistTag(player, Variables.MODID);
+ .getModPlayerPersistTag(player,
+ Variables.MODID);
if (ConfigHandler.CURSES_ENABLED)
for (Curse curse : Curse.getCurseList())
- if (curse.canCurseBeActivated(player.worldObj)
- && playerInfo.getInteger(curse.getName()) > 0)
+ if (curse.canCurseBeActivated(
+ player.worldObj)
+ && playerInfo.getInteger(
+ curse.getName()) > 0)
luck += curse.luck();
return luck;
}
@@ -628,28 +774,35 @@ public class EntityEventHandler { if (rand.nextInt(chance) == 0 && live
.getCreatureAttribute() != JewelrycraftUtil.HEARTS) {
if (type == "White") {
- EntityHeart h = new EntityHalfHeart(live.worldObj);
+ EntityHeart h = new EntityHalfHeart(
+ live.worldObj);
h.setType(type);
- h.setLocationAndAngles(live.posX, live.posY, live.posZ,
+ h.setLocationAndAngles(live.posX,
+ live.posY, live.posZ,
MathHelper.wrapAngleTo180_float(
rand.nextFloat() * 360.0F),
0.0F);
live.worldObj.spawnEntityInWorld(h);
} else {
- for (int i = 1;
- i <= 1 + rand.nextInt(
- 1 + (int) (live.getMaxHealth() / 2));
- i++) {
+ for (int i = 1; i <= 1 + rand.nextInt(1
+ + (int) (live.getMaxHealth()
+ / 2)); i++) {
EntityHeart[] hearts = {
new EntityHeart(live.worldObj),
- new EntityHalfHeart(entity.worldObj) };
- EntityHeart h = hearts[rand.nextInt(2)];
+ new EntityHalfHeart(
+ entity.worldObj)
+ };
+ EntityHeart h = hearts[rand
+ .nextInt(2)];
h.setType(type);
- h.setLocationAndAngles(live.posX, live.posY, live.posZ,
+ h.setLocationAndAngles(live.posX,
+ live.posY,
+ live.posZ,
MathHelper.wrapAngleTo180_float(
rand.nextFloat() * 360.0F),
0.0F);
- live.worldObj.spawnEntityInWorld(h);
+ live.worldObj.spawnEntityInWorld(
+ h);
}
}
}
@@ -658,44 +811,64 @@ public class EntityEventHandler { @SubscribeEvent
public void onEntityDead(LivingDeathEvent event) {
final Entity entity = event.entity;
- if (!entity.worldObj.isRemote && !(entity instanceof EntityPlayer)
+ if (!entity.worldObj.isRemote
+ && !(entity instanceof EntityPlayer)
&& entity instanceof EntityLiving
&& event.source.getEntity() != null
&& event.source.getEntity() instanceof EntityPlayer) {
System.out.println(luck);
spawnHearts(entity, Math.max(2, 20 - luck));
- EntityPlayer player = (EntityPlayer) event.source.getEntity();
+ EntityPlayer player = (EntityPlayer) event.source
+ .getEntity();
NBTTagCompound playerInfo = PlayerUtils
- .getModPlayerPersistTag(player, Variables.MODID);
+ .getModPlayerPersistTag(player,
+ Variables.MODID);
if (ConfigHandler.CURSES_ENABLED)
for (Curse curse : Curse.getCurseList())
- if (curse.canCurseBeActivated(player.worldObj)
- && playerInfo.getInteger(curse.getName()) > 0)
- curse.entityDeathAction(player.worldObj,
- event.entityLiving, player);
+ if (curse.canCurseBeActivated(
+ player.worldObj)
+ && playerInfo.getInteger(
+ curse.getName()) > 0)
+ curse.entityDeathAction(
+ player.worldObj,
+ event.entityLiving,
+ player);
}
if (entity instanceof EntityPlayer) {
EntityPlayer player = (EntityPlayer) entity;
NBTTagCompound playerInfo = PlayerUtils
- .getModPlayerPersistTag(player, Variables.MODID);
+ .getModPlayerPersistTag(player,
+ Variables.MODID);
playerInfo.setFloat("BlueHeart", 0f);
playerInfo.setFloat("BlackHeart", 0f);
playerInfo.setFloat("WhiteHeart", 0f);
if (playerInfo.hasKey("reselectCurses")
- && playerInfo.getBoolean("reselectCurses")) {
+ && playerInfo.getBoolean(
+ "reselectCurses")) {
playerInfo.setInteger("activeCurses", 0);
if (ConfigHandler.CURSES_ENABLED)
- for (Curse l : Curse.getCurseList()) {
- if (l.canCurseBeActivated(player.worldObj)
- && playerInfo
- .getInteger(l.getName()) == 1) {
- playerInfo.setInteger(l.getName(), 0);
- l.setTicksActive(0);
- if (!Curse.availableCurses.contains(l))
- Curse.availableCurses.add(l);
- } else if (l.canCurseBeActivated(player.worldObj)
- && playerInfo.getInteger(l.getName()) >= 2)
- playerInfo.setInteger(l.getName(), 1);
+ for (Curse l : Curse
+ .getCurseList()) {
+ if (l.canCurseBeActivated(
+ player.worldObj)
+ && playerInfo.getInteger(
+ l.getName()) == 1) {
+ playerInfo.setInteger(
+ l.getName(),
+ 0);
+ l.setTicksActive(
+ 0);
+ if (!Curse.availableCurses
+ .contains(l))
+ Curse.availableCurses
+ .add(l);
+ } else if (l.canCurseBeActivated(
+ player.worldObj)
+ && playerInfo.getInteger(
+ l.getName()) >= 2)
+ playerInfo.setInteger(
+ l.getName(),
+ 1);
}
if (entity.worldObj.isRemote)
JewelrycraftMod.netWrapper
@@ -704,32 +877,43 @@ public class EntityEventHandler { if (ConfigHandler.CURSES_ENABLED) {
for (Curse curse : Curse.getCurseList())
- if (curse.canCurseBeActivated(player.worldObj)
- && playerInfo.getInteger(curse.getName()) > 0)
- curse.playerDeathAction(player.worldObj, player,
+ if (curse.canCurseBeActivated(
+ player.worldObj)
+ && playerInfo.getInteger(
+ curse.getName()) > 0)
+ curse.playerDeathAction(
+ player.worldObj,
+ player,
event);
}
for (int i = 0; i < 18; i++)
- if (getJewelryItems(playerInfo, i) != null) {
+ if (getJewelryItems(playerInfo,
+ i) != null) {
if (getJewelryItems(playerInfo, i)
.getItem() instanceof ItemBaseJewelry)
- ((ItemBaseJewelry) getJewelryItems(playerInfo, i)
- .getItem()).onPlayerDead(
- getJewelryItems(playerInfo, i),
- player, event.source);
+ ((ItemBaseJewelry) getJewelryItems(
+ playerInfo,
+ i).getItem()).onPlayerDead(
+ getJewelryItems(playerInfo,
+ i),
+ player,
+ event.source);
if (getJewelryItems(playerInfo, i)
.getItem() instanceof IJewelryItem)
- ((IJewelryItem) getJewelryItems(playerInfo, i)
- .getItem()).onPlayerDeadAction(
- getJewelryItems(playerInfo, i),
- player, event.source);
+ ((IJewelryItem) getJewelryItems(
+ playerInfo,
+ i).getItem()).onPlayerDeadAction(
+ getJewelryItems(playerInfo,
+ i),
+ player,
+ event.source);
}
}
if (event.entity instanceof EntityPlayer
&& !(event.entity instanceof EntityPlayerMP))
- JewelrycraftMod.netWrapper
- .sendToServer(new PacketRequestPlayerInfo());
+ JewelrycraftMod.netWrapper.sendToServer(
+ new PacketRequestPlayerInfo());
}
@SubscribeEvent
@@ -737,30 +921,40 @@ public class EntityEventHandler { if (event.entity instanceof EntityPlayer) {
EntityPlayer player = (EntityPlayer) event.entity;
NBTTagCompound playerInfo = PlayerUtils
- .getModPlayerPersistTag(player, Variables.MODID);
+ .getModPlayerPersistTag(player,
+ Variables.MODID);
if (ConfigHandler.CURSES_ENABLED) {
for (Curse curse : Curse.getCurseList())
- if (curse.canCurseBeActivated(player.worldObj)
- && playerInfo.getInteger(curse.getName()) > 0)
- curse.playerHealAction(player.worldObj, player,
+ if (curse.canCurseBeActivated(
+ player.worldObj)
+ && playerInfo.getInteger(
+ curse.getName()) > 0)
+ curse.playerHealAction(
+ player.worldObj,
+ player,
event);
}
}
}
-
+
@SubscribeEvent
public void onPlayerSleep(PlayerSleepInBedEvent event) {
if (event.entity instanceof EntityPlayer) {
EntityPlayer player = (EntityPlayer) event.entity;
NBTTagCompound playerInfo = PlayerUtils
- .getModPlayerPersistTag(player, Variables.MODID);
+ .getModPlayerPersistTag(player,
+ Variables.MODID);
if (ConfigHandler.CURSES_ENABLED) {
for (Curse curse : Curse.getCurseList())
- if (curse.canCurseBeActivated(player.worldObj)
- && playerInfo.getInteger(curse.getName()) > 0)
- curse.playerSleepAction(player.worldObj, player,
+ if (curse.canCurseBeActivated(
+ player.worldObj)
+ && playerInfo.getInteger(
+ curse.getName()) > 0)
+ curse.playerSleepAction(
+ player.worldObj,
+ player,
event);
}
}
diff --git a/src/main/java/darkknight/jewelrycraft/events/EventList.java b/src/main/java/darkknight/jewelrycraft/events/EventList.java index 2098345..17f6d0e 100755 --- a/src/main/java/darkknight/jewelrycraft/events/EventList.java +++ b/src/main/java/darkknight/jewelrycraft/events/EventList.java @@ -21,10 +21,11 @@ import net.minecraftforge.common.MinecraftForge; public class EventList {
public static void preInit(FMLPreInitializationEvent e) {
- MinecraftForge.EVENT_BUS.register(new EntityEventHandler());
+ MinecraftForge.EVENT_BUS
+ .register(new EntityEventHandler());
MinecraftForge.EVENT_BUS.register(new BlockEventHandler());
MinecraftForge.EVENT_BUS.register(BucketHandler.INSTANCE);
-
+
FMLCommonHandler.instance().bus()
.register(new EventCommonHandler());
BucketHandler.INSTANCE.buckets.put(BlockList.moltenMetal,
@@ -36,7 +37,8 @@ public class EventList { GameRegistry.registerWorldGenerator(new Generation(), 0);
JewelrycraftMod.proxy.init();
new GuiHandler();
- FMLCommonHandler.instance().bus().register(ConfigHandler.INSTANCE);
+ FMLCommonHandler.instance().bus()
+ .register(ConfigHandler.INSTANCE);
}
public static void postInit(FMLPostInitializationEvent e) {
diff --git a/src/main/java/darkknight/jewelrycraft/events/KeyBindings.java b/src/main/java/darkknight/jewelrycraft/events/KeyBindings.java index c7f5bef..d196a05 100755 --- a/src/main/java/darkknight/jewelrycraft/events/KeyBindings.java +++ b/src/main/java/darkknight/jewelrycraft/events/KeyBindings.java @@ -12,11 +12,13 @@ import net.minecraft.client.settings.KeyBinding; public class KeyBindings {
public static KeyBinding render = new KeyBinding(
- "Pretty Render", Keyboard.KEY_Z, Variables.MODNAME);
+ "Pretty Render", Keyboard.KEY_Z,
+ Variables.MODNAME);
public static KeyBinding inventory = new KeyBinding(
- "Jewelry Inventory", Keyboard.KEY_J, Variables.MODNAME);
- public static KeyBinding curses = new KeyBinding("Curses Tab",
- Keyboard.KEY_C, Variables.MODNAME);
+ "Jewelry Inventory", Keyboard.KEY_J,
+ Variables.MODNAME);
+ public static KeyBinding curses = new KeyBinding(
+ "Curses Tab", Keyboard.KEY_C, Variables.MODNAME);
/**
*
@@ -35,10 +37,10 @@ public class KeyBindings { if (render.isPressed())
JewelrycraftMod.fancyRender = !JewelrycraftMod.fancyRender;
if (inventory.isPressed())
- JewelrycraftMod.netWrapper
- .sendToServer(new PacketKeyPressEvent(0));
+ JewelrycraftMod.netWrapper.sendToServer(
+ new PacketKeyPressEvent(0));
if (curses.isPressed())
- JewelrycraftMod.netWrapper
- .sendToServer(new PacketKeyPressEvent(1));
+ JewelrycraftMod.netWrapper.sendToServer(
+ new PacketKeyPressEvent(1));
}
}
\ No newline at end of file diff --git a/src/main/java/darkknight/jewelrycraft/events/PlayerRenderHandler.java b/src/main/java/darkknight/jewelrycraft/events/PlayerRenderHandler.java index 4bbb2c5..40be3e5 100755 --- a/src/main/java/darkknight/jewelrycraft/events/PlayerRenderHandler.java +++ b/src/main/java/darkknight/jewelrycraft/events/PlayerRenderHandler.java @@ -23,56 +23,66 @@ import net.minecraftforge.client.event.RenderHandEvent; import net.minecraftforge.client.event.RenderPlayerEvent;
public class PlayerRenderHandler {
- EarringsRender earrings = new EarringsRender();
- BraceletRender bracelet = new BraceletRender();
- NecklaceRender necklace = new NecklaceRender();
- RingRender ring = new RingRender();
+ EarringsRender earrings = new EarringsRender();
+ BraceletRender bracelet = new BraceletRender();
+ NecklaceRender necklace = new NecklaceRender();
+ RingRender ring = new RingRender();
public static NBTTagCompound playersInfo = new NBTTagCompound();
- float size = 0.055F;
+ float size = 0.055F;
@SubscribeEvent
public void renderScreen(RenderPlayerEvent.Specials.Post event) {
GL11.glPushMatrix();
- ModelRenderer rightArm =
- event.renderer.modelBipedMain.bipedRightArm;
+ ModelRenderer rightArm = event.renderer.modelBipedMain.bipedRightArm;
ModelRenderer leftArm = event.renderer.modelBipedMain.bipedLeftArm;
ModelRenderer head = event.renderer.modelBipedMain.bipedHead;
ModelRenderer body = event.renderer.modelBipedMain.bipedBody;
- Iterator<EntityPlayer> players =
- event.entityPlayer.worldObj.playerEntities.iterator();
+ Iterator<EntityPlayer> players = event.entityPlayer.worldObj.playerEntities
+ .iterator();
float rotAngleX = 0F, rotAngleY = 0F, rotAngleZ = 0F;
if (playersInfo != null) {
while (players.hasNext()) {
- int[] gemColor = { -1, -1, -1, -1 };
- int[] ingotColor = { -1, -1, -1, -1 };
+ int[] gemColor = {
+ -1, -1, -1, -1
+ };
+ int[] ingotColor = {
+ -1, -1, -1, -1
+ };
int gem = -1;
int ingot = -1;
EntityPlayer player = players.next();
NBTTagCompound playerInfo = (NBTTagCompound) playersInfo
.getTag(player.getDisplayName());
if (ConfigHandler.CURSES_ENABLED)
- for (Curse curse : Curse.getCurseList())
- if (curse != null
- && curse.canCurseBeActivated(
+ for (Curse curse : Curse
+ .getCurseList())
+ if (curse != null && curse
+ .canCurseBeActivated(
player.worldObj)
&& playerInfo != null
&& curse.getName() != null
- && playerInfo
- .getInteger(curse.getName()) > 0
+ && playerInfo.getInteger(
+ curse.getName()) > 0
&& event.entityPlayer != null
&& player != null
- && event.entityPlayer.getDisplayName()
+ && event.entityPlayer
+ .getDisplayName()
.equals(player.getDisplayName())
- && playerInfo
- .getInteger("cursePoints") > 0)
- curse.playerRender(player, event);
+ && playerInfo.getInteger(
+ "cursePoints") > 0)
+ curse.playerRender(
+ player,
+ event);
int no = 0;
ModelRenderer arm = rightArm;
for (int i = 0; i <= 9; i++)
- if (playerInfo != null && event.entityPlayer != null
+ if (playerInfo != null
+ && event.entityPlayer != null
&& player != null
- && playerInfo.hasKey("ext" + i)
- && event.entityPlayer.getDisplayName()
+ && playerInfo.hasKey(
+ "ext" + i)
+ && event.entityPlayer
+ .getDisplayName()
.equals(player.getDisplayName())) {
gem = -1;
ingot = -1;
@@ -81,268 +91,426 @@ public class PlayerRenderHandler { float s = 0.055F;
NBTTagCompound nbt = (NBTTagCompound) playerInfo
.getTag("ext" + i);
- ItemStack item =
- ItemStack.loadItemStackFromNBT(nbt);
+ ItemStack item = ItemStack
+ .loadItemStackFromNBT(
+ nbt);
if (Loader.isModLoaded(
"alpaca") /*
- * &&
- * fiskfille.alpaca.AlpacaAPI.
- * isAlpacaClient(event.
- * entityPlayer)
- */)
+ * &&
+ * fiskfille
+ * .
+ * alpaca
+ * .
+ * AlpacaAPI.
+ * isAlpacaClient
+ * (
+ * event.
+ * entityPlayer)
+ */)
arm = body;
GL11.glPushMatrix();
if (arm.rotateAngleX == 0.0F
&& arm.rotateAngleY == 0.0F
&& arm.rotateAngleZ == 0.0F) {
- if ((arm.rotationPointX + rotAngleX) != 0.0F
+ if ((arm.rotationPointX
+ + rotAngleX) != 0.0F
|| (arm.rotationPointY
+ rotAngleY) != 0.0F
|| (arm.rotationPointZ
+ rotAngleZ) != 0.0F)
GL11.glTranslatef(
- (arm.rotationPointX + rotAngleX)
+ (arm.rotationPointX
+ + rotAngleX)
* s,
- (arm.rotationPointY + rotAngleY)
+ (arm.rotationPointY
+ + rotAngleY)
* s,
- (arm.rotationPointZ + rotAngleZ)
+ (arm.rotationPointZ
+ + rotAngleZ)
* s);
- } else if (!Loader.isModLoaded(
- "alpaca") /*
- * || (Loader.isModLoaded(
- * "alpaca") &&
- * !fiskfille.alpaca.AlpacaAPI.
- * isAlpacaClient(event.
- * entityPlayer))
+ } else if (!Loader
+ .isModLoaded("alpaca") /*
+ * ||
+ * (Loader
+ * .
+ * isModLoaded(
+ * "alpaca")
+ * &&
+ * !fiskfille
+ * .
+ * alpaca
+ * .
+ * AlpacaAPI.
+ * isAlpacaClient
+ * (
+ * event.
+ * entityPlayer
+ * )
+ * )
*/) {
GL11.glTranslatef(
- (arm.rotationPointX + rotAngleX) * s,
- (arm.rotationPointY + rotAngleY) * s,
- (arm.rotationPointZ + rotAngleZ) * s);
+ (arm.rotationPointX
+ + rotAngleX)
+ * s,
+ (arm.rotationPointY
+ + rotAngleY)
+ * s,
+ (arm.rotationPointZ
+ + rotAngleZ)
+ * s);
if (arm.rotateAngleZ != 0.0F)
- GL11.glRotatef(
- arm.rotateAngleZ
- * (180F / (float) Math.PI),
- 0.0F, 0.0F, 1.0F);
+ GL11.glRotatef(arm.rotateAngleZ
+ * (180F / (float) Math.PI),
+ 0.0F,
+ 0.0F,
+ 1.0F);
if (arm.rotateAngleY != 0.0F)
- GL11.glRotatef(
- arm.rotateAngleY
- * (180F / (float) Math.PI),
- 0.0F, 1.0F, 0.0F);
+ GL11.glRotatef(arm.rotateAngleY
+ * (180F / (float) Math.PI),
+ 0.0F,
+ 1.0F,
+ 0.0F);
if (arm.rotateAngleX != 0.0F)
- GL11.glRotatef(
- arm.rotateAngleX
- * (180F / (float) Math.PI),
- 1.0F, 0.0F, 0.0F);
+ GL11.glRotatef(arm.rotateAngleX
+ * (180F / (float) Math.PI),
+ 1.0F,
+ 0.0F,
+ 0.0F);
}
- if (JewelryNBT.ingot(item) != null)
+ if (JewelryNBT.ingot(
+ item) != null)
ingot = JewelrycraftUtil
- .getColor(JewelryNBT.ingot(item));
- if (JewelryNBT.gem(item) != null)
+ .getColor(JewelryNBT
+ .ingot(item));
+ if (JewelryNBT.gem(
+ item) != null)
gem = JewelrycraftUtil
- .getColor(JewelryNBT.gem(item));
+ .getColor(JewelryNBT
+ .gem(item));
float scale = 0.1f;
if (Loader.isModLoaded(
"alpaca") /*
- * &&
- * fiskfille.alpaca.AlpacaAPI.
- * isAlpacaClient(event.
- * entityPlayer)
- */) {
+ * &&
+ * fiskfille
+ * .
+ * alpaca
+ * .
+ * AlpacaAPI.
+ * isAlpacaClient
+ * (
+ * event.
+ * entityPlayer)
+ */) {
if (i <= 4) {
- GL11.glTranslatef(0.35F, -4.35F,
+ GL11.glTranslatef(
+ 0.35F,
+ -4.35F,
-2.8F + 0.15F * i);
- GL11.glRotatef(90f, 0F, 1F, 0F);
+ GL11.glRotatef(90f,
+ 0F,
+ 1F,
+ 0F);
} else {
- GL11.glTranslatef(-0.35F, -4.35F,
+ GL11.glTranslatef(
+ -0.35F,
+ -4.35F,
1.48F + 0.15F * i);
- GL11.glRotatef(-90f, 0F, 1F, 0F);
+ GL11.glRotatef(-90f,
+ 0F,
+ 1F,
+ 0F);
}
scale = 0.3F;
} else {
if (i <= 4)
- GL11.glTranslatef(0.64F + 0.05F * i,
- -1.15F, 0.07F);
+ GL11.glTranslatef(
+ 0.64F + 0.05F * i,
+ -1.15F,
+ 0.07F);
else
- GL11.glTranslatef(0.59F + 0.05F * i,
- -1.15F, 0.07F);
+ GL11.glTranslatef(
+ 0.59F + 0.05F * i,
+ -1.15F,
+ 0.07F);
}
- GL11.glScalef(scale, scale + scale / 2, scale);
- ring.doRender(event.entityPlayer, 0F, 0F,
- (float) ingot, (float) gem, 0F);
+ GL11.glScalef(scale, scale
+ + scale / 2,
+ scale);
+ ring.doRender(event.entityPlayer,
+ 0F, 0F,
+ (float) ingot,
+ (float) gem,
+ 0F);
GL11.glPopMatrix();
// no++;
}
for (int i = 10; i <= 13; i++)
- if (playerInfo != null && event.entityPlayer != null
+ if (playerInfo != null
+ && event.entityPlayer != null
&& player != null
- && playerInfo.hasKey("ext" + i)
- && event.entityPlayer.getDisplayName()
+ && playerInfo.hasKey(
+ "ext" + i)
+ && event.entityPlayer
+ .getDisplayName()
.equals(player.getDisplayName())) {
NBTTagCompound nbt = (NBTTagCompound) playerInfo
.getTag("ext" + i);
- ItemStack item =
- ItemStack.loadItemStackFromNBT(nbt);
- if (JewelryNBT.ingot(item) != null)
+ ItemStack item = ItemStack
+ .loadItemStackFromNBT(
+ nbt);
+ if (JewelryNBT.ingot(
+ item) != null)
ingotColor[i - 10] = JewelrycraftUtil
- .getColor(JewelryNBT.ingot(item));
- if (JewelryNBT.gem(item) != null)
+ .getColor(JewelryNBT
+ .ingot(item));
+ if (JewelryNBT.gem(
+ item) != null)
gemColor[i - 10] = JewelrycraftUtil
- .getColor(JewelryNBT.gem(item));
+ .getColor(JewelryNBT
+ .gem(item));
}
- if (playerInfo != null && event.entityPlayer != null
+ if (playerInfo != null
+ && event.entityPlayer != null
&& player != null
- && (playerInfo.hasKey("ext10")
- || playerInfo.hasKey("ext11"))
- && event.entityPlayer.getDisplayName()
+ && (playerInfo.hasKey(
+ "ext10")
+ || playerInfo.hasKey(
+ "ext11"))
+ && event.entityPlayer
+ .getDisplayName()
.equals(player.getDisplayName())) {
GL11.glPushMatrix();
GL11.glColor4f(1, 1, 1, 1);
if (Loader.isModLoaded(
"alpaca") /*
- * && fiskfille.alpaca.AlpacaAPI.
- * isAlpacaClient(event.
- * entityPlayer)
- */) {
+ * &&
+ * fiskfille
+ * .
+ * alpaca
+ * .
+ * AlpacaAPI.
+ * isAlpacaClient
+ * (
+ * event.
+ * entityPlayer)
+ */) {
rightArm = body;
- GL11.glTranslatef(0.0F, 0.05F, 0.0F);
- GL11.glRotatef(-30F, 0.0F, 1.0F, 0.0F);
+ GL11.glTranslatef(0.0F,
+ 0.05F,
+ 0.0F);
+ GL11.glRotatef(-30F, 0.0F,
+ 1.0F,
+ 0.0F);
}
if (rightArm.rotateAngleX == 0.0F
&& rightArm.rotateAngleY == 0.0F
&& rightArm.rotateAngleZ == 0.0F) {
- if ((rightArm.rotationPointX + rotAngleX) != 0.0F
+ if ((rightArm.rotationPointX
+ + rotAngleX) != 0.0F
|| (rightArm.rotationPointY
+ rotAngleY) != 0.0F
|| (rightArm.rotationPointZ
+ rotAngleZ) != 0.0F)
GL11.glTranslatef(
- (rightArm.rotationPointX + rotAngleX)
+ (rightArm.rotationPointX
+ + rotAngleX)
* size,
- (rightArm.rotationPointY + rotAngleY)
+ (rightArm.rotationPointY
+ + rotAngleY)
* size,
- (rightArm.rotationPointZ + rotAngleZ)
+ (rightArm.rotationPointZ
+ + rotAngleZ)
* size);
} else if (!Loader.isModLoaded(
"alpaca") /*
- * || (Loader.isModLoaded("alpaca")
- * && fiskfille.alpaca.AlpacaAPI.
- * isAlpacaClient(event.
- * entityPlayer))
- */) {
+ * ||
+ * (Loader
+ * .
+ * isModLoaded
+ * (
+ * "alpaca")
+ * &&
+ * fiskfille
+ * .
+ * alpaca
+ * .
+ * AlpacaAPI.
+ * isAlpacaClient
+ * (
+ * event.
+ * entityPlayer
+ * )
+ * )
+ */) {
GL11.glTranslatef(
- (rightArm.rotationPointX + rotAngleX)
+ (rightArm.rotationPointX
+ + rotAngleX)
* size,
- (rightArm.rotationPointY + rotAngleY)
+ (rightArm.rotationPointY
+ + rotAngleY)
* size,
- (rightArm.rotationPointZ + rotAngleZ)
+ (rightArm.rotationPointZ
+ + rotAngleZ)
* size);
if (rightArm.rotateAngleZ != 0.0F)
- GL11.glRotatef(
- rightArm.rotateAngleZ
- * (180F / (float) Math.PI),
- 0.0F, 0.0F, 1.0F);
+ GL11.glRotatef(rightArm.rotateAngleZ
+ * (180F / (float) Math.PI),
+ 0.0F,
+ 0.0F,
+ 1.0F);
if (rightArm.rotateAngleY != 0.0F)
- GL11.glRotatef(
- rightArm.rotateAngleY
- * (180F / (float) Math.PI),
- 0.0F, 1.0F, 0.0F);
+ GL11.glRotatef(rightArm.rotateAngleY
+ * (180F / (float) Math.PI),
+ 0.0F,
+ 1.0F,
+ 0.0F);
if (rightArm.rotateAngleX != 0.0F)
- GL11.glRotatef(
- rightArm.rotateAngleX
- * (180F / (float) Math.PI),
- 1.0F, 0.0F, 0.0F);
+ GL11.glRotatef(rightArm.rotateAngleX
+ * (180F / (float) Math.PI),
+ 1.0F,
+ 0.0F,
+ 0.0F);
}
GL11.glScalef(0.05f, 0.03f, 0.05f);
- bracelet.doRender(event.entityPlayer,
- (float) ingotColor[0], (float) gemColor[0],
- (float) ingotColor[1], (float) gemColor[1],
+ bracelet.doRender(
+ event.entityPlayer,
+ (float) ingotColor[0],
+ (float) gemColor[0],
+ (float) ingotColor[1],
+ (float) gemColor[1],
0.0F);
GL11.glPopMatrix();
}
- if (playerInfo != null && event.entityPlayer != null
+ if (playerInfo != null
+ && event.entityPlayer != null
&& player != null
- && (playerInfo.hasKey("ext12")
- || playerInfo.hasKey("ext13"))
- && event.entityPlayer.getDisplayName()
+ && (playerInfo.hasKey(
+ "ext12")
+ || playerInfo.hasKey(
+ "ext13"))
+ && event.entityPlayer
+ .getDisplayName()
.equals(player.getDisplayName())) {
GL11.glPushMatrix();
GL11.glColor4f(1, 1, 1, 1);
if (Loader.isModLoaded(
"alpaca") /*
- * && fiskfille.alpaca.AlpacaAPI.
- * isAlpacaClient(event.
- * entityPlayer)
- */) {
+ * &&
+ * fiskfille
+ * .
+ * alpaca
+ * .
+ * AlpacaAPI.
+ * isAlpacaClient
+ * (
+ * event.
+ * entityPlayer)
+ */) {
leftArm = body;
- GL11.glTranslatef(-0.1F, 0.0F, 0.1F);
- GL11.glRotatef(-140F, 0.0F, 1.0F, 0.0F);
+ GL11.glTranslatef(-0.1F,
+ 0.0F,
+ 0.1F);
+ GL11.glRotatef(-140F, 0.0F,
+ 1.0F,
+ 0.0F);
}
if (leftArm.rotateAngleX == 0.0F
&& leftArm.rotateAngleY == 0.0F
&& leftArm.rotateAngleZ == 0.0F) {
- if ((leftArm.rotationPointX + rotAngleX) != 0.0F
+ if ((leftArm.rotationPointX
+ + rotAngleX) != 0.0F
|| (leftArm.rotationPointY
+ rotAngleY) != 0.0F
|| (leftArm.rotationPointZ
+ rotAngleZ) != 0.0F)
GL11.glTranslatef(
- (leftArm.rotationPointX + rotAngleX)
+ (leftArm.rotationPointX
+ + rotAngleX)
* size,
- (leftArm.rotationPointY + rotAngleY)
+ (leftArm.rotationPointY
+ + rotAngleY)
* size,
- (leftArm.rotationPointZ + rotAngleZ)
+ (leftArm.rotationPointZ
+ + rotAngleZ)
* size);
} else if (!Loader.isModLoaded(
"alpaca") /*
- * || (Loader.isModLoaded("alpaca")
- * && !fiskfille.alpaca.AlpacaAPI.
- * isAlpacaClient(event.
- * entityPlayer))
- */) {
+ * ||
+ * (Loader
+ * .
+ * isModLoaded
+ * (
+ * "alpaca")
+ * &&
+ * !fiskfille
+ * .
+ * alpaca
+ * .
+ * AlpacaAPI.
+ * isAlpacaClient
+ * (
+ * event.
+ * entityPlayer
+ * )
+ * )
+ */) {
GL11.glTranslatef(
- (leftArm.rotationPointX + rotAngleX) * size
+ (leftArm.rotationPointX
+ + rotAngleX)
+ * size
+ 0.2F,
- (leftArm.rotationPointY + rotAngleY)
+ (leftArm.rotationPointY
+ + rotAngleY)
* size,
- (leftArm.rotationPointZ + rotAngleZ)
+ (leftArm.rotationPointZ
+ + rotAngleZ)
* size);
if (leftArm.rotateAngleZ != 0.0F)
- GL11.glRotatef(
- leftArm.rotateAngleZ
- * (180F / (float) Math.PI),
- 0.0F, 0.0F, 1.0F);
+ GL11.glRotatef(leftArm.rotateAngleZ
+ * (180F / (float) Math.PI),
+ 0.0F,
+ 0.0F,
+ 1.0F);
if (leftArm.rotateAngleY != 0.0F)
- GL11.glRotatef(
- leftArm.rotateAngleY
- * (180F / (float) Math.PI),
- 0.0F, 1.0F, 0.0F);
+ GL11.glRotatef(leftArm.rotateAngleY
+ * (180F / (float) Math.PI),
+ 0.0F,
+ 1.0F,
+ 0.0F);
if (leftArm.rotateAngleX != 0.0F)
- GL11.glRotatef(
- leftArm.rotateAngleX
- * (180F / (float) Math.PI),
- 1.0F, 0.0F, 0.0F);
+ GL11.glRotatef(leftArm.rotateAngleX
+ * (180F / (float) Math.PI),
+ 1.0F,
+ 0.0F,
+ 0.0F);
}
GL11.glScalef(0.05f, 0.03f, 0.05f);
- bracelet.doRender(event.entityPlayer,
- (float) ingotColor[2], (float) gemColor[2],
- (float) ingotColor[3], (float) gemColor[3],
+ bracelet.doRender(
+ event.entityPlayer,
+ (float) ingotColor[2],
+ (float) gemColor[2],
+ (float) ingotColor[3],
+ (float) gemColor[3],
0F);
GL11.glPopMatrix();
}
no = 0;
for (int i = 14; i <= 16; i++)
- if (playerInfo != null && event.entityPlayer != null
+ if (playerInfo != null
+ && event.entityPlayer != null
&& player != null
- && playerInfo.hasKey("ext" + i)
- && event.entityPlayer.getDisplayName()
+ && playerInfo.hasKey(
+ "ext" + i)
+ && event.entityPlayer
+ .getDisplayName()
.equals(player.getDisplayName())) {
gem = -1;
ingot = -1;
NBTTagCompound nbt = (NBTTagCompound) playerInfo
.getTag("ext" + i);
- ItemStack item =
- ItemStack.loadItemStackFromNBT(nbt);
+ ItemStack item = ItemStack
+ .loadItemStackFromNBT(
+ nbt);
GL11.glPushMatrix();
if (body.rotateAngleX == 0.0F
&& body.rotateAngleY == 0.0F
@@ -351,79 +519,141 @@ public class PlayerRenderHandler { || body.rotationPointY != 0.0F
|| body.rotationPointZ != 0.0F)
GL11.glTranslatef(
- body.rotationPointX * size,
- body.rotationPointY * size,
- body.rotationPointZ * size);
- } else if (!Loader.isModLoaded(
- "alpaca") /*
- * || (Loader.isModLoaded(
- * "alpaca") &&
- * !fiskfille.alpaca.AlpacaAPI.
- * isAlpacaClient(event.
- * entityPlayer))
+ body.rotationPointX
+ * size,
+ body.rotationPointY
+ * size,
+ body.rotationPointZ
+ * size);
+ } else if (!Loader
+ .isModLoaded("alpaca") /*
+ * ||
+ * (Loader
+ * .
+ * isModLoaded(
+ * "alpaca")
+ * &&
+ * !fiskfille
+ * .
+ * alpaca
+ * .
+ * AlpacaAPI.
+ * isAlpacaClient
+ * (
+ * event.
+ * entityPlayer
+ * )
+ * )
*/) {
- GL11.glTranslatef(body.rotationPointX * size,
- body.rotationPointY * size,
- body.rotationPointZ * size);
+ GL11.glTranslatef(
+ body.rotationPointX
+ * size,
+ body.rotationPointY
+ * size,
+ body.rotationPointZ
+ * size);
if (body.rotateAngleZ != 0.0F)
- GL11.glRotatef(
- body.rotateAngleZ
- * (180F / (float) Math.PI),
- 0.0F, 0.0F, 1.0F);
+ GL11.glRotatef(body.rotateAngleZ
+ * (180F / (float) Math.PI),
+ 0.0F,
+ 0.0F,
+ 1.0F);
if (body.rotateAngleY != 0.0F)
- GL11.glRotatef(
- body.rotateAngleY
- * (180F / (float) Math.PI),
- 0.0F, 1.0F, 0.0F);
+ GL11.glRotatef(body.rotateAngleY
+ * (180F / (float) Math.PI),
+ 0.0F,
+ 1.0F,
+ 0.0F);
if (body.rotateAngleX != 0.0F)
- GL11.glRotatef(
- body.rotateAngleX
- * (180F / (float) Math.PI),
- 1.0F, 0.0F, 0.0F);
+ GL11.glRotatef(body.rotateAngleX
+ * (180F / (float) Math.PI),
+ 1.0F,
+ 0.0F,
+ 0.0F);
}
if (Loader.isModLoaded(
"alpaca") /*
- * &&
- * fiskfille.alpaca.AlpacaAPI.
- * isAlpacaClient(event.
- * entityPlayer)
- */)
- GL11.glTranslatef(0.0F, 0.55F, -0.28F);
- GL11.glScalef(0.0625f, 0.0625f, 0.0625f);
- if (JewelryNBT.ingot(item) != null)
+ * &&
+ * fiskfille
+ * .
+ * alpaca
+ * .
+ * AlpacaAPI.
+ * isAlpacaClient
+ * (
+ * event.
+ * entityPlayer)
+ */)
+ GL11.glTranslatef(
+ 0.0F,
+ 0.55F,
+ -0.28F);
+ GL11.glScalef(0.0625f,
+ 0.0625f,
+ 0.0625f);
+ if (JewelryNBT.ingot(
+ item) != null)
ingot = JewelrycraftUtil
- .getColor(JewelryNBT.ingot(item));
- if (JewelryNBT.gem(item) != null)
+ .getColor(JewelryNBT
+ .ingot(item));
+ if (JewelryNBT.gem(
+ item) != null)
gem = JewelrycraftUtil
- .getColor(JewelryNBT.gem(item));
+ .getColor(JewelryNBT
+ .gem(item));
if (no > 0) {
- GL11.glRotatef(no == 1 ? 25f : -25f, 0F, 0f,
+ GL11.glRotatef(no == 1
+ ? 25f
+ : -25f,
+ 0F,
+ 0f,
1f);
- GL11.glRotatef(no == 1 ? -5f : -10f, 1F, 0f,
+ GL11.glRotatef(no == 1
+ ? -5f
+ : -10f,
+ 1F,
+ 0f,
0f);
}
- necklace.doRender(event.entityPlayer, 0F, 0F,
- (float) ingot, (float) gem, 0F);
+ necklace.doRender(
+ event.entityPlayer,
+ 0F, 0F,
+ (float) ingot,
+ (float) gem,
+ 0F);
GL11.glPopMatrix();
no++;
}
- if (playerInfo != null && event.entityPlayer != null
- && player != null && playerInfo.hasKey("ext17")
- && event.entityPlayer.getDisplayName()
+ if (playerInfo != null
+ && event.entityPlayer != null
+ && player != null
+ && playerInfo.hasKey(
+ "ext17")
+ && event.entityPlayer
+ .getDisplayName()
.equals(player.getDisplayName())) {
gem = -1;
ingot = -1;
- NBTTagCompound nbt =
- (NBTTagCompound) playerInfo.getTag("ext17");
- ItemStack item = ItemStack.loadItemStackFromNBT(nbt);
+ NBTTagCompound nbt = (NBTTagCompound) playerInfo
+ .getTag("ext17");
+ ItemStack item = ItemStack
+ .loadItemStackFromNBT(
+ nbt);
GL11.glPushMatrix();
float s = 0.0625F;
if (Loader.isModLoaded(
"alpaca") /*
- * && fiskfille.alpaca.AlpacaAPI.
- * isAlpacaClient(event.
- * entityPlayer)
- */)
+ * &&
+ * fiskfille
+ * .
+ * alpaca
+ * .
+ * AlpacaAPI.
+ * isAlpacaClient
+ * (
+ * event.
+ * entityPlayer)
+ */)
head = body;
if (head.rotateAngleX == 0.0F
&& head.rotateAngleY == 0.0F
@@ -431,52 +661,92 @@ public class PlayerRenderHandler { if (head.rotationPointX != 0.0F
|| head.rotationPointY != 0.0F
|| head.rotationPointZ != 0.0F)
- GL11.glTranslatef(head.rotationPointX * size,
- head.rotationPointY * size,
- head.rotationPointZ * size);
+ GL11.glTranslatef(
+ head.rotationPointX
+ * size,
+ head.rotationPointY
+ * size,
+ head.rotationPointZ
+ * size);
} else if (!Loader.isModLoaded(
"alpaca") /*
- * || (Loader.isModLoaded("alpaca")
- * && !fiskfille.alpaca.AlpacaAPI.
- * isAlpacaClient(event.
- * entityPlayer))
- */) {
- GL11.glTranslatef(head.rotationPointX * size,
- head.rotationPointY * size,
- head.rotationPointZ * size);
+ * ||
+ * (Loader
+ * .
+ * isModLoaded
+ * (
+ * "alpaca")
+ * &&
+ * !fiskfille
+ * .
+ * alpaca
+ * .
+ * AlpacaAPI.
+ * isAlpacaClient
+ * (
+ * event.
+ * entityPlayer
+ * )
+ * )
+ */) {
+ GL11.glTranslatef(
+ head.rotationPointX
+ * size,
+ head.rotationPointY
+ * size,
+ head.rotationPointZ
+ * size);
if (head.rotateAngleZ != 0.0F)
- GL11.glRotatef(
- head.rotateAngleZ
- * (180F / (float) Math.PI),
- 0.0F, 0.0F, 1.0F);
+ GL11.glRotatef(head.rotateAngleZ
+ * (180F / (float) Math.PI),
+ 0.0F,
+ 0.0F,
+ 1.0F);
if (head.rotateAngleY != 0.0F)
- GL11.glRotatef(
- head.rotateAngleY
- * (180F / (float) Math.PI),
- 0.0F, 1.0F, 0.0F);
+ GL11.glRotatef(head.rotateAngleY
+ * (180F / (float) Math.PI),
+ 0.0F,
+ 1.0F,
+ 0.0F);
if (head.rotateAngleX != 0.0F)
- GL11.glRotatef(
- head.rotateAngleX
- * (180F / (float) Math.PI),
- 1.0F, 0.0F, 0.0F);
+ GL11.glRotatef(head.rotateAngleX
+ * (180F / (float) Math.PI),
+ 1.0F,
+ 0.0F,
+ 0.0F);
}
if (Loader.isModLoaded(
"alpaca") /*
- * && fiskfille.alpaca.AlpacaAPI.
- * isAlpacaClient(event.
- * entityPlayer)
- */)
- GL11.glTranslatef(0.0F, 0.7F, -0.2F);
+ * &&
+ * fiskfille
+ * .
+ * alpaca
+ * .
+ * AlpacaAPI.
+ * isAlpacaClient
+ * (
+ * event.
+ * entityPlayer)
+ */)
+ GL11.glTranslatef(0.0F,
+ 0.7F,
+ -0.2F);
GL11.glScalef(s, s, s);
- GL11.glTranslatef(0.0F, 1.0F, -2.0F);
+ GL11.glTranslatef(0.0F, 1.0F,
+ -2.0F);
if (JewelryNBT.ingot(item) != null)
ingot = JewelrycraftUtil
- .getColor(JewelryNBT.ingot(item));
+ .getColor(JewelryNBT
+ .ingot(item));
if (JewelryNBT.gem(item) != null)
gem = JewelrycraftUtil
- .getColor(JewelryNBT.gem(item));
- earrings.doRender(event.entityPlayer, 0F, 0F,
- (float) ingot, (float) gem, 0F);
+ .getColor(JewelryNBT
+ .gem(item));
+ earrings.doRender(
+ event.entityPlayer,
+ 0F, 0F,
+ (float) ingot,
+ (float) gem, 0F);
GL11.glPopMatrix();
}
}
@@ -489,21 +759,29 @@ public class PlayerRenderHandler { @SubscribeEvent
public void renderHand(RenderHandEvent event) {
if (playersInfo != null) {
- EntityPlayer player = Minecraft.getMinecraft().thePlayer;
+ EntityPlayer player = Minecraft
+ .getMinecraft().thePlayer;
if (player != null) {
NBTTagCompound playerInfo = (NBTTagCompound) playersInfo
.getTag(player.getDisplayName());
if (ConfigHandler.CURSES_ENABLED)
- for (Curse curse : Curse.getCurseList())
- if (curse.canCurseBeActivated(player.worldObj)
- && curse != null && playerInfo != null
- && playerInfo.hasKey(curse.getName())
- && playerInfo
- .getInteger(curse.getName()) > 0
- && playerInfo.hasKey("cursePoints")
- && playerInfo
- .getInteger("cursePoints") > 0)
- curse.playerHandRender(player, event);
+ for (Curse curse : Curse
+ .getCurseList())
+ if (curse.canCurseBeActivated(
+ player.worldObj)
+ && curse != null
+ && playerInfo != null
+ && playerInfo.hasKey(
+ curse.getName())
+ && playerInfo.getInteger(
+ curse.getName()) > 0
+ && playerInfo.hasKey(
+ "cursePoints")
+ && playerInfo.getInteger(
+ "cursePoints") > 0)
+ curse.playerHandRender(
+ player,
+ event);
}
}
}
diff --git a/src/main/java/darkknight/jewelrycraft/events/ScreenHandler.java b/src/main/java/darkknight/jewelrycraft/events/ScreenHandler.java index cf02d9e..9df771d 100755 --- a/src/main/java/darkknight/jewelrycraft/events/ScreenHandler.java +++ b/src/main/java/darkknight/jewelrycraft/events/ScreenHandler.java @@ -13,9 +13,9 @@ import net.minecraftforge.client.event.RenderGameOverlayEvent; import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType;
public class ScreenHandler extends Gui {
- private Minecraft mc;
+ private Minecraft mc;
public static NBTTagCompound tagCache = null;
- public static int cooldown;
+ public static int cooldown;
public ScreenHandler(Minecraft mc) {
super();
@@ -38,59 +38,78 @@ public class ScreenHandler extends Gui { size = 16;
if (tagCache.getFloat("BlueHeart") > 0) {
drawTexturedModalRect(
- resolution.getScaledWidth() / 2 + 90 + 35 * count,
- resolution.getScaledHeight() - 40, 0 * size, 0 * size,
- size, size);
- mc.fontRenderer.drawStringWithShadow(
- "x" + (MathHelper.ceiling_float_int(
- tagCache.getFloat("BlueHeart")) / 2.0F),
- resolution.getScaledWidth() / 2 + 105 + 35 * count,
- resolution.getScaledHeight() - 36, 16777215);
+ resolution.getScaledWidth() / 2
+ + 90 + 35 * count,
+ resolution.getScaledHeight() - 40,
+ 0 * size, 0 * size, size, size);
+ mc.fontRenderer.drawStringWithShadow("x"
+ + (MathHelper.ceiling_float_int(
+ tagCache.getFloat(
+ "BlueHeart"))
+ / 2.0F),
+ resolution.getScaledWidth() / 2
+ + 105 + 35 * count,
+ resolution.getScaledHeight() - 36,
+ 16777215);
}
count++;
mc.renderEngine.bindTexture(Variables.MISC_TEXTURE);
if (tagCache.getFloat("BlackHeart") > 0) {
- drawTexturedModalRect(
- resolution.getScaledWidth() / 2 + 90
- + (mc.fontRenderer.getStringWidth(String
- .valueOf((MathHelper.ceiling_float_int(
- tagCache.getFloat("BlueHeart"))
- / 2.0F)))
- - 14)
- + 35 * count,
- resolution.getScaledHeight() - 40, 1 * size, 0 * size,
- size, size);
- mc.fontRenderer.drawStringWithShadow(
- "x" + (MathHelper.ceiling_float_int(
- tagCache.getFloat("BlackHeart")) / 2.0F),
- resolution.getScaledWidth() / 2 + 105
- + (mc.fontRenderer.getStringWidth(String
- .valueOf((MathHelper.ceiling_float_int(
- tagCache.getFloat("BlueHeart"))
- / 2.0F)))
+ drawTexturedModalRect(resolution.getScaledWidth()
+ / 2
+ + 90
+ + (mc.fontRenderer.getStringWidth(
+ String.valueOf((MathHelper
+ .ceiling_float_int(
+ tagCache.getFloat(
+ "BlueHeart"))
+ / 2.0F)))
+ - 14)
+ + 35 * count,
+ resolution.getScaledHeight() - 40,
+ 1 * size, 0 * size, size, size);
+ mc.fontRenderer.drawStringWithShadow("x"
+ + (MathHelper.ceiling_float_int(
+ tagCache.getFloat(
+ "BlackHeart"))
+ / 2.0F),
+ resolution.getScaledWidth() / 2
+ + 105
+ + (mc.fontRenderer
+ .getStringWidth(String
+ .valueOf((MathHelper
+ .ceiling_float_int(
+ tagCache.getFloat(
+ "BlueHeart"))
+ / 2.0F)))
- 14)
+ 35 * count,
- resolution.getScaledHeight() - 36, 16777215);
+ resolution.getScaledHeight() - 36,
+ 16777215);
}
count++;
mc.renderEngine.bindTexture(Variables.MISC_TEXTURE);
if (tagCache.getFloat("WhiteHeart") > 0)
- drawTexturedModalRect(
- resolution.getScaledWidth() / 2 + 90
- + (mc.fontRenderer.getStringWidth(String
- .valueOf((MathHelper.ceiling_float_int(
- tagCache.getFloat("BlueHeart"))
- / 2.0F)))
- - 14)
- + (mc.fontRenderer.getStringWidth(String
- .valueOf((MathHelper.ceiling_float_int(
+ drawTexturedModalRect(resolution.getScaledWidth()
+ / 2
+ + 90
+ + (mc.fontRenderer.getStringWidth(
+ String.valueOf((MathHelper
+ .ceiling_float_int(
+ tagCache.getFloat(
+ "BlueHeart"))
+ / 2.0F)))
+ - 14)
+ + (mc.fontRenderer.getStringWidth(
+ String.valueOf((MathHelper
+ .ceiling_float_int(
tagCache.getFloat(
"BlackHeart"))
- / 2.0F)))
- - 14)
- + 35 * count,
- resolution.getScaledHeight() - 40, 2 * size, 1 * size,
- size, size);
+ / 2.0F)))
+ - 14)
+ + 35 * count,
+ resolution.getScaledHeight() - 40,
+ 2 * size, 1 * size, size, size);
GL11.glPopMatrix();
}
}
\ No newline at end of file diff --git a/src/main/java/darkknight/jewelrycraft/events/TextureEvent.java b/src/main/java/darkknight/jewelrycraft/events/TextureEvent.java index 9ab9958..0fed13f 100755 --- a/src/main/java/darkknight/jewelrycraft/events/TextureEvent.java +++ b/src/main/java/darkknight/jewelrycraft/events/TextureEvent.java @@ -11,7 +11,9 @@ public class TextureEvent { @SideOnly(Side.CLIENT) public void textureFix(TextureStitchEvent.Post e) { if (e.map.getTextureType() == 0) - BlockList.moltenMetalFluid.setIcons( - BlockList.moltenMetal.getBlockTextureFromSide(0)); + BlockList.moltenMetalFluid + .setIcons(BlockList.moltenMetal + .getBlockTextureFromSide( + 0)); } }
\ No newline at end of file diff --git a/src/main/java/darkknight/jewelrycraft/item/ItemBaseJewelry.java b/src/main/java/darkknight/jewelrycraft/item/ItemBaseJewelry.java index 93328c8..2c2311c 100755 --- a/src/main/java/darkknight/jewelrycraft/item/ItemBaseJewelry.java +++ b/src/main/java/darkknight/jewelrycraft/item/ItemBaseJewelry.java @@ -36,13 +36,16 @@ public abstract class ItemBaseJewelry extends Item { @SideOnly(Side.CLIENT)
public int getColorFromItemStack(ItemStack stack, int pass) {
if (pass == 0 && JewelryNBT.ingot(stack) != null) {
- return JewelrycraftUtil.getColor(JewelryNBT.ingot(stack));
+ return JewelrycraftUtil
+ .getColor(JewelryNBT.ingot(stack));
}
if (pass == 1 && JewelryNBT.gem(stack) != null) {
- return JewelrycraftUtil.getColor(JewelryNBT.gem(stack));
+ return JewelrycraftUtil
+ .getColor(JewelryNBT.gem(stack));
} else if (JewelryNBT.ingot(stack) != null) {
- return JewelrycraftUtil.getColor(JewelryNBT.ingot(stack));
+ return JewelrycraftUtil
+ .getColor(JewelryNBT.ingot(stack));
}
return 16777215;
@@ -54,16 +57,19 @@ public abstract class ItemBaseJewelry extends Item { */
@Override
public String getItemStackDisplayName(ItemStack stack) {
- if (JewelryNBT.ingot(stack) != null && Item
- .getIdFromItem(JewelryNBT.ingot(stack).getItem()) > 0)
+ if (JewelryNBT.ingot(stack) != null && Item.getIdFromItem(
+ JewelryNBT.ingot(stack).getItem()) > 0)
return JewelryNBT.ingot(stack).getDisplayName()
.replace("Ingot", " ").trim()
+ " "
- + ("" + StatCollector.translateToLocal(
- getUnlocalizedNameInefficiently(stack)
- + ".name")).trim();
+ + ("" + StatCollector
+ .translateToLocal(
+ getUnlocalizedNameInefficiently(
+ stack)
+ + ".name")).trim();
return ("" + StatCollector.translateToLocal(
- getUnlocalizedNameInefficiently(stack) + ".name")).trim();
+ getUnlocalizedNameInefficiently(stack)
+ + ".name")).trim();
}
/**
@@ -80,33 +86,45 @@ public abstract class ItemBaseJewelry extends Item { List list, boolean par4) {
if (stack.hasTagCompound() && ConfigHandler.JEWELRY_INFO) {
ItemStack ingot = JewelryNBT.ingot(stack);
- if (ingot != null && Item.getIdFromItem(
- JewelryNBT.ingot(stack).getItem()) > 0) {
+ if (ingot != null && Item.getIdFromItem(JewelryNBT
+ .ingot(stack).getItem()) > 0) {
list.add(StatCollector.translateToLocal(
- "info." + Variables.MODID + ".metal") + ": "
+ "info." + Variables.MODID
+ + ".metal")
+ + ": "
+ EnumChatFormatting.YELLOW
- + ingot.getDisplayName().replace(
- StatCollector.translateToLocal("info."
- + Variables.MODID + ".ingot"),
- " "));
+ + ingot.getDisplayName()
+ .replace(StatCollector
+ .translateToLocal(
+ "info." + Variables.MODID
+ + ".ingot"),
+ " "));
}
ItemStack gem = JewelryNBT.gem(stack);
if (gem != null) {
list.add(StatCollector.translateToLocal(
- "info." + Variables.MODID + ".gem") + ": "
- + EnumChatFormatting.BLUE + gem.getDisplayName());
+ "info." + Variables.MODID
+ + ".gem")
+ + ": "
+ + EnumChatFormatting.BLUE
+ + gem.getDisplayName());
}
- ArrayList<ItemStack> modifier = JewelryNBT.modifier(stack);
+ ArrayList<ItemStack> modifier = JewelryNBT
+ .modifier(stack);
if (!modifier.isEmpty())
list.add(StatCollector.translateToLocal(
- "info." + Variables.MODID + ".modifiers") + ": ");
+ "info." + Variables.MODID
+ + ".modifiers")
+ + ": ");
for (int i = 0; i < modifier.size(); i++)
list.add(EnumChatFormatting.DARK_PURPLE
- + modifier.get(i).getDisplayName() + " x"
+ + modifier.get(i)
+ .getDisplayName()
+ + " x"
+ modifier.get(i).stackSize);
}
}
@@ -117,7 +135,8 @@ public abstract class ItemBaseJewelry extends Item { */
public void action(ItemStack item, EntityPlayer player) {
for (ModifierEffects mod : ModifierEffects.getEffects())
- if (JewelryNBT.doesModifierExist(item, mod.getModifier()))
+ if (JewelryNBT.doesModifierExist(item,
+ mod.getModifier()))
mod.action(item, player, this);
}
@@ -128,11 +147,14 @@ public abstract class ItemBaseJewelry extends Item { * @return
*/
public boolean onPlayerAttackedCacellable(ItemStack item,
- EntityPlayer player, DamageSource source, float amount) {
+ EntityPlayer player, DamageSource source,
+ float amount) {
for (ModifierEffects mod : ModifierEffects.getEffects())
- if (JewelryNBT.doesModifierExist(item, mod.getModifier()))
- return mod.onPlayerAttackedCancellable(item, player,
- source, this, amount);
+ if (JewelryNBT.doesModifierExist(item,
+ mod.getModifier()))
+ return mod.onPlayerAttackedCancellable(
+ item, player, source, this,
+ amount);
return false;
}
@@ -145,9 +167,11 @@ public abstract class ItemBaseJewelry extends Item { public boolean onEntityAttackedCacellable(ItemStack item,
EntityPlayer player, Entity target, float amount) {
for (ModifierEffects mod : ModifierEffects.getEffects())
- if (JewelryNBT.doesModifierExist(item, mod.getModifier()))
- return mod.onEntityAttackedCancellable(item, player,
- target, this, amount);
+ if (JewelryNBT.doesModifierExist(item,
+ mod.getModifier()))
+ return mod.onEntityAttackedCancellable(
+ item, player, target, this,
+ amount);
return false;
}
@@ -160,8 +184,10 @@ public abstract class ItemBaseJewelry extends Item { public void onPlayerAttacked(ItemStack item, EntityPlayer player,
DamageSource source, float amount) {
for (ModifierEffects mod : ModifierEffects.getEffects())
- if (JewelryNBT.doesModifierExist(item, mod.getModifier()))
- mod.onPlayerAttacked(item, player, source, this, amount);
+ if (JewelryNBT.doesModifierExist(item,
+ mod.getModifier()))
+ mod.onPlayerAttacked(item, player, source,
+ this, amount);
}
/**
@@ -173,32 +199,40 @@ public abstract class ItemBaseJewelry extends Item { public void onEntityAttacked(ItemStack item, EntityPlayer player,
Entity target, float amount) {
for (ModifierEffects mod : ModifierEffects.getEffects())
- if (JewelryNBT.doesModifierExist(item, mod.getModifier()))
- mod.onEntityAttacked(item, player, target, this, amount);
+ if (JewelryNBT.doesModifierExist(item,
+ mod.getModifier()))
+ mod.onEntityAttacked(item, player, target,
+ this, amount);
}
public void onPlayerDead(ItemStack item, EntityPlayer player,
DamageSource source) {
for (ModifierEffects mod : ModifierEffects.getEffects())
- if (JewelryNBT.doesModifierExist(item, mod.getModifier()))
- mod.onPlayerDead(item, player, source, this);
+ if (JewelryNBT.doesModifierExist(item,
+ mod.getModifier()))
+ mod.onPlayerDead(item, player, source,
+ this);
}
- public void onPlayerRespawn(ItemStack item, PlayerEvent.Clone event) {
+ public void onPlayerRespawn(ItemStack item,
+ PlayerEvent.Clone event) {
for (ModifierEffects mod : ModifierEffects.getEffects())
- if (JewelryNBT.doesModifierExist(item, mod.getModifier()))
+ if (JewelryNBT.doesModifierExist(item,
+ mod.getModifier()))
mod.onPlayerRespawn(item, event, this);
}
public void onJewelryEquipped(ItemStack item) {
for (ModifierEffects mod : ModifierEffects.getEffects())
- if (JewelryNBT.doesModifierExist(item, mod.getModifier()))
+ if (JewelryNBT.doesModifierExist(item,
+ mod.getModifier()))
mod.onJewelryEquipped(item, this);
}
public void onJewelryUnequipped(ItemStack item) {
for (ModifierEffects mod : ModifierEffects.getEffects())
- if (JewelryNBT.doesModifierExist(item, mod.getModifier()))
+ if (JewelryNBT.doesModifierExist(item,
+ mod.getModifier()))
mod.onJewelryUnequipped(item, this);
}
}
diff --git a/src/main/java/darkknight/jewelrycraft/item/ItemBracelet.java b/src/main/java/darkknight/jewelrycraft/item/ItemBracelet.java index 5508b9c..2de324a 100755 --- a/src/main/java/darkknight/jewelrycraft/item/ItemBracelet.java +++ b/src/main/java/darkknight/jewelrycraft/item/ItemBracelet.java @@ -20,10 +20,10 @@ public class ItemBracelet extends ItemBaseJewelry { */
@Override
public void registerIcons(IIconRegister iconRegister) {
- itemIcon =
- iconRegister.registerIcon(Variables.MODID + ":bracelet");
- gem = iconRegister
- .registerIcon(Variables.MODID + ":jewelBracelet");
+ itemIcon = iconRegister.registerIcon(
+ Variables.MODID + ":bracelet");
+ gem = iconRegister.registerIcon(
+ Variables.MODID + ":jewelBracelet");
}
/**
diff --git a/src/main/java/darkknight/jewelrycraft/item/ItemClayMolds.java b/src/main/java/darkknight/jewelrycraft/item/ItemClayMolds.java index 9bc630a..10929bd 100755 --- a/src/main/java/darkknight/jewelrycraft/item/ItemClayMolds.java +++ b/src/main/java/darkknight/jewelrycraft/item/ItemClayMolds.java @@ -14,11 +14,12 @@ import net.minecraft.util.MathHelper; public class ItemClayMolds extends Item {
/** List of molds color names */
- public static final String[] moldsItemNames =
- new String[] { "clayIngot", "clayRing", "clayNecklace",
- "clayBracelet", "clayEarrings" };
+ public static final String[] moldsItemNames = new String[] {
+ "clayIngot", "clayRing", "clayNecklace",
+ "clayBracelet", "clayEarrings"
+ };
@SideOnly(Side.CLIENT)
- private IIcon[] moldsIcons;
+ private IIcon[] moldsIcons;
/**
*
@@ -40,23 +41,25 @@ public class ItemClayMolds extends Item { * Gets an icon index based on an item's damage value
*/
public IIcon getIconFromDamage(int par1) {
- int j = MathHelper.clamp_int(par1, 0, moldsItemNames.length - 1);
+ int j = MathHelper.clamp_int(par1, 0,
+ moldsItemNames.length - 1);
return moldsIcons[j];
}
/**
- * Returns the unlocalized name of this item. This version accepts an
- * ItemStack so different stacks can have different names based on
- * their damage or NBT.
+ * Returns the unlocalized name of this item. This version accepts
+ * an ItemStack so different stacks can have different names based
+ * on their damage or NBT.
*
* @param par1ItemStack
* @return
*/
@Override
public String getUnlocalizedName(ItemStack par1ItemStack) {
- int i = MathHelper.clamp_int(par1ItemStack.getItemDamage(), 0,
- moldsItemNames.length - 1);
- return super.getUnlocalizedName() + "." + moldsItemNames[i];
+ int i = MathHelper.clamp_int(par1ItemStack.getItemDamage(),
+ 0, moldsItemNames.length - 1);
+ return super.getUnlocalizedName() + "."
+ + moldsItemNames[i];
}
/**
@@ -67,8 +70,8 @@ public class ItemClayMolds extends Item { @Override
@SideOnly(Side.CLIENT)
/**
- * returns a list of items with the same ID, but different meta (eg:
- * molds returns 16 items)
+ * returns a list of items with the same ID, but different meta
+ * (eg: molds returns 16 items)
*/
public void getSubItems(Item par1, CreativeTabs par2CreativeTabs,
List par3List) {
@@ -84,7 +87,9 @@ public class ItemClayMolds extends Item { public void registerIcons(IIconRegister par1IconRegister) {
moldsIcons = new IIcon[moldsItemNames.length];
for (int i = 0; i < moldsItemNames.length; ++i)
- moldsIcons[i] = par1IconRegister.registerIcon(Variables.MODID
- + ":" + moldsItemNames[i] + getIconString());
+ moldsIcons[i] = par1IconRegister
+ .registerIcon(Variables.MODID + ":"
+ + moldsItemNames[i]
+ + getIconString());
}
}
diff --git a/src/main/java/darkknight/jewelrycraft/item/ItemEarrings.java b/src/main/java/darkknight/jewelrycraft/item/ItemEarrings.java index 0081342..c9e84f4 100755 --- a/src/main/java/darkknight/jewelrycraft/item/ItemEarrings.java +++ b/src/main/java/darkknight/jewelrycraft/item/ItemEarrings.java @@ -20,10 +20,10 @@ public class ItemEarrings extends ItemBaseJewelry { */
@Override
public void registerIcons(IIconRegister iconRegister) {
- itemIcon =
- iconRegister.registerIcon(Variables.MODID + ":earrings");
- gem = iconRegister
- .registerIcon(Variables.MODID + ":jewelEarrings");
+ itemIcon = iconRegister.registerIcon(
+ Variables.MODID + ":earrings");
+ gem = iconRegister.registerIcon(
+ Variables.MODID + ":jewelEarrings");
}
/**
diff --git a/src/main/java/darkknight/jewelrycraft/item/ItemGoldObj.java b/src/main/java/darkknight/jewelrycraft/item/ItemGoldObj.java index 86f864d..331fd65 100755 --- a/src/main/java/darkknight/jewelrycraft/item/ItemGoldObj.java +++ b/src/main/java/darkknight/jewelrycraft/item/ItemGoldObj.java @@ -58,15 +58,19 @@ public class ItemGoldObj extends Item { public String getItemStackDisplayName(ItemStack stack) {
if (stack != null && stack.hasTagCompound()
&& stack.getTagCompound().hasKey("target")
- && Item.getItemById(Integer.valueOf(stack.getTagCompound()
- .getTag("target").toString().split(",")[0]
- .substring(4).replace("s", ""))) != null
+ && Item.getItemById(Integer.valueOf(stack
+ .getTagCompound()
+ .getTag("target")
+ .toString().split(",")[0]
+ .substring(4)
+ .replace("s", ""))) != null
&& JewelryNBT.item(stack) != null)
- return StatCollector.translateToLocal(
- "info." + Variables.MODID + ".golden") + " "
- + JewelryNBT.item(stack).getDisplayName();
- return StatCollector.translateToLocal(
- "item." + Variables.MODID + ".goldObject.name");
+ return StatCollector.translateToLocal("info."
+ + Variables.MODID + ".golden")
+ + " " + JewelryNBT.item(stack)
+ .getDisplayName();
+ return StatCollector.translateToLocal("item."
+ + Variables.MODID + ".goldObject.name");
}
@Override
@@ -76,12 +80,14 @@ public class ItemGoldObj extends Item { if (stack != null && JewelryNBT.item(stack) != null
&& JewelryNBT.item(stack)
.getItem() instanceof ItemFood)
- list.add(EnumChatFormatting.DARK_PURPLE + StatCollector
- .translateToLocal("item." + Variables.MODID
- + ".goldObject.info.food"));
+ list.add(EnumChatFormatting.DARK_PURPLE
+ + StatCollector.translateToLocal(
+ "item." + Variables.MODID
+ + ".goldObject.info.food"));
else
- list.add(EnumChatFormatting.DARK_PURPLE + StatCollector
- .translateToLocal("item." + Variables.MODID
- + ".goldObject.info.standard"));
+ list.add(EnumChatFormatting.DARK_PURPLE
+ + StatCollector.translateToLocal(
+ "item." + Variables.MODID
+ + ".goldObject.info.standard"));
}
}
diff --git a/src/main/java/darkknight/jewelrycraft/item/ItemGuide.java b/src/main/java/darkknight/jewelrycraft/item/ItemGuide.java index 6780714..83f8531 100755 --- a/src/main/java/darkknight/jewelrycraft/item/ItemGuide.java +++ b/src/main/java/darkknight/jewelrycraft/item/ItemGuide.java @@ -16,8 +16,8 @@ public class ItemGuide extends Item { public ItemStack onItemRightClick(ItemStack stack, World world,
EntityPlayer player) {
if (world.isRemote)
- player.openGui(JewelrycraftMod.instance, 1, player.worldObj, 0,
- 0, 0);
+ player.openGui(JewelrycraftMod.instance, 1,
+ player.worldObj, 0, 0, 0);
player.addStat(AchievementsList.openGuide, 1);
return stack;
}
diff --git a/src/main/java/darkknight/jewelrycraft/item/ItemJewelryModifier.java b/src/main/java/darkknight/jewelrycraft/item/ItemJewelryModifier.java index b295ebe..481126f 100755 --- a/src/main/java/darkknight/jewelrycraft/item/ItemJewelryModifier.java +++ b/src/main/java/darkknight/jewelrycraft/item/ItemJewelryModifier.java @@ -18,7 +18,8 @@ public class ItemJewelryModifier extends Item { public ItemStack onItemRightClick(ItemStack stack, World world,
EntityPlayer player) {
if (!world.isRemote && player.capabilities.isCreativeMode)
- player.openGui(JewelrycraftMod.instance, 3, world, 0, 0, 0);
+ player.openGui(JewelrycraftMod.instance, 3, world,
+ 0, 0, 0);
return stack;
}
diff --git a/src/main/java/darkknight/jewelrycraft/item/ItemList.java b/src/main/java/darkknight/jewelrycraft/item/ItemList.java index f83983e..63bc7a4 100755 --- a/src/main/java/darkknight/jewelrycraft/item/ItemList.java +++ b/src/main/java/darkknight/jewelrycraft/item/ItemList.java @@ -9,82 +9,103 @@ import net.minecraft.item.ItemStack; import net.minecraftforge.oredict.OreDictionary;
public class ItemList {
- public static Item thiefGloves;
- public static Item shadowIngot;
- public static Item molds;
- public static Item clayMolds;
- public static ItemRing ring;
- public static ItemNecklace necklace;
- public static ItemBracelet bracelet;
- public static ItemEarrings earrings;
- public static Item guide;
- public static Item jewelryModifier;
+ public static Item thiefGloves;
+ public static Item shadowIngot;
+ public static Item molds;
+ public static Item clayMolds;
+ public static ItemRing ring;
+ public static ItemNecklace necklace;
+ public static ItemBracelet bracelet;
+ public static ItemEarrings earrings;
+ public static Item guide;
+ public static Item jewelryModifier;
public static ItemMoltenMetalBucket bucket;
public static ItemMoltenMetal metal;
- public static Item goldObj;
- public static Item structureGen;
- public static Item spawnEgg;
- public static Item testItem;
+ public static Item goldObj;
+ public static Item structureGen;
+ public static Item spawnEgg;
+ public static Item testItem;
/**
* @param e
*/
public static void preInit(FMLPreInitializationEvent e) {
thiefGloves = new ItemThiefGloves()
- .setUnlocalizedName(Variables.MODID + ".thiefGloves")
- .setTextureName(Variables.MODID + ":thiefGloves")
+ .setUnlocalizedName(Variables.MODID
+ + ".thiefGloves")
+ .setTextureName(Variables.MODID
+ + ":thiefGloves")
.setCreativeTab(JewelrycraftMod.jewelrycraft);
shadowIngot = new Item()
- .setUnlocalizedName(Variables.MODID + ".ingotShadow")
- .setTextureName(Variables.MODID + ":ingotShadow")
+ .setUnlocalizedName(Variables.MODID
+ + ".ingotShadow")
+ .setTextureName(Variables.MODID
+ + ":ingotShadow")
.setCreativeTab(JewelrycraftMod.jewelrycraft);
molds = new ItemMolds()
- .setUnlocalizedName(Variables.MODID + ".mold")
+ .setUnlocalizedName(
+ Variables.MODID + ".mold")
.setTextureName("Mold")
.setCreativeTab(JewelrycraftMod.jewelrycraft);
clayMolds = new ItemClayMolds()
- .setUnlocalizedName(Variables.MODID + ".mold")
+ .setUnlocalizedName(
+ Variables.MODID + ".mold")
.setTextureName("Mold")
.setCreativeTab(JewelrycraftMod.jewelrycraft);
ring = (ItemRing) new ItemRing()
- .setUnlocalizedName(Variables.MODID + ".ring")
+ .setUnlocalizedName(
+ Variables.MODID + ".ring")
.setTextureName(Variables.MODID + ":ring")
.setCreativeTab(JewelrycraftMod.jewelrycraft);
necklace = (ItemNecklace) new ItemNecklace()
- .setUnlocalizedName(Variables.MODID + ".necklace")
- .setTextureName(Variables.MODID + ":necklace")
+ .setUnlocalizedName(Variables.MODID
+ + ".necklace")
+ .setTextureName(Variables.MODID
+ + ":necklace")
.setCreativeTab(JewelrycraftMod.jewelrycraft);
bracelet = (ItemBracelet) new ItemBracelet()
- .setUnlocalizedName(Variables.MODID + ".bracelet")
- .setTextureName(Variables.MODID + ":bracelet")
+ .setUnlocalizedName(Variables.MODID
+ + ".bracelet")
+ .setTextureName(Variables.MODID
+ + ":bracelet")
.setCreativeTab(JewelrycraftMod.jewelrycraft);
earrings = (ItemEarrings) new ItemEarrings()
- .setUnlocalizedName(Variables.MODID + ".earrings")
- .setTextureName(Variables.MODID + ":earrings")
+ .setUnlocalizedName(Variables.MODID
+ + ".earrings")
+ .setTextureName(Variables.MODID
+ + ":earrings")
.setCreativeTab(JewelrycraftMod.jewelrycraft);
guide = new ItemGuide()
- .setUnlocalizedName(Variables.MODID + ".guide")
+ .setUnlocalizedName(
+ Variables.MODID + ".guide")
.setTextureName(Variables.MODID + ":guide")
.setCreativeTab(JewelrycraftMod.jewelrycraft);
bucket = (ItemMoltenMetalBucket) new ItemMoltenMetalBucket()
- .setUnlocalizedName(Variables.MODID + ".bucket");
+ .setUnlocalizedName(Variables.MODID
+ + ".bucket");
metal = (ItemMoltenMetal) new ItemMoltenMetal()
- .setUnlocalizedName(Variables.MODID + ".bucket");
+ .setUnlocalizedName(Variables.MODID
+ + ".bucket");
jewelryModifier = new ItemJewelryModifier()
- .setUnlocalizedName(Variables.MODID + ".jewelryModifier")
- .setTextureName(Variables.MODID + ":jewelryModifier")
+ .setUnlocalizedName(Variables.MODID
+ + ".jewelryModifier")
+ .setTextureName(Variables.MODID
+ + ":jewelryModifier")
.setCreativeTab(JewelrycraftMod.jewelrycraft);
- goldObj = new ItemGoldObj()
- .setUnlocalizedName(Variables.MODID + ".goldObject");
+ goldObj = new ItemGoldObj().setUnlocalizedName(
+ Variables.MODID + ".goldObject");
structureGen = new ItemStructureGen()
- .setUnlocalizedName(Variables.MODID + ".structureGen")
- .setTextureName(Variables.MODID + ":structureGen")
+ .setUnlocalizedName(Variables.MODID
+ + ".structureGen")
+ .setTextureName(Variables.MODID
+ + ":structureGen")
.setCreativeTab(JewelrycraftMod.jewelrycraft);
spawnEgg = new ItemSpawnEgg()
- .setUnlocalizedName(Variables.MODID + ".monsterPlacer")
+ .setUnlocalizedName(Variables.MODID
+ + ".monsterPlacer")
.setTextureName("spawn_egg");
- testItem = new ItemTest()
- .setUnlocalizedName(Variables.MODID + ".test");
+ testItem = new ItemTest().setUnlocalizedName(
+ Variables.MODID + ".test");
GameRegistry.registerItem(thiefGloves, "thiefGloves");
GameRegistry.registerItem(shadowIngot, "shadowIngot");
@@ -97,7 +118,8 @@ public class ItemList { GameRegistry.registerItem(guide, "guide");
GameRegistry.registerItem(bucket, "moltenMetalBucket");
GameRegistry.registerItem(metal, "moltenMetal");
- GameRegistry.registerItem(jewelryModifier, "jewelryModifier");
+ GameRegistry.registerItem(jewelryModifier,
+ "jewelryModifier");
GameRegistry.registerItem(goldObj, "goldObject");
GameRegistry.registerItem(structureGen, "structureGen");
GameRegistry.registerItem(spawnEgg, "spawnEgg");
diff --git a/src/main/java/darkknight/jewelrycraft/item/ItemMolds.java b/src/main/java/darkknight/jewelrycraft/item/ItemMolds.java index cc817de..b2acd18 100755 --- a/src/main/java/darkknight/jewelrycraft/item/ItemMolds.java +++ b/src/main/java/darkknight/jewelrycraft/item/ItemMolds.java @@ -15,9 +15,10 @@ import net.minecraft.util.MathHelper; public class ItemMolds extends Item {
/** List of molds color names */
public static final String[] moldsItemNames = new String[] {
- "ingot", "ring", "necklace", "bracelet", "earrings" };
+ "ingot", "ring", "necklace", "bracelet", "earrings"
+ };
@SideOnly(Side.CLIENT)
- private IIcon[] moldsIcons;
+ private IIcon[] moldsIcons;
/**
*
@@ -39,23 +40,25 @@ public class ItemMolds extends Item { * Gets an icon index based on an item's damage value
*/
public IIcon getIconFromDamage(int par1) {
- int j = MathHelper.clamp_int(par1, 0, moldsItemNames.length - 1);
+ int j = MathHelper.clamp_int(par1, 0,
+ moldsItemNames.length - 1);
return moldsIcons[j];
}
/**
- * Returns the unlocalized name of this item. This version accepts an
- * ItemStack so different stacks can have different names based on
- * their damage or NBT.
+ * Returns the unlocalized name of this item. This version accepts
+ * an ItemStack so different stacks can have different names based
+ * on their damage or NBT.
*
* @param par1ItemStack
* @return
*/
@Override
public String getUnlocalizedName(ItemStack par1ItemStack) {
- int i = MathHelper.clamp_int(par1ItemStack.getItemDamage(), 0,
- moldsItemNames.length - 1);
- return super.getUnlocalizedName() + "." + moldsItemNames[i];
+ int i = MathHelper.clamp_int(par1ItemStack.getItemDamage(),
+ 0, moldsItemNames.length - 1);
+ return super.getUnlocalizedName() + "."
+ + moldsItemNames[i];
}
/**
@@ -66,8 +69,8 @@ public class ItemMolds extends Item { @Override
@SideOnly(Side.CLIENT)
/**
- * returns a list of items with the same ID, but different meta (eg:
- * molds returns 16 items)
+ * returns a list of items with the same ID, but different meta
+ * (eg: molds returns 16 items)
*/
public void getSubItems(Item par1, CreativeTabs par2CreativeTabs,
List par3List) {
@@ -83,7 +86,9 @@ public class ItemMolds extends Item { public void registerIcons(IIconRegister par1IconRegister) {
moldsIcons = new IIcon[moldsItemNames.length];
for (int i = 0; i < moldsItemNames.length; ++i)
- moldsIcons[i] = par1IconRegister.registerIcon(Variables.MODID
- + ":" + moldsItemNames[i] + getIconString());
+ moldsIcons[i] = par1IconRegister
+ .registerIcon(Variables.MODID + ":"
+ + moldsItemNames[i]
+ + getIconString());
}
}
diff --git a/src/main/java/darkknight/jewelrycraft/item/ItemMoltenMetal.java b/src/main/java/darkknight/jewelrycraft/item/ItemMoltenMetal.java index dc5fbae..9b5b8a3 100755 --- a/src/main/java/darkknight/jewelrycraft/item/ItemMoltenMetal.java +++ b/src/main/java/darkknight/jewelrycraft/item/ItemMoltenMetal.java @@ -23,8 +23,8 @@ public class ItemMoltenMetal extends Item { */
@Override
public void registerIcons(IIconRegister iconRegister) {
- itemIcon = iconRegister
- .registerIcon(Variables.MODID + ":moltenMetalStill");
+ itemIcon = iconRegister.registerIcon(
+ Variables.MODID + ":moltenMetalStill");
}
/**
@@ -36,7 +36,8 @@ public class ItemMoltenMetal extends Item { @SideOnly(Side.CLIENT)
public int getColorFromItemStack(ItemStack stack, int pass) {
if (JewelryNBT.ingot(stack) != null)
- return JewelrycraftUtil.getColor(JewelryNBT.ingot(stack));
+ return JewelrycraftUtil
+ .getColor(JewelryNBT.ingot(stack));
else
return 0xFFFFFF;
}
diff --git a/src/main/java/darkknight/jewelrycraft/item/ItemMoltenMetalBucket.java b/src/main/java/darkknight/jewelrycraft/item/ItemMoltenMetalBucket.java index 6e36412..72f1228 100755 --- a/src/main/java/darkknight/jewelrycraft/item/ItemMoltenMetalBucket.java +++ b/src/main/java/darkknight/jewelrycraft/item/ItemMoltenMetalBucket.java @@ -34,14 +34,14 @@ public class ItemMoltenMetalBucket extends Item { public ItemStack onItemRightClick(ItemStack stack, World par2World,
EntityPlayer par3EntityPlayer) {
boolean flag = BlockList.moltenMetal == Blocks.air;
- MovingObjectPosition movingobjectposition =
- getMovingObjectPositionFromPlayer(par2World,
- par3EntityPlayer, flag);
+ MovingObjectPosition movingobjectposition = getMovingObjectPositionFromPlayer(
+ par2World, par3EntityPlayer, flag);
if (movingobjectposition == null)
return stack;
else {
- FillBucketEvent event = new FillBucketEvent(par3EntityPlayer,
- stack, par2World, movingobjectposition);
+ FillBucketEvent event = new FillBucketEvent(
+ par3EntityPlayer, stack, par2World,
+ movingobjectposition);
if (MinecraftForge.EVENT_BUS.post(event))
return stack;
if (event.getResult() == Event.Result.ALLOW) {
@@ -50,29 +50,40 @@ public class ItemMoltenMetalBucket extends Item { if (--stack.stackSize <= 0)
return event.result;
if (!par3EntityPlayer.inventory
- .addItemStackToInventory(event.result))
+ .addItemStackToInventory(
+ event.result))
par3EntityPlayer.dropPlayerItemWithRandomChoice(
- event.result, false);
+ event.result,
+ false);
return stack;
}
if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) {
int i = movingobjectposition.blockX;
int j = movingobjectposition.blockY;
int k = movingobjectposition.blockZ;
- if (!par2World.canMineBlock(par3EntityPlayer, i, j, k))
+ if (!par2World.canMineBlock(
+ par3EntityPlayer, i, j, k))
return stack;
if (flag) {
- if (!par3EntityPlayer.canPlayerEdit(i, j, k,
- movingobjectposition.sideHit, stack))
+ if (!par3EntityPlayer
+ .canPlayerEdit(i,
+ j,
+ k,
+ movingobjectposition.sideHit,
+ stack))
return stack;
- par2World.getBlock(i, j, k).getMaterial();
- par2World.getBlockMetadata(i, j, k);
+ par2World.getBlock(i, j, k)
+ .getMaterial();
+ par2World.getBlockMetadata(i, j,
+ k);
par2World.setBlockToAir(i, j, k);
- return func_150910_a(stack, par3EntityPlayer,
+ return func_150910_a(stack,
+ par3EntityPlayer,
ItemList.bucket);
} else {
if (BlockList.moltenMetal == Blocks.air)
- return new ItemStack(Items.bucket);
+ return new ItemStack(
+ Items.bucket);
if (movingobjectposition.sideHit == 0)
--j;
else if (movingobjectposition.sideHit == 1)
@@ -85,12 +96,19 @@ public class ItemMoltenMetalBucket extends Item { --i;
else if (movingobjectposition.sideHit == 5)
++i;
- if (!par3EntityPlayer.canPlayerEdit(i, j, k,
- movingobjectposition.sideHit, stack))
+ if (!par3EntityPlayer
+ .canPlayerEdit(i,
+ j,
+ k,
+ movingobjectposition.sideHit,
+ stack))
return stack;
- if (tryPlaceContainedLiquid(par2World, i, j, k, stack)
+ if (tryPlaceContainedLiquid(
+ par2World, i, j, k,
+ stack)
&& !par3EntityPlayer.capabilities.isCreativeMode)
- return new ItemStack(Items.bucket);
+ return new ItemStack(
+ Items.bucket);
}
}
return stack;
@@ -104,10 +122,12 @@ public class ItemMoltenMetalBucket extends Item { else if (--p_150910_1_.stackSize <= 0)
return new ItemStack(p_150910_3_);
else {
- if (!p_150910_2_.inventory
- .addItemStackToInventory(new ItemStack(p_150910_3_)))
+ if (!p_150910_2_.inventory.addItemStackToInventory(
+ new ItemStack(p_150910_3_)))
p_150910_2_.dropPlayerItemWithRandomChoice(
- new ItemStack(p_150910_3_, 1, 0), false);
+ new ItemStack(p_150910_3_,
+ 1, 0),
+ false);
return p_150910_1_;
}
}
@@ -117,18 +137,25 @@ public class ItemMoltenMetalBucket extends Item { if (BlockList.moltenMetal == Blocks.air)
return false;
else {
- Material material = world.getBlock(x, y, z).getMaterial();
+ Material material = world.getBlock(x, y, z)
+ .getMaterial();
boolean flag = !material.isSolid();
if (!world.isAirBlock(x, y, z) && !flag)
return false;
- else if (stack != null && JewelryNBT.ingot(stack) != null) {
- if (!world.isRemote && flag && !material.isLiquid())
+ else if (stack != null && JewelryNBT
+ .ingot(stack) != null) {
+ if (!world.isRemote && flag
+ && !material.isLiquid())
world.func_147480_a(x, y, z, true);
- world.setBlock(x, y, z, BlockList.moltenMetal, 0, 3);
- TileEntity moltenLiquid = world.getTileEntity(x, y, z);
+ world.setBlock(x, y, z,
+ BlockList.moltenMetal, 0,
+ 3);
+ TileEntity moltenLiquid = world
+ .getTileEntity(x, y, z);
if (moltenLiquid instanceof TileEntityMoltenMetal)
((TileEntityMoltenMetal) moltenLiquid)
- .setMetal(JewelryNBT.ingot(stack));
+ .setMetal(JewelryNBT
+ .ingot(stack));
return true;
} else
return false;
@@ -138,15 +165,16 @@ public class ItemMoltenMetalBucket extends Item { @Override
public void registerIcons(IIconRegister iconRegister) {
itemIcon = iconRegister.registerIcon("bucket_empty");
- liquid = iconRegister
- .registerIcon(Variables.MODID + ":bucketOverlay");
+ liquid = iconRegister.registerIcon(
+ Variables.MODID + ":bucketOverlay");
}
@Override
@SideOnly(Side.CLIENT)
public int getColorFromItemStack(ItemStack stack, int pass) {
if (pass == 1 && JewelryNBT.ingot(stack) != null)
- return JewelrycraftUtil.getColor(JewelryNBT.ingot(stack));
+ return JewelrycraftUtil
+ .getColor(JewelryNBT.ingot(stack));
return 16777215;
}
@@ -178,21 +206,27 @@ public class ItemMoltenMetalBucket extends Item { if (ingot != null) {
return StatCollector
.translateToLocal(
- getUnlocalizedNameInefficiently(stack)
+ getUnlocalizedNameInefficiently(
+ stack)
+ ".name")
- .trim() + " "
- + ingot.getDisplayName().replace("Ingot", " ")
+ .trim()
+ + " "
+ + ingot.getDisplayName()
+ .replace("Ingot",
+ " ")
.trim();
} else
return StatCollector
- .translateToLocal("bucket.unknown");
+ .translateToLocal(
+ "bucket.unknown");
}
} catch (Exception e) {
System.out.println("Error: " + e);
}
return ("" + StatCollector.translateToLocal(
- getUnlocalizedNameInefficiently(stack) + ".name")).trim()
- + " " + StatCollector
- .translateToLocal("info.jewelrycraft2.metal");
+ getUnlocalizedNameInefficiently(stack)
+ + ".name")).trim()
+ + " " + StatCollector.translateToLocal(
+ "info.jewelrycraft2.metal");
}
}
diff --git a/src/main/java/darkknight/jewelrycraft/item/ItemNecklace.java b/src/main/java/darkknight/jewelrycraft/item/ItemNecklace.java index d14230a..3a71d0b 100755 --- a/src/main/java/darkknight/jewelrycraft/item/ItemNecklace.java +++ b/src/main/java/darkknight/jewelrycraft/item/ItemNecklace.java @@ -20,10 +20,10 @@ public class ItemNecklace extends ItemBaseJewelry { */
@Override
public void registerIcons(IIconRegister iconRegister) {
- itemIcon =
- iconRegister.registerIcon(Variables.MODID + ":necklace");
- gem = iconRegister
- .registerIcon(Variables.MODID + ":jewelNecklace");
+ itemIcon = iconRegister.registerIcon(
+ Variables.MODID + ":necklace");
+ gem = iconRegister.registerIcon(
+ Variables.MODID + ":jewelNecklace");
}
/**
diff --git a/src/main/java/darkknight/jewelrycraft/item/ItemRing.java b/src/main/java/darkknight/jewelrycraft/item/ItemRing.java index 87ca8d8..4df83d0 100755 --- a/src/main/java/darkknight/jewelrycraft/item/ItemRing.java +++ b/src/main/java/darkknight/jewelrycraft/item/ItemRing.java @@ -20,8 +20,10 @@ public class ItemRing extends ItemBaseJewelry { */
@Override
public void registerIcons(IIconRegister iconRegister) {
- itemIcon = iconRegister.registerIcon(Variables.MODID + ":ring");
- gem = iconRegister.registerIcon(Variables.MODID + ":jewelRing");
+ itemIcon = iconRegister
+ .registerIcon(Variables.MODID + ":ring");
+ gem = iconRegister.registerIcon(
+ Variables.MODID + ":jewelRing");
}
/**
diff --git a/src/main/java/darkknight/jewelrycraft/item/ItemSpawnEgg.java b/src/main/java/darkknight/jewelrycraft/item/ItemSpawnEgg.java index cceab12..bb57f9a 100755 --- a/src/main/java/darkknight/jewelrycraft/item/ItemSpawnEgg.java +++ b/src/main/java/darkknight/jewelrycraft/item/ItemSpawnEgg.java @@ -28,14 +28,16 @@ import net.minecraft.world.World; * @author Betweenlands
*/
public class ItemSpawnEgg extends ItemMonsterPlacer {
- private static final Map<Short, EggData> eggTypes =
- new LinkedHashMap<Short, EggData>();
+ private static final Map<Short, EggData> eggTypes = new LinkedHashMap<Short, EggData>();
public static void registerSpawnEgg(
- Class<? extends EntityLiving> entity, String entityName,
- int id, int eggBackgroundColor, int eggForegroundColor) {
- eggTypes.put((short) id, new EggData(id, entityName, entity,
- eggBackgroundColor, eggForegroundColor));
+ Class<? extends EntityLiving> entity,
+ String entityName, int id, int eggBackgroundColor,
+ int eggForegroundColor) {
+ eggTypes.put((short) id,
+ new EggData(id, entityName, entity,
+ eggBackgroundColor,
+ eggForegroundColor));
}
private static EggData getEggData(ItemStack is) {
@@ -49,22 +51,23 @@ public class ItemSpawnEgg extends ItemMonsterPlacer { @Override
public String getItemStackDisplayName(ItemStack is) {
- String s = StatCollector
- .translateToLocal(getUnlocalizedName() + ".name").trim();
+ String s = StatCollector.translateToLocal(
+ getUnlocalizedName() + ".name").trim();
String mob = "";
EggData egg = getEggData(is);
if (egg != null)
mob = StatCollector.translateToLocal("entity."
- + Variables.MODID + "." + egg.entityName + ".name");
+ + Variables.MODID + "."
+ + egg.entityName + ".name");
return String.format(s, mob);
}
@Override
public boolean onItemUse(ItemStack is, EntityPlayer player,
- World world, int x, int y, int z, int side, float hitX,
- float hitY, float hitZ) {
+ World world, int x, int y, int z, int side,
+ float hitX, float hitY, float hitZ) {
if (world.isRemote)
return true;
@@ -75,9 +78,11 @@ public class ItemSpawnEgg extends ItemMonsterPlacer { EggData egg = getEggData(is);
if (egg != null) {
- egg.spawnMob(world, x + 0.5D,
- y + (side == 1 && block != null
- && block.getRenderType() == 11 ? 0.5D : 0D),
+ egg.spawnMob(world, x + 0.5D, y + (side == 1
+ && block != null
+ && block.getRenderType() == 11
+ ? 0.5D
+ : 0D),
z + 0.5D, is);
if (!player.capabilities.isCreativeMode)
@@ -93,17 +98,19 @@ public class ItemSpawnEgg extends ItemMonsterPlacer { if (world.isRemote)
return is;
- MovingObjectPosition mop =
- getMovingObjectPositionFromPlayer(world, player, true);
+ MovingObjectPosition mop = getMovingObjectPositionFromPlayer(
+ world, player, true);
if (mop != null && mop.typeOfHit == MovingObjectType.BLOCK) {
int x = mop.blockX, y = mop.blockY, z = mop.blockZ;
if (!world.canMineBlock(player, x, y, z)
- || !player.canPlayerEdit(x, y, z, mop.sideHit, is))
+ || !player.canPlayerEdit(x, y, z,
+ mop.sideHit, is))
return is;
- if (world.getBlock(x, y, z).getMaterial() == Material.water) {
+ if (world.getBlock(x, y, z)
+ .getMaterial() == Material.water) {
EggData egg = getEggData(is);
if (egg != null) {
egg.spawnMob(world, x, y, z, is);
@@ -117,8 +124,8 @@ public class ItemSpawnEgg extends ItemMonsterPlacer { return is;
}
- public static EntityLiving getEntity(World world, double x, double y,
- double z, ItemStack is) {
+ public static EntityLiving getEntity(World world, double x,
+ double y, double z, ItemStack is) {
EggData egg = getEggData(is);
return egg.spawnMob(world, x, y, z, is);
}
@@ -128,7 +135,8 @@ public class ItemSpawnEgg extends ItemMonsterPlacer { public int getColorFromItemStack(ItemStack is, int pass) {
EggData egg = getEggData(is);
return egg != null
- ? pass == 0 ? egg.primaryColor : egg.secondaryColor
+ ? pass == 0 ? egg.primaryColor
+ : egg.secondaryColor
: 16777215;
}
@@ -140,19 +148,22 @@ public class ItemSpawnEgg extends ItemMonsterPlacer { }
static class EggData {
- private final short id;
- String entityName;
+ private final short id;
+ String entityName;
private final Class<? extends EntityLiving> entityClass;
- int primaryColor;
- int secondaryColor;
+ int primaryColor;
+ int secondaryColor;
EggData(int id, String entityName,
Class<? extends EntityLiving> entityClass,
- int[] rgbPrimaryColor, int[] rgbSecondaryColor) {
+ int[] rgbPrimaryColor,
+ int[] rgbSecondaryColor) {
this(id, entityName, entityClass,
- rgbPrimaryColor[0] << 16 | rgbPrimaryColor[1] << 8
+ rgbPrimaryColor[0] << 16
+ | rgbPrimaryColor[1] << 8
| rgbPrimaryColor[2],
- rgbSecondaryColor[0] << 16 | rgbSecondaryColor[1] << 8
+ rgbSecondaryColor[0] << 16
+ | rgbSecondaryColor[1] << 8
| rgbSecondaryColor[2]);
}
@@ -166,8 +177,8 @@ public class ItemSpawnEgg extends ItemMonsterPlacer { this.secondaryColor = secondaryColor;
}
- public EntityLiving spawnMob(World world, double x, double y,
- double z, ItemStack is) {
+ public EntityLiving spawnMob(World world, double x,
+ double y, double z, ItemStack is) {
EntityLiving e = null;
try {
@@ -198,7 +209,9 @@ public class ItemSpawnEgg extends ItemMonsterPlacer { ((EntityHeart) e).setType("Red");
}
e.setLocationAndAngles(x, y, z, MathHelper
- .wrapAngleTo180_float(world.rand.nextFloat() * 360F),
+ .wrapAngleTo180_float(world.rand
+ .nextFloat()
+ * 360F),
0F);
e.rotationYawHead = e.rotationYaw;
e.renderYawOffset = e.rotationYaw;
diff --git a/src/main/java/darkknight/jewelrycraft/item/ItemStructureGen.java b/src/main/java/darkknight/jewelrycraft/item/ItemStructureGen.java index 4ff91df..a929430 100755 --- a/src/main/java/darkknight/jewelrycraft/item/ItemStructureGen.java +++ b/src/main/java/darkknight/jewelrycraft/item/ItemStructureGen.java @@ -20,9 +20,11 @@ public class ItemStructureGen extends Item { @Override
public ItemStack onItemRightClick(ItemStack stack, World world,
EntityPlayer player) {
- if (!world.isRemote && player.capabilities.isCreativeMode) {
+ if (!world.isRemote
+ && player.capabilities.isCreativeMode) {
if (!player.isSneaking()) {
- if (no < JewelrycraftUtil.structures.size() - 1)
+ if (no < JewelrycraftUtil.structures.size()
+ - 1)
no++;
else
no = 0;
@@ -30,22 +32,23 @@ public class ItemStructureGen extends Item { if (no > 0)
no--;
else
- no = JewelrycraftUtil.structures.size() - 1;
+ no = JewelrycraftUtil.structures
+ .size() - 1;
}
- player.addChatMessage(
- new ChatComponentText("Structure no. " + (no + 1)));
+ player.addChatMessage(new ChatComponentText(
+ "Structure no. " + (no + 1)));
}
return stack;
}
@Override
public boolean onItemUse(ItemStack stack, EntityPlayer player,
- World world, int x, int y, int z, int par1, float par2,
- float par3, float par4) {
+ World world, int x, int y, int z, int par1,
+ float par2, float par3, float par4) {
if (player.capabilities.isCreativeMode)
JewelrycraftUtil.structures.get(no).generate(world,
- world.getBiomeGenForCoords(x, z), itemRand, x, y + 1,
- z);
+ world.getBiomeGenForCoords(x, z),
+ itemRand, x, y + 1, z);
return true;
}
diff --git a/src/main/java/darkknight/jewelrycraft/item/ItemTest.java b/src/main/java/darkknight/jewelrycraft/item/ItemTest.java index 4b16a86..312c38c 100755 --- a/src/main/java/darkknight/jewelrycraft/item/ItemTest.java +++ b/src/main/java/darkknight/jewelrycraft/item/ItemTest.java @@ -21,7 +21,7 @@ import net.minecraft.world.World; public class ItemTest extends Item {
@SideOnly(Side.CLIENT)
- private IIcon[] icons;
+ private IIcon[] icons;
private NBTTagCompound nbt = new NBTTagCompound();
public ItemTest() {
@@ -49,14 +49,15 @@ public class ItemTest extends Item { icons = new IIcon[Curse.getCurseList().size()];
for (int i = 0; i < Curse.getCurseList().size(); ++i)
icons[i] = par1IconRegister
- .registerIcon(Variables.MODID + ":" + "testItem_" + i);
+ .registerIcon(Variables.MODID + ":"
+ + "testItem_" + i);
}
@Override
public ItemStack onItemRightClick(ItemStack stack, World world,
EntityPlayer player) {
- MovingObjectPosition mop =
- getMovingObjectPositionFromPlayer(world, player, true);
+ MovingObjectPosition mop = getMovingObjectPositionFromPlayer(
+ world, player, true);
if (mop != null && mop.typeOfHit == MovingObjectType.BLOCK) {
int x = mop.blockX, y = mop.blockY, z = mop.blockZ;
TileEntity tile = world.getTileEntity(x, y, z);
@@ -66,7 +67,8 @@ public class ItemTest extends Item { else {
NBTTagCompound block = new NBTTagCompound();
tile.writeToNBT(block);
- nbt.setString("id", block.getString("id"));
+ nbt.setString("id", block
+ .getString("id"));
nbt.setInteger("x", tile.xCoord);
nbt.setInteger("y", tile.yCoord);
nbt.setInteger("z", tile.zCoord);
diff --git a/src/main/java/darkknight/jewelrycraft/item/ItemThiefGloves.java b/src/main/java/darkknight/jewelrycraft/item/ItemThiefGloves.java index 4ca3c0f..76d056d 100755 --- a/src/main/java/darkknight/jewelrycraft/item/ItemThiefGloves.java +++ b/src/main/java/darkknight/jewelrycraft/item/ItemThiefGloves.java @@ -45,27 +45,35 @@ public class ItemThiefGloves extends Item { @Override
public boolean itemInteractionForEntity(ItemStack stack,
EntityPlayer player, EntityLivingBase entity) {
- String villagerString = StatCollector
- .translateToLocal("info." + Variables.MODID + ".villager");
+ String villagerString = StatCollector.translateToLocal(
+ "info." + Variables.MODID + ".villager");
if (entity instanceof EntityVillager) {
EntityVillager villager = (EntityVillager) entity;
- int wealth = (Integer) ReflectionHelper.getPrivateValue(
- EntityVillager.class, villager, "wealth",
- "field_70956_bz");
- MerchantRecipeList buyingList =
- (MerchantRecipeList) ReflectionHelper.getPrivateValue(
- EntityVillager.class, villager, "buyingList",
+ int wealth = (Integer) ReflectionHelper
+ .getPrivateValue(
+ EntityVillager.class,
+ villager, "wealth",
+ "field_70956_bz");
+ MerchantRecipeList buyingList = (MerchantRecipeList) ReflectionHelper
+ .getPrivateValue(
+ EntityVillager.class,
+ villager,
+ "buyingList",
"field_70963_i");
int chance = 1;
- boolean areOtherVillagersAround = false, canTheySeeYou = false;
- AxisAlignedBB axisalignedbb =
- villager.boundingBox.expand(2.0D, 0.0D, 2.0D);
- List<?> entities =
- villager.worldObj.getEntitiesWithinAABBExcludingEntity(
- villager, axisalignedbb);
+ boolean areOtherVillagersAround = false,
+ canTheySeeYou = false;
+ AxisAlignedBB axisalignedbb = villager.boundingBox
+ .expand(2.0D, 0.0D, 2.0D);
+ List<?> entities = villager.worldObj
+ .getEntitiesWithinAABBExcludingEntity(
+ villager,
+ axisalignedbb);
for (Object s : entities)
if (s instanceof EntityVillager
- && ((EntityVillager) s).canEntityBeSeen(player)) {
+ && ((EntityVillager) s)
+ .canEntityBeSeen(
+ player)) {
chance += 1;
canTheySeeYou = true;
areOtherVillagersAround = true;
@@ -79,152 +87,178 @@ public class ItemThiefGloves extends Item { int steal = rand.nextInt(chance);
if (steal == 0) {
villager.dropItem(Items.emerald, wealth);
- ReflectionHelper.setPrivateValue(EntityVillager.class,
- villager, 0, "wealth", "field_70956_bz");
+ ReflectionHelper.setPrivateValue(
+ EntityVillager.class,
+ villager, 0, "wealth",
+ "field_70956_bz");
}
if (buyingList != null) {
- Iterator<?> iterator = buyingList.iterator();
+ Iterator<?> iterator = buyingList
+ .iterator();
if (steal == 0) {
while (iterator.hasNext()) {
- MerchantRecipe recipe =
- (MerchantRecipe) iterator.next();
- int toolUses =
- (Integer) ReflectionHelper.getPrivateValue(
- MerchantRecipe.class, recipe,
- "toolUses", "field_77400_d");
+ MerchantRecipe recipe = (MerchantRecipe) iterator
+ .next();
+ int toolUses = (Integer) ReflectionHelper
+ .getPrivateValue(
+ MerchantRecipe.class,
+ recipe,
+ "toolUses",
+ "field_77400_d");
int quantity;
- if (recipe.getItemToSell().isStackable())
- quantity = recipe.getItemToSell().stackSize
+ if (recipe.getItemToSell()
+ .isStackable())
+ quantity = recipe
+ .getItemToSell().stackSize
* (7 - toolUses);
else
- quantity = recipe.getItemToSell().stackSize;
+ quantity = recipe
+ .getItemToSell().stackSize;
ItemStack s = new ItemStack(
- recipe.getItemToSell().getItem(), quantity,
- recipe.getItemToSell().getItemDamage());
- s.setTagCompound(
- recipe.getItemToSell().getTagCompound());
- if (player.inventory.addItemStackToInventory(s))
+ recipe.getItemToSell()
+ .getItem(),
+ quantity,
+ recipe.getItemToSell()
+ .getItemDamage());
+ s.setTagCompound(recipe
+ .getItemToSell()
+ .getTagCompound());
+ if (player.inventory
+ .addItemStackToInventory(
+ s))
;
else
- villager.entityDropItem(s, 0);
+ villager.entityDropItem(
+ s,
+ 0);
if (!player.capabilities.isCreativeMode)
- JewelrycraftUtil.addCursePoints(player, 5);
+ JewelrycraftUtil.addCursePoints(
+ player,
+ 5);
player.addChatMessage(
- new ChatComponentText(villagerString + " #"
- + villager.getProfession() + ": "
- + StatCollector.translateToLocal(
- "chatmessage."
- + Variables.MODID
- + ".villager.confusion")
- + " " + s.getDisplayName() + "!"));
- stack.damageItem(1, player);
+ new ChatComponentText(
+ villagerString + " #"
+ + villager.getProfession()
+ + ": "
+ + StatCollector.translateToLocal(
+ "chatmessage." + Variables.MODID
+ + ".villager.confusion")
+ + " "
+ + s.getDisplayName()
+ + "!"));
+ stack.damageItem(1,
+ player);
}
buyingList.clear();
- ReflectionHelper.setPrivateValue(EntityVillager.class,
- villager, 300, "timeUntilReset",
+ ReflectionHelper.setPrivateValue(
+ EntityVillager.class,
+ villager, 300,
+ "timeUntilReset",
"field_70961_j");
- ReflectionHelper.setPrivateValue(EntityVillager.class,
- villager, true, "needsInitilization",
+ ReflectionHelper.setPrivateValue(
+ EntityVillager.class,
+ villager, true,
+ "needsInitilization",
"field_70959_by");
player.addChatMessage(
- new ChatComponentText(StatCollector
- .translateToLocal("chatmessage."
- + Variables.MODID + ".whisper")
- + ": "));
- player.addChatMessage(new ChatComponentText(
- EnumChatFormatting.DARK_PURPLE + StatCollector
- .translateToLocal("chatmessage."
- + Variables.MODID
- + ".stealSuccess1")));
- player.addChatMessage(new ChatComponentText(
- EnumChatFormatting.DARK_PURPLE + StatCollector
- .translateToLocal("chatmessage."
- + Variables.MODID
- + ".stealSuccess2")));
- player.addChatMessage(new ChatComponentText(
- EnumChatFormatting.DARK_PURPLE + StatCollector
- .translateToLocal("chatmessage."
- + Variables.MODID
- + ".stealSuccess3")));
+ new ChatComponentText(
+ StatCollector.translateToLocal(
+ "chatmessage." + Variables.MODID
+ + ".whisper")
+ + ": "));
+ player.addChatMessage(
+ new ChatComponentText(
+ EnumChatFormatting.DARK_PURPLE
+ + StatCollector.translateToLocal(
+ "chatmessage." + Variables.MODID
+ + ".stealSuccess1")));
+ player.addChatMessage(
+ new ChatComponentText(
+ EnumChatFormatting.DARK_PURPLE
+ + StatCollector.translateToLocal(
+ "chatmessage." + Variables.MODID
+ + ".stealSuccess2")));
+ player.addChatMessage(
+ new ChatComponentText(
+ EnumChatFormatting.DARK_PURPLE
+ + StatCollector.translateToLocal(
+ "chatmessage." + Variables.MODID
+ + ".stealSuccess3")));
} else {
stack.damageItem(1, player);
if (!player.capabilities.isCreativeMode)
- JewelrycraftUtil.addCursePoints(player, 25);
- if (player.isPotionActive(Potion.invisibility)) {
+ JewelrycraftUtil.addCursePoints(
+ player,
+ 25);
+ if (player.isPotionActive(
+ Potion.invisibility)) {
player.addChatMessage(
- new ChatComponentText(villagerString + " #"
- + villager.getProfession() + " "
- + StatCollector.translateToLocal(
- "chatmessage."
- + Variables.MODID
- + ".steal.fail")));
+ new ChatComponentText(
+ villagerString + " #"
+ + villager.getProfession()
+ + " "
+ + StatCollector.translateToLocal(
+ "chatmessage." + Variables.MODID
+ + ".steal.fail")));
} else {
if (areOtherVillagersAround) {
if (!canTheySeeYou) {
player.addChatMessage(
- new ChatComponentText(StatCollector
- .translateToLocal(
- "chatmessage."
- + Variables.MODID
+ new ChatComponentText(
+ StatCollector.translateToLocal(
+ "chatmessage." + Variables.MODID
+ ".steal.caught1")
- + " " + villagerString
- + " #"
- + villager.getProfession()
- + "."));
+ + " "
+ + villagerString
+ + " #"
+ + villager.getProfession()
+ + "."));
player.addChatMessage(
new ChatComponentText(
villagerString + " #"
- + villager
- .getProfession()
+ + villager.getProfession()
+ " "
- + StatCollector
- .translateToLocal(
- "chatmessage."
- + Variables.MODID
- + ".steal2")));
+ + StatCollector.translateToLocal(
+ "chatmessage." + Variables.MODID
+ + ".steal2")));
return true;
} else {
player.addChatMessage(
- new ChatComponentText(StatCollector
- .translateToLocal(
- "chatmessage."
- + Variables.MODID
+ new ChatComponentText(
+ StatCollector.translateToLocal(
+ "chatmessage." + Variables.MODID
+ ".steal.caught2")
- + " " + villagerString
- + " #"
- + villager.getProfession()
- + "."));
+ + " "
+ + villagerString
+ + " #"
+ + villager.getProfession()
+ + "."));
player.addChatMessage(
new ChatComponentText(
villagerString + " #"
- + villager
- .getProfession()
+ + villager.getProfession()
+ " "
- + StatCollector
- .translateToLocal(
- "chatmessage."
- + Variables.MODID
- + ".steal2")));
+ + StatCollector.translateToLocal(
+ "chatmessage." + Variables.MODID
+ + ".steal2")));
return true;
}
} else {
- player.addChatMessage(new ChatComponentText(
- villagerString + " #"
- + villager.getProfession()
- + " "
- + StatCollector
- .translateToLocal(
- "chatmessage."
- + Variables.MODID
+ player.addChatMessage(
+ new ChatComponentText(
+ villagerString + " #"
+ + villager.getProfession()
+ + " "
+ + StatCollector.translateToLocal(
+ "chatmessage." + Variables.MODID
+ ".steal1")));
- player.addChatMessage(new ChatComponentText(
- villagerString + " #"
- + villager.getProfession()
- + " "
- + StatCollector
- .translateToLocal(
- "chatmessage."
- + Variables.MODID
+ player.addChatMessage(
+ new ChatComponentText(
+ villagerString + " #"
+ + villager.getProfession()
+ + " "
+ + StatCollector.translateToLocal(
+ "chatmessage." + Variables.MODID
+ ".steal2")));
return true;
}
@@ -233,7 +267,8 @@ public class ItemThiefGloves extends Item { }
return true;
} else
- return super.itemInteractionForEntity(stack, player, entity);
+ return super.itemInteractionForEntity(stack,
+ player, entity);
}
/**
@@ -249,15 +284,18 @@ public class ItemThiefGloves extends Item { list.add(EnumChatFormatting.GRAY
+ additionalInfoInstructions());
else {
- list.add(EnumChatFormatting.GRAY
- + StatCollector.translateToLocal("item."
- + Variables.MODID + ".thievingGloves.info.1"));
- list.add(EnumChatFormatting.GRAY
- + StatCollector.translateToLocal("item."
- + Variables.MODID + ".thievingGloves.info.2"));
- list.add(EnumChatFormatting.GRAY
- + StatCollector.translateToLocal("item."
- + Variables.MODID + ".thievingGloves.info.3"));
+ list.add(EnumChatFormatting.GRAY + StatCollector
+ .translateToLocal("item."
+ + Variables.MODID
+ + ".thievingGloves.info.1"));
+ list.add(EnumChatFormatting.GRAY + StatCollector
+ .translateToLocal("item."
+ + Variables.MODID
+ + ".thievingGloves.info.2"));
+ list.add(EnumChatFormatting.GRAY + StatCollector
+ .translateToLocal("item."
+ + Variables.MODID
+ + ".thievingGloves.info.3"));
}
}
@@ -265,7 +303,8 @@ public class ItemThiefGloves extends Item { * @return
*/
public static boolean shouldAddAdditionalInfo() {
- if (FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT)
+ if (FMLCommonHandler.instance()
+ .getEffectiveSide() == Side.CLIENT)
if (Keyboard.isKeyDown(Keyboard.KEY_LSHIFT))
return true;
return false;
@@ -275,8 +314,9 @@ public class ItemThiefGloves extends Item { * @return
*/
public static String additionalInfoInstructions() {
- String message = StatCollector.translateToLocal(
- "item." + Variables.MODID + ".thievingGloves.info.extra");
+ String message = StatCollector.translateToLocal("item."
+ + Variables.MODID
+ + ".thievingGloves.info.extra");
return message;
}
}
diff --git a/src/main/java/darkknight/jewelrycraft/item/render/BraceletRender.java b/src/main/java/darkknight/jewelrycraft/item/render/BraceletRender.java index 3d7bcbe..2f1ba9e 100755 --- a/src/main/java/darkknight/jewelrycraft/item/render/BraceletRender.java +++ b/src/main/java/darkknight/jewelrycraft/item/render/BraceletRender.java @@ -13,7 +13,7 @@ import net.minecraft.util.ResourceLocation; public class BraceletRender extends TileEntitySpecialRenderer {
public ModelBracelet bracelet = new ModelBracelet();
- ResourceLocation texture = new ResourceLocation(
+ ResourceLocation texture = new ResourceLocation(
Variables.MODID, "textures/entities/Bracelet.png");
@Override
@@ -26,21 +26,23 @@ public class BraceletRender extends TileEntitySpecialRenderer { GL11.glPushMatrix();
Minecraft.getMinecraft().renderEngine.bindTexture(texture);
if ((float) z != -1)
- bracelet.render(entity, 0F, 0F, 0F, (float) z, f, 1.0F);
- if (Loader
- .isModLoaded("alpaca") /*
- * && fiskfille.alpaca.AlpacaAPI.
- * isAlpacaClient((
- * EntityPlayer)entity)
- */) {
+ bracelet.render(entity, 0F, 0F, 0F, (float) z, f,
+ 1.0F);
+ if (Loader.isModLoaded(
+ "alpaca") /*
+ * && fiskfille.alpaca.
+ * AlpacaAPI.
+ * isAlpacaClient((
+ * EntityPlayer)entity)
+ */) {
GL11.glTranslatef(1F, 0F, -9F);
GL11.glRotatef(25F, 1F, 0F, 0F);
GL11.glRotatef(-25F, 0F, 1F, 0F);
} else
GL11.glTranslatef(0F, 3F, 0F);
if ((float) x != -1)
- bracelet.render(entity, 0F, 0F, 0F, (float) x, (float) y,
- 1.0F);
+ bracelet.render(entity, 0F, 0F, 0F, (float) x,
+ (float) y, 1.0F);
GL11.glPopMatrix();
}
}
\ No newline at end of file diff --git a/src/main/java/darkknight/jewelrycraft/item/render/EarringsRender.java b/src/main/java/darkknight/jewelrycraft/item/render/EarringsRender.java index 958aceb..c82f2e2 100755 --- a/src/main/java/darkknight/jewelrycraft/item/render/EarringsRender.java +++ b/src/main/java/darkknight/jewelrycraft/item/render/EarringsRender.java @@ -12,8 +12,8 @@ import net.minecraft.util.ResourceLocation; public class EarringsRender extends TileEntitySpecialRenderer {
ModelEarrings earrings = new ModelEarrings();
- ResourceLocation texture = new ResourceLocation(Variables.MODID,
- "textures/entities/Earrings.png");
+ ResourceLocation texture = new ResourceLocation(
+ Variables.MODID, "textures/entities/Earrings.png");
@Override
public void renderTileEntityAt(TileEntity te, double x, double y,
diff --git a/src/main/java/darkknight/jewelrycraft/item/render/ItemRender.java b/src/main/java/darkknight/jewelrycraft/item/render/ItemRender.java index 9b665ec..50f3472 100755 --- a/src/main/java/darkknight/jewelrycraft/item/render/ItemRender.java +++ b/src/main/java/darkknight/jewelrycraft/item/render/ItemRender.java @@ -31,24 +31,23 @@ import net.minecraftforge.client.IItemRenderer; import net.minecraftforge.client.MinecraftForgeClient;
public class ItemRender implements IItemRenderer {
- TileEntitySpecialRenderer render;
- public TileEntity entity;
- ModelBase model;
- private RenderBlocks renderBlocksIr =
- new RenderBlocks();
- private Minecraft mc =
- Minecraft.getMinecraft();
- private static final ResourceLocation RES_ITEM_GLINT =
- new ResourceLocation("textures/misc/enchanted_item_glint.png");
- private float tran = 0F;
+ TileEntitySpecialRenderer render;
+ public TileEntity entity;
+ ModelBase model;
+ private RenderBlocks renderBlocksIr = new RenderBlocks();
+ private Minecraft mc = Minecraft
+ .getMinecraft();
+ private static final ResourceLocation RES_ITEM_GLINT = new ResourceLocation(
+ "textures/misc/enchanted_item_glint.png");
+ private float tran = 0F;
/**
* @param render
* @param entity
* @param model
*/
- public ItemRender(TileEntitySpecialRenderer render, TileEntity entity,
- ModelBase model) {
+ public ItemRender(TileEntitySpecialRenderer render,
+ TileEntity entity, ModelBase model) {
this.entity = entity;
this.render = render;
this.model = model;
@@ -63,7 +62,8 @@ public class ItemRender implements IItemRenderer { * @return
*/
@Override
- public boolean handleRenderType(ItemStack item, ItemRenderType type) {
+ public boolean handleRenderType(ItemStack item,
+ ItemRenderType type) {
return true;
}
@@ -92,63 +92,83 @@ public class ItemRender implements IItemRenderer { && JewelryNBT.item(item) == null) {
if (type == IItemRenderer.ItemRenderType.ENTITY) {
GL11.glRotatef(180f, 0f, 1f, 0f);
- GL11.glTranslatef(-0.5f, -0.5f, -0.4f);
+ GL11.glTranslatef(-0.5f, -0.5f,
+ -0.4f);
}
- render.renderTileEntityAt(entity, 0.0D, 0.0D, 0.0D, 0.0F);
+ render.renderTileEntityAt(entity, 0.0D,
+ 0.0D, 0.0D, 0.0F);
} else if (JewelryNBT.item(item) != null) {
GL11.glPushMatrix();
GL11.glColor3f(1F, 1F, 0F);
- if (Item.getItemById(Integer.valueOf(item.getTagCompound()
- .getTag("target").toString().split(",")[0]
- .substring(4).replace("s", ""))) != null)
- renderItem(Minecraft.getMinecraft().thePlayer,
- JewelryNBT.item(item), 0, type);
+ if (Item.getItemById(Integer.valueOf(item
+ .getTagCompound()
+ .getTag("target")
+ .toString().split(",")[0]
+ .substring(4)
+ .replace("s", ""))) != null)
+ renderItem(Minecraft
+ .getMinecraft().thePlayer,
+ JewelryNBT.item(item),
+ 0, type);
else
- renderItem(Minecraft.getMinecraft().thePlayer,
- new ItemStack(Blocks.end_portal), 0, type);
+ renderItem(Minecraft
+ .getMinecraft().thePlayer,
+ new ItemStack(Blocks.end_portal),
+ 0, type);
GL11.glPopMatrix();
} else {
GL11.glPushMatrix();
GL11.glColor3f(1F, 1F, 0F);
- renderItem(Minecraft.getMinecraft().thePlayer,
- new ItemStack(Blocks.end_portal), 0, type);
+ renderItem(Minecraft
+ .getMinecraft().thePlayer,
+ new ItemStack(Blocks.end_portal),
+ 0, type);
GL11.glPopMatrix();
}
}
}
- public void renderItem(EntityLivingBase entity, ItemStack itemStack,
- int meta, ItemRenderType type) {
+ public void renderItem(EntityLivingBase entity,
+ ItemStack itemStack, int meta,
+ ItemRenderType type) {
GL11.glPushMatrix();
- TextureManager texturemanager = this.mc.getTextureManager();
+ TextureManager texturemanager = this.mc
+ .getTextureManager();
if (itemStack != null) {
Item item = itemStack.getItem();
Block block = Block.getBlockFromItem(item);
- IItemRenderer customRenderer =
- MinecraftForgeClient.getItemRenderer(itemStack, type);
+ IItemRenderer customRenderer = MinecraftForgeClient
+ .getItemRenderer(itemStack, type);
if (customRenderer != null) {
- texturemanager
- .bindTexture(texturemanager.getResourceLocation(
+ texturemanager.bindTexture(texturemanager
+ .getResourceLocation(
itemStack.getItemSpriteNumber()));
if (type.equals(ItemRenderType.EQUIPPED))
- GL11.glTranslatef(0.7F, 0.55F, 0.55F);
- ForgeHooksClient.renderEquippedItem(type, customRenderer,
- renderBlocksIr, entity, itemStack);
+ GL11.glTranslatef(0.7F, 0.55F,
+ 0.55F);
+ ForgeHooksClient.renderEquippedItem(type,
+ customRenderer,
+ renderBlocksIr, entity,
+ itemStack);
} else if (itemStack.getItemSpriteNumber() == 0
- && item instanceof ItemBlock && RenderBlocks
- .renderItemIn3d(block.getRenderType())) {
- texturemanager.bindTexture(
- texturemanager.getResourceLocation(0));
+ && item instanceof ItemBlock
+ && RenderBlocks.renderItemIn3d(
+ block.getRenderType())) {
+ texturemanager.bindTexture(texturemanager
+ .getResourceLocation(0));
if (type.equals(ItemRenderType.EQUIPPED))
- GL11.glTranslatef(0.5F, 0.5F, 0.5F);
+ GL11.glTranslatef(0.5F, 0.5F,
+ 0.5F);
if (itemStack != null && block != null
&& block.getRenderBlockPass() != 0) {
GL11.glDepthMask(false);
- renderBlockAsItem(block, itemStack.getItemDamage(),
+ renderBlockAsItem(block, itemStack
+ .getItemDamage(),
1.0F);
GL11.glDepthMask(true);
} else {
- renderBlockAsItem(block, itemStack.getItemDamage(),
+ renderBlockAsItem(block, itemStack
+ .getItemDamage(),
1.0F);
}
} else {
@@ -157,10 +177,11 @@ public class ItemRender implements IItemRenderer { GL11.glPopMatrix();
return;
}
- texturemanager
- .bindTexture(texturemanager.getResourceLocation(
+ texturemanager.bindTexture(texturemanager
+ .getResourceLocation(
itemStack.getItemSpriteNumber()));
- TextureUtil.func_152777_a(false, false, 1.0F);
+ TextureUtil.func_152777_a(false, false,
+ 1.0F);
Tessellator tessellator = Tessellator.instance;
float f = iicon.getMinU();
float f1 = iicon.getMaxU();
@@ -170,42 +191,63 @@ public class ItemRender implements IItemRenderer { float f6 = 1.6F;
GL11.glScalef(f6, f6, f6);
if (type.equals(ItemRenderType.ENTITY)) {
- GL11.glTranslatef(0.0F, 0.0265F, 0.0F);
- GL11.glRotatef(-30F, 0.0F, 0.0F, 1.0F);
- GL11.glRotatef(45F, 0.0F, 1.0F, 0.0F);
- GL11.glScalef(0.625F, 0.625F, 0.625F);
+ GL11.glTranslatef(0.0F, 0.0265F,
+ 0.0F);
+ GL11.glRotatef(-30F, 0.0F, 0.0F,
+ 1.0F);
+ GL11.glRotatef(45F, 0.0F, 1.0F,
+ 0.0F);
+ GL11.glScalef(0.625F, 0.625F,
+ 0.625F);
}
- if (!type.equals(ItemRenderType.EQUIPPED_FIRST_PERSON)) {
+ if (!type.equals(
+ ItemRenderType.EQUIPPED_FIRST_PERSON)) {
GL11.glRotatef(45f, 0f, 1f, 0f);
GL11.glRotatef(180f, 0f, 1f, 0f);
GL11.glRotatef(30f, 1f, 0f, 0f);
if (type.equals(ItemRenderType.EQUIPPED)) {
- GL11.glRotatef(35f, 1f, 0f, 0f);
- GL11.glTranslatef(0F, -0.15F, -0.6F);
+ GL11.glRotatef(35f, 1f, 0f,
+ 0f);
+ GL11.glTranslatef(0F,
+ -0.15F,
+ -0.6F);
}
- GL11.glTranslatef(-0.5F, -0.5F, 0.0F);
- } else if (type
- .equals(ItemRenderType.EQUIPPED_FIRST_PERSON)) {
- GL11.glTranslatef(-0.35F, 0.4F, 0.93F);
+ GL11.glTranslatef(-0.5F, -0.5F,
+ 0.0F);
+ } else if (type.equals(
+ ItemRenderType.EQUIPPED_FIRST_PERSON)) {
+ GL11.glTranslatef(-0.35F, 0.4F,
+ 0.93F);
GL11.glRotatef(45f, 0f, 1f, 0f);
GL11.glRotatef(-25f, 0f, 0f, 1f);
}
- if (itemStack.getItem().requiresMultipleRenderPasses()) {
- for (int x = 0; x < itemStack.getItem()
- .getRenderPasses(itemStack.getItemDamage());
- x++) {
- iicon = itemStack.getItem().getIcon(itemStack, x);
+ if (itemStack.getItem()
+ .requiresMultipleRenderPasses()) {
+ for (int x = 0; x < itemStack
+ .getItem()
+ .getRenderPasses(
+ itemStack.getItemDamage()); x++) {
+ iicon = itemStack.getItem()
+ .getIcon(itemStack,
+ x);
f = iicon.getMinU();
f1 = iicon.getMaxU();
f2 = iicon.getMinV();
f3 = iicon.getMaxV();
- ItemRenderer.renderItemIn2D(tessellator, f1, f2, f,
- f3, iicon.getIconWidth(),
- iicon.getIconHeight(), 0.0625F);
+ ItemRenderer.renderItemIn2D(
+ tessellator,
+ f1, f2, f,
+ f3,
+ iicon.getIconWidth(),
+ iicon.getIconHeight(),
+ 0.0625F);
}
} else {
- ItemRenderer.renderItemIn2D(tessellator, f1, f2, f, f3,
- iicon.getIconWidth(), iicon.getIconHeight(),
+ ItemRenderer.renderItemIn2D(
+ tessellator, f1,
+ f2, f, f3,
+ iicon.getIconWidth(),
+ iicon.getIconHeight(),
0.0625F);
}
GL11.glDepthFunc(GL11.GL_EQUAL);
@@ -213,19 +255,21 @@ public class ItemRender implements IItemRenderer { GL11.glPushMatrix();
float f8 = 0.325F;
GL11.glScalef(f8, f8, f8);
- float f9 = (float) (Minecraft.getSystemTime() % 30000L)
+ float f9 = (float) (Minecraft
+ .getSystemTime() % 30000L)
/ 30000.0F * 8.0F;
GL11.glTranslatef(-f9, 0.0F, 0.0F);
GL11.glRotatef(30.0F, 0.0F, 0.0F, 1.0F);
- ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F,
- 1.0F, 256, 256, 0.0625F);
+ ItemRenderer.renderItemIn2D(tessellator,
+ 0.0F, 0.0F, 1.0F, 1.0F,
+ 256, 256, 0.0625F);
GL11.glPopMatrix();
GL11.glMatrixMode(GL11.GL_MODELVIEW);
GL11.glDisable(GL11.GL_BLEND);
GL11.glDepthFunc(GL11.GL_LEQUAL);
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
- texturemanager
- .bindTexture(texturemanager.getResourceLocation(
+ texturemanager.bindTexture(texturemanager
+ .getResourceLocation(
itemStack.getItemSpriteNumber()));
TextureUtil.func_147945_b();
}
@@ -255,51 +299,69 @@ public class ItemRender implements IItemRenderer { f1 = 0.0625F;
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, -1.0F, 0.0F);
- renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D,
- renderBlocksIr.getBlockIconFromSide(block, 0));
+ renderBlocksIr.renderFaceYNeg(block, 0.0D,
+ 0.0D, 0.0D,
+ renderBlocksIr.getBlockIconFromSide(
+ block, 0));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, 1.0F, 0.0F);
- renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D,
- renderBlocksIr.getBlockIconFromSide(block, 1));
+ renderBlocksIr.renderFaceYPos(block, 0.0D,
+ 0.0D, 0.0D,
+ renderBlocksIr.getBlockIconFromSide(
+ block, 1));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, 0.0F, -1.0F);
tessellator.addTranslation(0.0F, 0.0F, f1);
- renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D,
- renderBlocksIr.getBlockIconFromSide(block, 2));
- tessellator.addTranslation(0.0F, 0.0F, -f1);
+ renderBlocksIr.renderFaceZNeg(block, 0.0D,
+ 0.0D, 0.0D,
+ renderBlocksIr.getBlockIconFromSide(
+ block, 2));
+ tessellator.addTranslation(0.0F, 0.0F,
+ -f1);
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, 0.0F, 1.0F);
- tessellator.addTranslation(0.0F, 0.0F, -f1);
- renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D,
- renderBlocksIr.getBlockIconFromSide(block, 3));
+ tessellator.addTranslation(0.0F, 0.0F,
+ -f1);
+ renderBlocksIr.renderFaceZPos(block, 0.0D,
+ 0.0D, 0.0D,
+ renderBlocksIr.getBlockIconFromSide(
+ block, 3));
tessellator.addTranslation(0.0F, 0.0F, f1);
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(-1.0F, 0.0F, 0.0F);
tessellator.addTranslation(f1, 0.0F, 0.0F);
- renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D,
- renderBlocksIr.getBlockIconFromSide(block, 4));
- tessellator.addTranslation(-f1, 0.0F, 0.0F);
+ renderBlocksIr.renderFaceXNeg(block, 0.0D,
+ 0.0D, 0.0D,
+ renderBlocksIr.getBlockIconFromSide(
+ block, 4));
+ tessellator.addTranslation(-f1, 0.0F,
+ 0.0F);
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(1.0F, 0.0F, 0.0F);
- tessellator.addTranslation(-f1, 0.0F, 0.0F);
- renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D,
- renderBlocksIr.getBlockIconFromSide(block, 5));
+ tessellator.addTranslation(-f1, 0.0F,
+ 0.0F);
+ renderBlocksIr.renderFaceXPos(block, 0.0D,
+ 0.0D, 0.0D,
+ renderBlocksIr.getBlockIconFromSide(
+ block, 5));
tessellator.addTranslation(f1, 0.0F, 0.0F);
tessellator.draw();
GL11.glTranslatef(0.0625F, 0.0F, 0.0625F);
- GL11.glScalef(0.9375F - 0.0625F, 1F, 0.9375F - 0.0625F);
+ GL11.glScalef(0.9375F - 0.0625F, 1F,
+ 0.9375F - 0.0625F);
shinyBlock(tessellator, false);
} else if (j == 22) {
// Chest
GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F);
GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
- TileEntityRendererChestHelper.instance.renderChest(block,
- damage, luminacy);
+ TileEntityRendererChestHelper.instance
+ .renderChest(block, damage,
+ luminacy);
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
GL11.glTranslatef(0.0625F, 0.0F, 0.0625F);
GL11.glScalef(0.9375F - 0.0625F, 0.875F,
@@ -309,45 +371,83 @@ public class ItemRender implements IItemRenderer { // Stairs
for (k = 0; k < 2; ++k) {
if (k == 0) {
- renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D,
- 1.0D, 1.0D, 0.5D);
+ renderBlocksIr.setRenderBounds(
+ 0.0D, 0.0D,
+ 0.0D, 1.0D,
+ 1.0D,
+ 0.5D);
}
if (k == 1) {
- renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.5D,
- 1.0D, 0.5D, 1.0D);
+ renderBlocksIr.setRenderBounds(
+ 0.0D, 0.0D,
+ 0.5D, 1.0D,
+ 0.5D,
+ 1.0D);
}
- GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
+ GL11.glTranslatef(-0.5F, -0.5F,
+ -0.5F);
tessellator.startDrawingQuads();
- tessellator.setNormal(0.0F, -1.0F, 0.0F);
- renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D,
- renderBlocksIr.getBlockIconFromSide(block, 0));
+ tessellator.setNormal(0.0F, -1.0F,
+ 0.0F);
+ renderBlocksIr.renderFaceYNeg(
+ block, 0.0D, 0.0D,
+ 0.0D,
+ renderBlocksIr.getBlockIconFromSide(
+ block,
+ 0));
tessellator.draw();
tessellator.startDrawingQuads();
- tessellator.setNormal(0.0F, 1.0F, 0.0F);
- renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D,
- renderBlocksIr.getBlockIconFromSide(block, 1));
+ tessellator.setNormal(0.0F, 1.0F,
+ 0.0F);
+ renderBlocksIr.renderFaceYPos(
+ block, 0.0D, 0.0D,
+ 0.0D,
+ renderBlocksIr.getBlockIconFromSide(
+ block,
+ 1));
tessellator.draw();
tessellator.startDrawingQuads();
- tessellator.setNormal(0.0F, 0.0F, -1.0F);
- renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D,
- renderBlocksIr.getBlockIconFromSide(block, 2));
+ tessellator.setNormal(0.0F, 0.0F,
+ -1.0F);
+ renderBlocksIr.renderFaceZNeg(
+ block, 0.0D, 0.0D,
+ 0.0D,
+ renderBlocksIr.getBlockIconFromSide(
+ block,
+ 2));
tessellator.draw();
tessellator.startDrawingQuads();
- tessellator.setNormal(0.0F, 0.0F, 1.0F);
- renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D,
- renderBlocksIr.getBlockIconFromSide(block, 3));
+ tessellator.setNormal(0.0F, 0.0F,
+ 1.0F);
+ renderBlocksIr.renderFaceZPos(
+ block, 0.0D, 0.0D,
+ 0.0D,
+ renderBlocksIr.getBlockIconFromSide(
+ block,
+ 3));
tessellator.draw();
tessellator.startDrawingQuads();
- tessellator.setNormal(-1.0F, 0.0F, 0.0F);
- renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D,
- renderBlocksIr.getBlockIconFromSide(block, 4));
+ tessellator.setNormal(-1.0F, 0.0F,
+ 0.0F);
+ renderBlocksIr.renderFaceXNeg(
+ block, 0.0D, 0.0D,
+ 0.0D,
+ renderBlocksIr.getBlockIconFromSide(
+ block,
+ 4));
tessellator.draw();
tessellator.startDrawingQuads();
- tessellator.setNormal(1.0F, 0.0F, 0.0F);
- renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D,
- renderBlocksIr.getBlockIconFromSide(block, 5));
+ tessellator.setNormal(1.0F, 0.0F,
+ 0.0F);
+ renderBlocksIr.renderFaceXPos(
+ block, 0.0D, 0.0D,
+ 0.0D,
+ renderBlocksIr.getBlockIconFromSide(
+ block,
+ 5));
tessellator.draw();
- GL11.glTranslatef(0.5F, 0.5F, 0.5F);
+ GL11.glTranslatef(0.5F, 0.5F,
+ 0.5F);
}
} else if (j == 27) {
// Dragon Egg
@@ -386,287 +486,499 @@ public class ItemRender implements IItemRenderer { b0 = 3;
}
float f5 = (float) b0 / 16.0F;
- float f6 = 1.0F - (float) k / 16.0F;
- float f7 = 1.0F - (float) (k + b1) / 16.0F;
+ float f6 = 1.0F - (float) k
+ / 16.0F;
+ float f7 = 1.0F - (float) (k + b1)
+ / 16.0F;
k += b1;
- renderBlocksIr.setRenderBounds((double) (0.5F - f5),
- (double) f7, (double) (0.5F - f5),
- (double) (0.5F + f5), (double) f6,
+ renderBlocksIr.setRenderBounds(
+ (double) (0.5F - f5),
+ (double) f7,
+ (double) (0.5F - f5),
+ (double) (0.5F + f5),
+ (double) f6,
(double) (0.5F + f5));
- tessellator.setNormal(0.0F, -1.0F, 0.0F);
- renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D,
- renderBlocksIr.getBlockIconFromSide(block, 0));
- tessellator.setNormal(0.0F, 1.0F, 0.0F);
- renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D,
- renderBlocksIr.getBlockIconFromSide(block, 1));
- tessellator.setNormal(0.0F, 0.0F, -1.0F);
- renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D,
- renderBlocksIr.getBlockIconFromSide(block, 2));
- tessellator.setNormal(0.0F, 0.0F, 1.0F);
- renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D,
- renderBlocksIr.getBlockIconFromSide(block, 3));
- tessellator.setNormal(-1.0F, 0.0F, 0.0F);
- renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D,
- renderBlocksIr.getBlockIconFromSide(block, 4));
- tessellator.setNormal(1.0F, 0.0F, 0.0F);
- renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D,
- renderBlocksIr.getBlockIconFromSide(block, 5));
+ tessellator.setNormal(0.0F, -1.0F,
+ 0.0F);
+ renderBlocksIr.renderFaceYNeg(
+ block, 0.0D, 0.0D,
+ 0.0D,
+ renderBlocksIr.getBlockIconFromSide(
+ block,
+ 0));
+ tessellator.setNormal(0.0F, 1.0F,
+ 0.0F);
+ renderBlocksIr.renderFaceYPos(
+ block, 0.0D, 0.0D,
+ 0.0D,
+ renderBlocksIr.getBlockIconFromSide(
+ block,
+ 1));
+ tessellator.setNormal(0.0F, 0.0F,
+ -1.0F);
+ renderBlocksIr.renderFaceZNeg(
+ block, 0.0D, 0.0D,
+ 0.0D,
+ renderBlocksIr.getBlockIconFromSide(
+ block,
+ 2));
+ tessellator.setNormal(0.0F, 0.0F,
+ 1.0F);
+ renderBlocksIr.renderFaceZPos(
+ block, 0.0D, 0.0D,
+ 0.0D,
+ renderBlocksIr.getBlockIconFromSide(
+ block,
+ 3));
+ tessellator.setNormal(-1.0F, 0.0F,
+ 0.0F);
+ renderBlocksIr.renderFaceXNeg(
+ block, 0.0D, 0.0D,
+ 0.0D,
+ renderBlocksIr.getBlockIconFromSide(
+ block,
+ 4));
+ tessellator.setNormal(1.0F, 0.0F,
+ 0.0F);
+ renderBlocksIr.renderFaceXPos(
+ block, 0.0D, 0.0D,
+ 0.0D,
+ renderBlocksIr.getBlockIconFromSide(
+ block,
+ 5));
}
tessellator.draw();
GL11.glTranslatef(0.5F, 0.5F, 0.5F);
- renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D,
- 1.0D, 1.0D);
+ renderBlocksIr.setRenderBounds(0.0D, 0.0D,
+ 0.0D, 1.0D, 1.0D, 1.0D);
} else if (j == 11) {
// Fence
for (k = 0; k < 4; ++k) {
f2 = 0.125F;
if (k == 0) {
renderBlocksIr.setRenderBounds(
- (double) (0.5F - f2), 0.0D, 0.0D,
- (double) (0.5F + f2), 1.0D,
+ (double) (0.5F - f2),
+ 0.0D, 0.0D,
+ (double) (0.5F + f2),
+ 1.0D,
(double) (f2 * 2.0F));
}
if (k == 1) {
renderBlocksIr.setRenderBounds(
- (double) (0.5F - f2), 0.0D,
- (double) (1.0F - f2 * 2.0F),
- (double) (0.5F + f2), 1.0D, 1.0D);
+ (double) (0.5F - f2),
+ 0.0D,
+ (double) (1.0F - f2
+ * 2.0F),
+ (double) (0.5F + f2),
+ 1.0D,
+ 1.0D);
}
f2 = 0.0625F;
if (k == 2) {
renderBlocksIr.setRenderBounds(
(double) (0.5F - f2),
- (double) (1.0F - f2 * 3.0F),
+ (double) (1.0F - f2
+ * 3.0F),
(double) (-f2 * 2.0F),
- (double) (0.5F + f2), (double) (1.0F - f2),
- (double) (1.0F + f2 * 2.0F));
+ (double) (0.5F + f2),
+ (double) (1.0F - f2),
+ (double) (1.0F + f2
+ * 2.0F));
}
if (k == 3) {
renderBlocksIr.setRenderBounds(
(double) (0.5F - f2),
- (double) (0.5F - f2 * 3.0F),
+ (double) (0.5F - f2
+ * 3.0F),
(double) (-f2 * 2.0F),
- (double) (0.5F + f2), (double) (0.5F - f2),
- (double) (1.0F + f2 * 2.0F));
+ (double) (0.5F + f2),
+ (double) (0.5F - f2),
+ (double) (1.0F + f2
+ * 2.0F));
}
- GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
+ GL11.glTranslatef(-0.5F, -0.5F,
+ -0.5F);
tessellator.startDrawingQuads();
- tessellator.setNormal(0.0F, -1.0F, 0.0F);
- renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D,
- renderBlocksIr.getBlockIconFromSide(block, 0));
+ tessellator.setNormal(0.0F, -1.0F,
+ 0.0F);
+ renderBlocksIr.renderFaceYNeg(
+ block, 0.0D, 0.0D,
+ 0.0D,
+ renderBlocksIr.getBlockIconFromSide(
+ block,
+ 0));
tessellator.draw();
tessellator.startDrawingQuads();
- tessellator.setNormal(0.0F, 1.0F, 0.0F);
- renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D,
- renderBlocksIr.getBlockIconFromSide(block, 1));
+ tessellator.setNormal(0.0F, 1.0F,
+ 0.0F);
+ renderBlocksIr.renderFaceYPos(
+ block, 0.0D, 0.0D,
+ 0.0D,
+ renderBlocksIr.getBlockIconFromSide(
+ block,
+ 1));
tessellator.draw();
tessellator.startDrawingQuads();
- tessellator.setNormal(0.0F, 0.0F, -1.0F);
- renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D,
- renderBlocksIr.getBlockIconFromSide(block, 2));
+ tessellator.setNormal(0.0F, 0.0F,
+ -1.0F);
+ renderBlocksIr.renderFaceZNeg(
+ block, 0.0D, 0.0D,
+ 0.0D,
+ renderBlocksIr.getBlockIconFromSide(
+ block,
+ 2));
tessellator.draw();
tessellator.startDrawingQuads();
- tessellator.setNormal(0.0F, 0.0F, 1.0F);
- renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D,
- renderBlocksIr.getBlockIconFromSide(block, 3));
+ tessellator.setNormal(0.0F, 0.0F,
+ 1.0F);
+ renderBlocksIr.renderFaceZPos(
+ block, 0.0D, 0.0D,
+ 0.0D,
+ renderBlocksIr.getBlockIconFromSide(
+ block,
+ 3));
tessellator.draw();
tessellator.startDrawingQuads();
- tessellator.setNormal(-1.0F, 0.0F, 0.0F);
- renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D,
- renderBlocksIr.getBlockIconFromSide(block, 4));
+ tessellator.setNormal(-1.0F, 0.0F,
+ 0.0F);
+ renderBlocksIr.renderFaceXNeg(
+ block, 0.0D, 0.0D,
+ 0.0D,
+ renderBlocksIr.getBlockIconFromSide(
+ block,
+ 4));
tessellator.draw();
tessellator.startDrawingQuads();
- tessellator.setNormal(1.0F, 0.0F, 0.0F);
- renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D,
- renderBlocksIr.getBlockIconFromSide(block, 5));
+ tessellator.setNormal(1.0F, 0.0F,
+ 0.0F);
+ renderBlocksIr.renderFaceXPos(
+ block, 0.0D, 0.0D,
+ 0.0D,
+ renderBlocksIr.getBlockIconFromSide(
+ block,
+ 5));
tessellator.draw();
- GL11.glTranslatef(0.5F, 0.5F, 0.5F);
+ GL11.glTranslatef(0.5F, 0.5F,
+ 0.5F);
}
- renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D,
- 1.0D, 1.0D);
+ renderBlocksIr.setRenderBounds(0.0D, 0.0D,
+ 0.0D, 1.0D, 1.0D, 1.0D);
} else if (j == 21) {
// Fence Gate
for (k = 0; k < 3; ++k) {
f2 = 0.0625F;
if (k == 0) {
renderBlocksIr.setRenderBounds(
- (double) (0.5F - f2), 0.30000001192092896D,
- 0.0D, (double) (0.5F + f2), 1.0D,
+ (double) (0.5F - f2),
+ 0.30000001192092896D,
+ 0.0D,
+ (double) (0.5F + f2),
+ 1.0D,
(double) (f2 * 2.0F));
}
if (k == 1) {
renderBlocksIr.setRenderBounds(
- (double) (0.5F - f2), 0.30000001192092896D,
- (double) (1.0F - f2 * 2.0F),
- (double) (0.5F + f2), 1.0D, 1.0D);
+ (double) (0.5F - f2),
+ 0.30000001192092896D,
+ (double) (1.0F - f2
+ * 2.0F),
+ (double) (0.5F + f2),
+ 1.0D,
+ 1.0D);
}
f2 = 0.0625F;
if (k == 2) {
renderBlocksIr.setRenderBounds(
- (double) (0.5F - f2), 0.5D, 0.0D,
- (double) (0.5F + f2), (double) (1.0F - f2),
+ (double) (0.5F - f2),
+ 0.5D, 0.0D,
+ (double) (0.5F + f2),
+ (double) (1.0F - f2),
1.0D);
}
- GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
+ GL11.glTranslatef(-0.5F, -0.5F,
+ -0.5F);
tessellator.startDrawingQuads();
- tessellator.setNormal(0.0F, -1.0F, 0.0F);
- renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D,
- renderBlocksIr.getBlockIconFromSide(block, 0));
+ tessellator.setNormal(0.0F, -1.0F,
+ 0.0F);
+ renderBlocksIr.renderFaceYNeg(
+ block, 0.0D, 0.0D,
+ 0.0D,
+ renderBlocksIr.getBlockIconFromSide(
+ block,
+ 0));
tessellator.draw();
tessellator.startDrawingQuads();
- tessellator.setNormal(0.0F, 1.0F, 0.0F);
- renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D,
- renderBlocksIr.getBlockIconFromSide(block, 1));
+ tessellator.setNormal(0.0F, 1.0F,
+ 0.0F);
+ renderBlocksIr.renderFaceYPos(
+ block, 0.0D, 0.0D,
+ 0.0D,
+ renderBlocksIr.getBlockIconFromSide(
+ block,
+ 1));
tessellator.draw();
tessellator.startDrawingQuads();
- tessellator.setNormal(0.0F, 0.0F, -1.0F);
- renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D,
- renderBlocksIr.getBlockIconFromSide(block, 2));
+ tessellator.setNormal(0.0F, 0.0F,
+ -1.0F);
+ renderBlocksIr.renderFaceZNeg(
+ block, 0.0D, 0.0D,
+ 0.0D,
+ renderBlocksIr.getBlockIconFromSide(
+ block,
+ 2));
tessellator.draw();
tessellator.startDrawingQuads();
- tessellator.setNormal(0.0F, 0.0F, 1.0F);
- renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D,
- renderBlocksIr.getBlockIconFromSide(block, 3));
+ tessellator.setNormal(0.0F, 0.0F,
+ 1.0F);
+ renderBlocksIr.renderFaceZPos(
+ block, 0.0D, 0.0D,
+ 0.0D,
+ renderBlocksIr.getBlockIconFromSide(
+ block,
+ 3));
tessellator.draw();
tessellator.startDrawingQuads();
- tessellator.setNormal(-1.0F, 0.0F, 0.0F);
- renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D,
- renderBlocksIr.getBlockIconFromSide(block, 4));
+ tessellator.setNormal(-1.0F, 0.0F,
+ 0.0F);
+ renderBlocksIr.renderFaceXNeg(
+ block, 0.0D, 0.0D,
+ 0.0D,
+ renderBlocksIr.getBlockIconFromSide(
+ block,
+ 4));
tessellator.draw();
tessellator.startDrawingQuads();
- tessellator.setNormal(1.0F, 0.0F, 0.0F);
- renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D,
- renderBlocksIr.getBlockIconFromSide(block, 5));
+ tessellator.setNormal(1.0F, 0.0F,
+ 0.0F);
+ renderBlocksIr.renderFaceXPos(
+ block, 0.0D, 0.0D,
+ 0.0D,
+ renderBlocksIr.getBlockIconFromSide(
+ block,
+ 5));
tessellator.draw();
- GL11.glTranslatef(0.5F, 0.5F, 0.5F);
+ GL11.glTranslatef(0.5F, 0.5F,
+ 0.5F);
}
} else if (j == 32) {
// Wall
for (k = 0; k < 2; ++k) {
if (k == 0) {
- renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.3125D,
- 1.0D, 0.8125D, 0.6875D);
+ renderBlocksIr.setRenderBounds(
+ 0.0D, 0.0D,
+ 0.3125D,
+ 1.0D,
+ 0.8125D,
+ 0.6875D);
}
if (k == 1) {
- renderBlocksIr.setRenderBounds(0.25D, 0.0D, 0.25D,
- 0.75D, 1.0D, 0.75D);
+ renderBlocksIr.setRenderBounds(
+ 0.25D,
+ 0.0D,
+ 0.25D,
+ 0.75D,
+ 1.0D,
+ 0.75D);
}
- GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
+ GL11.glTranslatef(-0.5F, -0.5F,
+ -0.5F);
tessellator.startDrawingQuads();
- tessellator.setNormal(0.0F, -1.0F, 0.0F);
- renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D,
+ tessellator.setNormal(0.0F, -1.0F,
+ 0.0F);
+ renderBlocksIr.renderFaceYNeg(
+ block, 0.0D, 0.0D,
+ 0.0D,
renderBlocksIr.getBlockIconFromSideAndMetadata(
- block, 0, damage));
+ block,
+ 0,
+ damage));
tessellator.draw();
tessellator.startDrawingQuads();
- tessellator.setNormal(0.0F, 1.0F, 0.0F);
- renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D,
+ tessellator.setNormal(0.0F, 1.0F,
+ 0.0F);
+ renderBlocksIr.renderFaceYPos(
+ block, 0.0D, 0.0D,
+ 0.0D,
renderBlocksIr.getBlockIconFromSideAndMetadata(
- block, 1, damage));
+ block,
+ 1,
+ damage));
tessellator.draw();
tessellator.startDrawingQuads();
- tessellator.setNormal(0.0F, 0.0F, -1.0F);
- renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D,
+ tessellator.setNormal(0.0F, 0.0F,
+ -1.0F);
+ renderBlocksIr.renderFaceZNeg(
+ block, 0.0D, 0.0D,
+ 0.0D,
renderBlocksIr.getBlockIconFromSideAndMetadata(
- block, 2, damage));
+ block,
+ 2,
+ damage));
tessellator.draw();
tessellator.startDrawingQuads();
- tessellator.setNormal(0.0F, 0.0F, 1.0F);
- renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D,
+ tessellator.setNormal(0.0F, 0.0F,
+ 1.0F);
+ renderBlocksIr.renderFaceZPos(
+ block, 0.0D, 0.0D,
+ 0.0D,
renderBlocksIr.getBlockIconFromSideAndMetadata(
- block, 3, damage));
+ block,
+ 3,
+ damage));
tessellator.draw();
tessellator.startDrawingQuads();
- tessellator.setNormal(-1.0F, 0.0F, 0.0F);
- renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D,
+ tessellator.setNormal(-1.0F, 0.0F,
+ 0.0F);
+ renderBlocksIr.renderFaceXNeg(
+ block, 0.0D, 0.0D,
+ 0.0D,
renderBlocksIr.getBlockIconFromSideAndMetadata(
- block, 4, damage));
+ block,
+ 4,
+ damage));
tessellator.draw();
tessellator.startDrawingQuads();
- tessellator.setNormal(1.0F, 0.0F, 0.0F);
- renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D,
+ tessellator.setNormal(1.0F, 0.0F,
+ 0.0F);
+ renderBlocksIr.renderFaceXPos(
+ block, 0.0D, 0.0D,
+ 0.0D,
renderBlocksIr.getBlockIconFromSideAndMetadata(
- block, 5, damage));
+ block,
+ 5,
+ damage));
tessellator.draw();
- GL11.glTranslatef(0.5F, 0.5F, 0.5F);
+ GL11.glTranslatef(0.5F, 0.5F,
+ 0.5F);
}
- renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D,
- 1.0D, 1.0D);
+ renderBlocksIr.setRenderBounds(0.0D, 0.0D,
+ 0.0D, 1.0D, 1.0D, 1.0D);
} else if (j == 35) {
// Anvil
GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
- renderBlocksIr.renderBlockAnvilOrient((BlockAnvil) block,
- 0, 0, 0, damage << 2, true);
+ renderBlocksIr.renderBlockAnvilOrient(
+ (BlockAnvil) block, 0, 0,
+ 0, damage << 2, true);
GL11.glTranslatef(0.5F, 0.5F, 0.5F);
} else if (j == 34) {
// Beacon
for (k = 0; k < 3; ++k) {
if (k == 0) {
- renderBlocksIr.setRenderBounds(0.125D, 0.0D,
- 0.125D, 0.875D, 0.1875D, 0.875D);
- renderBlocksIr
- .setOverrideBlockTexture(renderBlocksIr
- .getBlockIcon(Blocks.obsidian));
+ renderBlocksIr.setRenderBounds(
+ 0.125D,
+ 0.0D,
+ 0.125D,
+ 0.875D,
+ 0.1875D,
+ 0.875D);
+ renderBlocksIr.setOverrideBlockTexture(
+ renderBlocksIr.getBlockIcon(
+ Blocks.obsidian));
} else if (k == 1) {
- renderBlocksIr.setRenderBounds(0.1875D, 0.1875D,
- 0.1875D, 0.8125D, 0.875D, 0.8125D);
- renderBlocksIr
- .setOverrideBlockTexture(renderBlocksIr
- .getBlockIcon(Blocks.beacon));
+ renderBlocksIr.setRenderBounds(
+ 0.1875D,
+ 0.1875D,
+ 0.1875D,
+ 0.8125D,
+ 0.875D,
+ 0.8125D);
+ renderBlocksIr.setOverrideBlockTexture(
+ renderBlocksIr.getBlockIcon(
+ Blocks.beacon));
} else if (k == 2) {
- renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D,
- 1.0D, 1.0D, 1.0D);
+ renderBlocksIr.setRenderBounds(
+ 0.0D, 0.0D,
+ 0.0D, 1.0D,
+ 1.0D,
+ 1.0D);
renderBlocksIr.setOverrideBlockTexture(
- renderBlocksIr.getBlockIcon(Blocks.glass));
+ renderBlocksIr.getBlockIcon(
+ Blocks.glass));
}
- GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
+ GL11.glTranslatef(-0.5F, -0.5F,
+ -0.5F);
tessellator.startDrawingQuads();
- tessellator.setNormal(0.0F, -1.0F, 0.0F);
- renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D,
+ tessellator.setNormal(0.0F, -1.0F,
+ 0.0F);
+ renderBlocksIr.renderFaceYNeg(
+ block, 0.0D, 0.0D,
+ 0.0D,
renderBlocksIr.getBlockIconFromSideAndMetadata(
- block, 0, damage));
+ block,
+ 0,
+ damage));
tessellator.draw();
tessellator.startDrawingQuads();
- tessellator.setNormal(0.0F, 1.0F, 0.0F);
- renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D,
+ tessellator.setNormal(0.0F, 1.0F,
+ 0.0F);
+ renderBlocksIr.renderFaceYPos(
+ block, 0.0D, 0.0D,
+ 0.0D,
renderBlocksIr.getBlockIconFromSideAndMetadata(
- block, 1, damage));
+ block,
+ 1,
+ damage));
tessellator.draw();
tessellator.startDrawingQuads();
- tessellator.setNormal(0.0F, 0.0F, -1.0F);
- renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D,
+ tessellator.setNormal(0.0F, 0.0F,
+ -1.0F);
+ renderBlocksIr.renderFaceZNeg(
+ block, 0.0D, 0.0D,
+ 0.0D,
renderBlocksIr.getBlockIconFromSideAndMetadata(
- block, 2, damage));
+ block,
+ 2,
+ damage));
tessellator.draw();
tessellator.startDrawingQuads();
- tessellator.setNormal(0.0F, 0.0F, 1.0F);
- renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D,
+ tessellator.setNormal(0.0F, 0.0F,
+ 1.0F);
+ renderBlocksIr.renderFaceZPos(
+ block, 0.0D, 0.0D,
+ 0.0D,
renderBlocksIr.getBlockIconFromSideAndMetadata(
- block, 3, damage));
+ block,
+ 3,
+ damage));
tessellator.draw();
tessellator.startDrawingQuads();
- tessellator.setNormal(-1.0F, 0.0F, 0.0F);
- renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D,
+ tessellator.setNormal(-1.0F, 0.0F,
+ 0.0F);
+ renderBlocksIr.renderFaceXNeg(
+ block, 0.0D, 0.0D,
+ 0.0D,
renderBlocksIr.getBlockIconFromSideAndMetadata(
- block, 4, damage));
+ block,
+ 4,
+ damage));
tessellator.draw();
tessellator.startDrawingQuads();
- tessellator.setNormal(1.0F, 0.0F, 0.0F);
- renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D,
+ tessellator.setNormal(1.0F, 0.0F,
+ 0.0F);
+ renderBlocksIr.renderFaceXPos(
+ block, 0.0D, 0.0D,
+ 0.0D,
renderBlocksIr.getBlockIconFromSideAndMetadata(
- block, 5, damage));
+ block,
+ 5,
+ damage));
tessellator.draw();
- GL11.glTranslatef(0.5F, 0.5F, 0.5F);
+ GL11.glTranslatef(0.5F, 0.5F,
+ 0.5F);
}
- renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D,
- 1.0D, 1.0D);
+ renderBlocksIr.setRenderBounds(0.0D, 0.0D,
+ 0.0D, 1.0D, 1.0D, 1.0D);
renderBlocksIr.clearOverrideBlockTexture();
GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
shinyBlock(tessellator, false);
} else {
try {
- FMLRenderAccessLibrary.renderInventoryBlock(
- renderBlocksIr, block, damage, j);
+ FMLRenderAccessLibrary
+ .renderInventoryBlock(
+ renderBlocksIr,
+ block,
+ damage,
+ j);
} catch (Exception e) {
JewelrycraftMod.logger.error(
"Something went wrong with rendering the item");
@@ -683,48 +995,54 @@ public class ItemRender implements IItemRenderer { GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, -1.0F, 0.0F);
- renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D,
- renderBlocksIr.getBlockIconFromSideAndMetadata(block,
- 0, damage));
+ renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D,
+ 0.0D,
+ renderBlocksIr.getBlockIconFromSideAndMetadata(
+ block, 0, damage));
tessellator.draw();
GL11.glColor4f(1F, 1F, 0F, 1.0F);
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, 1.0F, 0.0F);
- renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D,
- renderBlocksIr.getBlockIconFromSideAndMetadata(block,
- 1, damage));
+ renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D,
+ 0.0D,
+ renderBlocksIr.getBlockIconFromSideAndMetadata(
+ block, 1, damage));
tessellator.draw();
GL11.glColor4f(1F, 1F, 0F, 1.0F);
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, 0.0F, -1.0F);
- renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D,
- renderBlocksIr.getBlockIconFromSideAndMetadata(block,
- 2, damage));
+ renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D,
+ 0.0D,
+ renderBlocksIr.getBlockIconFromSideAndMetadata(
+ block, 2, damage));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, 0.0F, 1.0F);
- renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D,
- renderBlocksIr.getBlockIconFromSideAndMetadata(block,
- 3, damage));
+ renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D,
+ 0.0D,
+ renderBlocksIr.getBlockIconFromSideAndMetadata(
+ block, 3, damage));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(-1.0F, 0.0F, 0.0F);
- renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D,
- renderBlocksIr.getBlockIconFromSideAndMetadata(block,
- 4, damage));
+ renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D,
+ 0.0D,
+ renderBlocksIr.getBlockIconFromSideAndMetadata(
+ block, 4, damage));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(1.0F, 0.0F, 0.0F);
- renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D,
- renderBlocksIr.getBlockIconFromSideAndMetadata(block,
- 5, damage));
+ renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D,
+ 0.0D,
+ renderBlocksIr.getBlockIconFromSideAndMetadata(
+ block, 5, damage));
tessellator.draw();
- GL11.glTranslatef((float) block.getBlockBoundsMinX(),
+ GL11.glTranslatef(
+ (float) block.getBlockBoundsMinX(),
(float) block.getBlockBoundsMinY(),
(float) block.getBlockBoundsMinZ());
- GL11.glScalef(
- (float) block.getBlockBoundsMaxX()
- - (float) block.getBlockBoundsMinX(),
+ GL11.glScalef((float) block.getBlockBoundsMaxX()
+ - (float) block.getBlockBoundsMinX(),
(float) block.getBlockBoundsMaxY()
- (float) block.getBlockBoundsMinY(),
(float) block.getBlockBoundsMaxZ()
@@ -734,8 +1052,10 @@ public class ItemRender implements IItemRenderer { }
}
- public void renderShine(Tessellator tessellator, boolean autoAnimate) {
- TextureManager texturemanager = this.mc.getTextureManager();
+ public void renderShine(Tessellator tessellator,
+ boolean autoAnimate) {
+ TextureManager texturemanager = this.mc
+ .getTextureManager();
texturemanager.bindTexture(RES_ITEM_GLINT);
GL11.glEnable(GL11.GL_BLEND);
OpenGlHelper.glBlendFunc(768, 1, 1, 0);
@@ -753,12 +1073,13 @@ public class ItemRender implements IItemRenderer { }
GL11.glRotatef(-30.0F, 0.0F, 0.0F, 1.0F);
GL11.glColor3f(1F, 1F, 0F);
- ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F,
- 256, 256, 0.001F);
+ ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F,
+ 1.0F, 256, 256, 0.001F);
GL11.glPopMatrix();
}
- public void shinyBlock(Tessellator tessellator, boolean autoAnimate) {
+ public void shinyBlock(Tessellator tessellator,
+ boolean autoAnimate) {
GL11.glPushMatrix();
GL11.glTranslatef(0F, 0.0F, -0.001F);
renderShine(tessellator, autoAnimate);
diff --git a/src/main/java/darkknight/jewelrycraft/item/render/MaskRender.java b/src/main/java/darkknight/jewelrycraft/item/render/MaskRender.java index d967cef..dd671e2 100755 --- a/src/main/java/darkknight/jewelrycraft/item/render/MaskRender.java +++ b/src/main/java/darkknight/jewelrycraft/item/render/MaskRender.java @@ -11,9 +11,9 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.util.ResourceLocation;
public class MaskRender extends TileEntitySpecialRenderer {
- ModelMask mask = new ModelMask();
- ResourceLocation texture = new ResourceLocation(Variables.MODID,
- "textures/entities/Mask.png");
+ ModelMask mask = new ModelMask();
+ ResourceLocation texture = new ResourceLocation(
+ Variables.MODID, "textures/entities/Mask.png");
@Override
public void renderTileEntityAt(TileEntity te, double x, double y,
diff --git a/src/main/java/darkknight/jewelrycraft/item/render/NecklaceRender.java b/src/main/java/darkknight/jewelrycraft/item/render/NecklaceRender.java index 5134559..c021e7a 100755 --- a/src/main/java/darkknight/jewelrycraft/item/render/NecklaceRender.java +++ b/src/main/java/darkknight/jewelrycraft/item/render/NecklaceRender.java @@ -12,7 +12,7 @@ import net.minecraft.util.ResourceLocation; public class NecklaceRender extends TileEntitySpecialRenderer {
public ModelNeckalce neckalce = new ModelNeckalce();
- ResourceLocation texture = new ResourceLocation(
+ ResourceLocation texture = new ResourceLocation(
Variables.MODID, "textures/entities/Necklace.png");
@Override
@@ -25,7 +25,8 @@ public class NecklaceRender extends TileEntitySpecialRenderer { GL11.glPushMatrix();
Minecraft.getMinecraft().renderEngine.bindTexture(texture);
if ((float) z != -1)
- neckalce.render(entity, 0F, 0F, 0F, (float) z, f, 1.0F);
+ neckalce.render(entity, 0F, 0F, 0F, (float) z, f,
+ 1.0F);
GL11.glPopMatrix();
}
}
\ No newline at end of file diff --git a/src/main/java/darkknight/jewelrycraft/item/render/RingRender.java b/src/main/java/darkknight/jewelrycraft/item/render/RingRender.java index 88083ab..1cde268 100755 --- a/src/main/java/darkknight/jewelrycraft/item/render/RingRender.java +++ b/src/main/java/darkknight/jewelrycraft/item/render/RingRender.java @@ -12,8 +12,8 @@ import net.minecraft.util.ResourceLocation; public class RingRender extends TileEntitySpecialRenderer {
public ModelRing ring = new ModelRing();
- ResourceLocation texture = new ResourceLocation(Variables.MODID,
- "textures/entities/Ring.png");
+ ResourceLocation texture = new ResourceLocation(
+ Variables.MODID, "textures/entities/Ring.png");
@Override
public void renderTileEntityAt(TileEntity te, double x, double y,
@@ -25,7 +25,8 @@ public class RingRender extends TileEntitySpecialRenderer { GL11.glPushMatrix();
Minecraft.getMinecraft().renderEngine.bindTexture(texture);
if ((float) z != -1)
- ring.render(entity, 0F, 0F, 0F, (float) z, f, 1.0F);
+ ring.render(entity, 0F, 0F, 0F, (float) z, f,
+ 1.0F);
GL11.glPopMatrix();
}
}
\ No newline at end of file diff --git a/src/main/java/darkknight/jewelrycraft/model/ItemStackModelRenderer.java b/src/main/java/darkknight/jewelrycraft/model/ItemStackModelRenderer.java index 9a5539b..fe5a183 100755 --- a/src/main/java/darkknight/jewelrycraft/model/ItemStackModelRenderer.java +++ b/src/main/java/darkknight/jewelrycraft/model/ItemStackModelRenderer.java @@ -16,11 +16,11 @@ import net.minecraft.util.ResourceLocation; * @author Paul Fulham (pau101)
*/
public class ItemStackModelRenderer extends ModelRenderer {
- private RenderItem renderItem;
+ private RenderItem renderItem;
private TextureManager textureManager;
private ResourceLocation resetResourceLocation;
- private EntityItem entityItem;
- private Minecraft mc;
+ private EntityItem entityItem;
+ private Minecraft mc;
/**
* @param modelBase
@@ -31,8 +31,8 @@ public class ItemStackModelRenderer extends ModelRenderer { super(modelBase);
renderItem = (RenderItem) RenderManager.instance.entityRenderMap
.get(EntityItem.class);
- textureManager =
- (mc = Minecraft.getMinecraft()).getTextureManager();
+ textureManager = (mc = Minecraft.getMinecraft())
+ .getTextureManager();
this.resetResourceLocation = resetResourceLocation;
}
@@ -43,7 +43,8 @@ public class ItemStackModelRenderer extends ModelRenderer { if (itemStack == null || itemStack.getItem() == null)
entityItem = null;
else {
- entityItem = new EntityItem(null, 0, 0, 0, itemStack);
+ entityItem = new EntityItem(null, 0, 0, 0,
+ itemStack);
entityItem.hoverStart = 0;
}
}
@@ -59,12 +60,16 @@ public class ItemStackModelRenderer extends ModelRenderer { GL11.glPushMatrix();
GL11.glTranslatef(offsetX, offsetY, offsetZ);
GL11.glTranslatef(rotationPointX * scale,
- rotationPointY * scale, rotationPointZ * scale);
- GL11.glRotatef(rotateAngleZ * (180 / (float) Math.PI), 0, 0,
+ rotationPointY * scale,
+ rotationPointZ * scale);
+ GL11.glRotatef(rotateAngleZ
+ * (180 / (float) Math.PI), 0, 0,
1);
- GL11.glRotatef(rotateAngleY * (180 / (float) Math.PI), 0, 1,
+ GL11.glRotatef(rotateAngleY
+ * (180 / (float) Math.PI), 0, 1,
0);
- GL11.glRotatef(rotateAngleX * (180 / (float) Math.PI), 1, 0,
+ GL11.glRotatef(rotateAngleX
+ * (180 / (float) Math.PI), 1, 0,
0);
boolean fancyGraphics = mc.gameSettings.fancyGraphics;
mc.gameSettings.fancyGraphics = true;
diff --git a/src/main/java/darkknight/jewelrycraft/model/ModelBracelet.java b/src/main/java/darkknight/jewelrycraft/model/ModelBracelet.java index 08a092a..f63e4bf 100755 --- a/src/main/java/darkknight/jewelrycraft/model/ModelBracelet.java +++ b/src/main/java/darkknight/jewelrycraft/model/ModelBracelet.java @@ -33,7 +33,8 @@ public class ModelBracelet extends ModelBase { this.gem4 = new ModelRenderer(this, 0, 0); this.gem4.setRotationPoint(-3.0F, 12.8F, -3.5F); this.gem4.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.setRotateAngle(gem4, 0.0F, 0.008901179185171082F, 0.0F); + this.setRotateAngle(gem4, 0.0F, 0.008901179185171082F, + 0.0F); this.gem3 = new ModelRenderer(this, 0, 0); this.gem3.setRotationPoint(-4.8F, 12.2F, -3.5F); this.gem3.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); @@ -78,7 +79,8 @@ public class ModelBracelet extends ModelBase { int red = (ingotColor >> 16) & 0xff; int green = (ingotColor >> 8) & 0xff; int blue = ingotColor & 0xff; - GL11.glColor3f((float) red / 255, (float) green / 255, + GL11.glColor3f((float) red / 255, + (float) green / 255, (float) blue / 255); this.metal1.render(f5); this.metal2.render(f5); @@ -90,19 +92,22 @@ public class ModelBracelet extends ModelBase { int red = gemColor >> 16 & 0xff; int green = gemColor >> 8 & 0xff; int blue = gemColor & 0xff; - GL11.glColor3f((float) red / 255, (float) green / 255, + GL11.glColor3f((float) red / 255, + (float) green / 255, (float) blue / 255); GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE_MINUS_DST_COLOR); GL11.glPushMatrix(); - GL11.glTranslatef(this.gem4.offsetX, this.gem4.offsetY, + GL11.glTranslatef(this.gem4.offsetX, + this.gem4.offsetY, this.gem4.offsetZ); GL11.glTranslatef(this.gem4.rotationPointX * f5, this.gem4.rotationPointY * f5, this.gem4.rotationPointZ * f5); GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem4.offsetX, -this.gem4.offsetY, + GL11.glTranslatef(-this.gem4.offsetX, + -this.gem4.offsetY, -this.gem4.offsetZ); GL11.glTranslatef(-this.gem4.rotationPointX * f5, -this.gem4.rotationPointY * f5, @@ -110,13 +115,15 @@ public class ModelBracelet extends ModelBase { this.gem4.render(f5); GL11.glPopMatrix(); GL11.glPushMatrix(); - GL11.glTranslatef(this.gem3.offsetX, this.gem3.offsetY, + GL11.glTranslatef(this.gem3.offsetX, + this.gem3.offsetY, this.gem3.offsetZ); GL11.glTranslatef(this.gem3.rotationPointX * f5, this.gem3.rotationPointY * f5, this.gem3.rotationPointZ * f5); GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem3.offsetX, -this.gem3.offsetY, + GL11.glTranslatef(-this.gem3.offsetX, + -this.gem3.offsetY, -this.gem3.offsetZ); GL11.glTranslatef(-this.gem3.rotationPointX * f5, -this.gem3.rotationPointY * f5, @@ -124,13 +131,15 @@ public class ModelBracelet extends ModelBase { this.gem3.render(f5); GL11.glPopMatrix(); GL11.glPushMatrix(); - GL11.glTranslatef(this.gem2.offsetX, this.gem2.offsetY, + GL11.glTranslatef(this.gem2.offsetX, + this.gem2.offsetY, this.gem2.offsetZ); GL11.glTranslatef(this.gem2.rotationPointX * f5, this.gem2.rotationPointY * f5, this.gem2.rotationPointZ * f5); GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem2.offsetX, -this.gem2.offsetY, + GL11.glTranslatef(-this.gem2.offsetX, + -this.gem2.offsetY, -this.gem2.offsetZ); GL11.glTranslatef(-this.gem2.rotationPointX * f5, -this.gem2.rotationPointY * f5, @@ -138,13 +147,15 @@ public class ModelBracelet extends ModelBase { this.gem2.render(f5); GL11.glPopMatrix(); GL11.glPushMatrix(); - GL11.glTranslatef(this.gem1.offsetX, this.gem1.offsetY, + GL11.glTranslatef(this.gem1.offsetX, + this.gem1.offsetY, this.gem1.offsetZ); GL11.glTranslatef(this.gem1.rotationPointX * f5, this.gem1.rotationPointY * f5, this.gem1.rotationPointZ * f5); GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem1.offsetX, -this.gem1.offsetY, + GL11.glTranslatef(-this.gem1.offsetX, + -this.gem1.offsetY, -this.gem1.offsetZ); GL11.glTranslatef(-this.gem1.rotationPointX * f5, -this.gem1.rotationPointY * f5, @@ -152,13 +163,15 @@ public class ModelBracelet extends ModelBase { this.gem1.render(f5); GL11.glPopMatrix(); GL11.glPushMatrix(); - GL11.glTranslatef(this.gem6.offsetX, this.gem6.offsetY, + GL11.glTranslatef(this.gem6.offsetX, + this.gem6.offsetY, this.gem6.offsetZ); GL11.glTranslatef(this.gem6.rotationPointX * f5, this.gem6.rotationPointY * f5, this.gem6.rotationPointZ * f5); GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem6.offsetX, -this.gem6.offsetY, + GL11.glTranslatef(-this.gem6.offsetX, + -this.gem6.offsetY, -this.gem6.offsetZ); GL11.glTranslatef(-this.gem6.rotationPointX * f5, -this.gem6.rotationPointY * f5, @@ -166,13 +179,15 @@ public class ModelBracelet extends ModelBase { this.gem6.render(f5); GL11.glPopMatrix(); GL11.glPushMatrix(); - GL11.glTranslatef(this.gem7.offsetX, this.gem7.offsetY, + GL11.glTranslatef(this.gem7.offsetX, + this.gem7.offsetY, this.gem7.offsetZ); GL11.glTranslatef(this.gem7.rotationPointX * f5, this.gem7.rotationPointY * f5, this.gem7.rotationPointZ * f5); GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem7.offsetX, -this.gem7.offsetY, + GL11.glTranslatef(-this.gem7.offsetX, + -this.gem7.offsetY, -this.gem7.offsetZ); GL11.glTranslatef(-this.gem7.rotationPointX * f5, -this.gem7.rotationPointY * f5, @@ -180,13 +195,15 @@ public class ModelBracelet extends ModelBase { this.gem7.render(f5); GL11.glPopMatrix(); GL11.glPushMatrix(); - GL11.glTranslatef(this.gem8.offsetX, this.gem8.offsetY, + GL11.glTranslatef(this.gem8.offsetX, + this.gem8.offsetY, this.gem8.offsetZ); GL11.glTranslatef(this.gem8.rotationPointX * f5, this.gem8.rotationPointY * f5, this.gem8.rotationPointZ * f5); GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem8.offsetX, -this.gem8.offsetY, + GL11.glTranslatef(-this.gem8.offsetX, + -this.gem8.offsetY, -this.gem8.offsetZ); GL11.glTranslatef(-this.gem8.rotationPointX * f5, -this.gem8.rotationPointY * f5, @@ -194,13 +211,15 @@ public class ModelBracelet extends ModelBase { this.gem8.render(f5); GL11.glPopMatrix(); GL11.glPushMatrix(); - GL11.glTranslatef(this.gem5.offsetX, this.gem5.offsetY, + GL11.glTranslatef(this.gem5.offsetX, + this.gem5.offsetY, this.gem5.offsetZ); GL11.glTranslatef(this.gem5.rotationPointX * f5, this.gem5.rotationPointY * f5, this.gem5.rotationPointZ * f5); GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem5.offsetX, -this.gem5.offsetY, + GL11.glTranslatef(-this.gem5.offsetX, + -this.gem5.offsetY, -this.gem5.offsetZ); GL11.glTranslatef(-this.gem5.rotationPointX * f5, -this.gem5.rotationPointY * f5, @@ -208,13 +227,15 @@ public class ModelBracelet extends ModelBase { this.gem5.render(f5); GL11.glPopMatrix(); GL11.glPushMatrix(); - GL11.glTranslatef(this.gem9.offsetX, this.gem9.offsetY, + GL11.glTranslatef(this.gem9.offsetX, + this.gem9.offsetY, this.gem9.offsetZ); GL11.glTranslatef(this.gem9.rotationPointX * f5, this.gem9.rotationPointY * f5, this.gem9.rotationPointZ * f5); GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem9.offsetX, -this.gem9.offsetY, + GL11.glTranslatef(-this.gem9.offsetX, + -this.gem9.offsetY, -this.gem9.offsetZ); GL11.glTranslatef(-this.gem9.rotationPointX * f5, -this.gem9.rotationPointY * f5, @@ -227,8 +248,8 @@ public class ModelBracelet extends ModelBase { } /** - * This is a helper function from Tabula to set the rotation of model - * parts + * This is a helper function from Tabula to set the rotation of + * model parts */ public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) { diff --git a/src/main/java/darkknight/jewelrycraft/model/ModelDisplayer.java b/src/main/java/darkknight/jewelrycraft/model/ModelDisplayer.java index 2d7d986..4668ab8 100755 --- a/src/main/java/darkknight/jewelrycraft/model/ModelDisplayer.java +++ b/src/main/java/darkknight/jewelrycraft/model/ModelDisplayer.java @@ -257,8 +257,8 @@ public class ModelDisplayer extends ModelBase { * @param f4 * @param f5 */ - public void setRotationAngles(float f, float f1, float f2, float f3, - float f4, float f5) { + public void setRotationAngles(float f, float f1, float f2, + float f3, float f4, float f5) { super.setRotationAngles(f, f1, f2, f3, f4, f5, null); } } diff --git a/src/main/java/darkknight/jewelrycraft/model/ModelEarrings.java b/src/main/java/darkknight/jewelrycraft/model/ModelEarrings.java index c6a067f..ed378e9 100755 --- a/src/main/java/darkknight/jewelrycraft/model/ModelEarrings.java +++ b/src/main/java/darkknight/jewelrycraft/model/ModelEarrings.java @@ -82,7 +82,8 @@ public class ModelEarrings extends ModelBase { int red = ingotColor >> 16 & 0xff; int green = ingotColor >> 8 & 0xff; int blue = ingotColor & 0xff; - GL11.glColor3f((float) red / 255, (float) green / 255, + GL11.glColor3f((float) red / 255, + (float) green / 255, (float) blue / 255); MetalPart00.render(f5); MetalPart10.render(f5); @@ -99,7 +100,8 @@ public class ModelEarrings extends ModelBase { int red = gemColor >> 16 & 0xff; int green = gemColor >> 8 & 0xff; int blue = gemColor & 0xff; - GL11.glColor3f((float) red / 255, (float) green / 255, + GL11.glColor3f((float) red / 255, + (float) green / 255, (float) blue / 255); Gem0.render(f5); Gem1.render(f5); @@ -116,8 +118,8 @@ public class ModelEarrings extends ModelBase { model.rotateAngleZ = z; } - public void setRotationAngles(float f, float f1, float f2, float f3, - float f4, float f5) { + public void setRotationAngles(float f, float f1, float f2, + float f3, float f4, float f5) { super.setRotationAngles(f, f1, f2, f3, f4, f5, null); } } diff --git a/src/main/java/darkknight/jewelrycraft/model/ModelHalfHeart.java b/src/main/java/darkknight/jewelrycraft/model/ModelHalfHeart.java index ece8a2f..016bf02 100755 --- a/src/main/java/darkknight/jewelrycraft/model/ModelHalfHeart.java +++ b/src/main/java/darkknight/jewelrycraft/model/ModelHalfHeart.java @@ -11,12 +11,13 @@ import net.minecraft.entity.Entity; public class ModelHalfHeart extends ModelBase { // fields - ModelRenderer s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, s13, - s14, s15, s16, s17, s18, s19, s20, s21, s22; + ModelRenderer s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, + s13, s14, s15, s16, s17, s18, s19, s20, s21, s22; ModelRenderer f1, f3, f4, f5, f6, f7, f8, f9, f13, f14, f16, f17, f19, f20, f21, f22, f23, f24, f25, f26; - ModelRenderer b1, b2, b3, b4, b5, b6, b7, b8, b9, b10, b11, b12, b13, - b14, b15, b16, b19, b20, b21, b23, b24, b25, b26; + ModelRenderer b1, b2, b3, b4, b5, b6, b7, b8, b9, b10, b11, b12, + b13, b14, b15, b16, b19, b20, b21, b23, b24, b25, + b26; public ModelHalfHeart() { textureWidth = 64; @@ -415,10 +416,12 @@ public class ModelHalfHeart extends ModelBase { @Override public void render(Entity entity, float angle1, float angle2, - float angle3, float angle4, float angle5, float angle6) { - super.render(entity, angle1, angle2, angle3, angle4, angle5, + float angle3, float angle4, float angle5, + float angle6) { + super.render(entity, angle1, angle2, angle3, angle4, + angle5, angle6); + setRotationAngles(angle1, angle2, angle3, angle4, angle5, angle6); - setRotationAngles(angle1, angle2, angle3, angle4, angle5, angle6); s1.render(angle6); s2.render(angle6); s3.render(angle6); @@ -493,8 +496,8 @@ public class ModelHalfHeart extends ModelBase { model.rotateAngleZ = z; } - public void setRotationAngles(float f, float f1, float f2, float f3, - float f4, float f5) { + public void setRotationAngles(float f, float f1, float f2, + float f3, float f4, float f5) { super.setRotationAngles(f, f1, f2, f3, f4, f5, null); } } diff --git a/src/main/java/darkknight/jewelrycraft/model/ModelHandPedestal.java b/src/main/java/darkknight/jewelrycraft/model/ModelHandPedestal.java index 5163ad1..fc02886 100755 --- a/src/main/java/darkknight/jewelrycraft/model/ModelHandPedestal.java +++ b/src/main/java/darkknight/jewelrycraft/model/ModelHandPedestal.java @@ -15,14 +15,14 @@ import net.minecraft.util.ResourceLocation; * @author Paul Fulham (pau101) */ public class ModelHandPedestal extends ModelBase { - protected ModelRenderer plinth; - protected ModelRenderer base; - protected ModelRenderer shaft; - private ModelRenderer palm; - private ModelRenderer[] fingers; - private ModelRenderer thumb; + protected ModelRenderer plinth; + protected ModelRenderer base; + protected ModelRenderer shaft; + private ModelRenderer palm; + private ModelRenderer[] fingers; + private ModelRenderer thumb; private ItemStackModelRenderer heldItemStack; - private CubicBezier easeInOut; + private CubicBezier easeInOut; /** * @param resetResourceLocation @@ -40,9 +40,12 @@ public class ModelHandPedestal extends ModelBase { * */ protected void initPedestalRenderers() { - plinth = createModelRenderer(0, 0).addBox(-6, 4, -6, 12, 4, 12); - base = createModelRenderer(0, 0).addBox(-4, 0, -4, 8, 4, 8); - shaft = createModelRenderer(0, 0).addBox(-3, -4, -3, 6, 4, 6); + plinth = createModelRenderer(0, 0).addBox(-6, 4, -6, 12, 4, + 12); + base = createModelRenderer(0, 0).addBox(-4, 0, -4, 8, 4, + 8); + shaft = createModelRenderer(0, 0).addBox(-3, -4, -3, 6, 4, + 6); } /** @@ -57,10 +60,10 @@ public class ModelHandPedestal extends ModelBase { * @param textureOffsetY * @return */ - protected final ModelRenderer createModelRenderer(int textureOffsetX, - int textureOffsetY) { - ModelRenderer modelRenderer = - new ModelRenderer(this, textureOffsetX, textureOffsetY); + protected final ModelRenderer createModelRenderer( + int textureOffsetX, int textureOffsetY) { + ModelRenderer modelRenderer = new ModelRenderer(this, + textureOffsetX, textureOffsetY); modelRenderer.setTextureSize(textureWidth, textureHeight); return modelRenderer; } @@ -69,7 +72,8 @@ public class ModelHandPedestal extends ModelBase { * @return */ private ModelRenderer createPhalanges() { - return createModelRenderer(0, 0).addBox(-1, -1.5F, 0, 2, 3, 5) + return createModelRenderer(0, 0) + .addBox(-1, -1.5F, 0, 2, 3, 5) .addBox(-1, -5.5F, 2, 2, 4, 3); } @@ -78,17 +82,19 @@ public class ModelHandPedestal extends ModelBase { */ private void initHandModelRenderers( ResourceLocation resetResourceLocation) { - palm = createModelRenderer(0, 0).addBox(-4, -8, -4, 8, 4, 8); + palm = createModelRenderer(0, 0).addBox(-4, -8, -4, 8, 4, + 8); shaft.addChild(palm); int fingerCount = 4; fingers = new ModelRenderer[fingerCount]; for (int i = 0; i < fingerCount; i++) { ModelRenderer phalanges = createPhalanges(); - float theta = - (i / (float) fingerCount - 0.5F + 1F / fingerCount / 2) - * ((float) Math.PI * 0.6F); + float theta = (i / (float) fingerCount - 0.5F + + 1F / fingerCount / 2) + * ((float) Math.PI * 0.6F); phalanges.rotateAngleY = theta; - phalanges.setRotationPoint(MathHelper.sin(theta) * 5, -5.75F, + phalanges.setRotationPoint( + MathHelper.sin(theta) * 5, -5.75F, MathHelper.cos(theta) * 5 - 1); fingers[i] = phalanges; palm.addChild(phalanges); @@ -98,8 +104,8 @@ public class ModelHandPedestal extends ModelBase { thumb.rotationPointY = -5.75F; thumb.rotationPointZ = -3; palm.addChild(thumb); - heldItemStack = - new ItemStackModelRenderer(this, resetResourceLocation); + heldItemStack = new ItemStackModelRenderer(this, + resetResourceLocation); heldItemStack.rotateAngleZ = (float) Math.PI; heldItemStack.rotateAngleX = (float) (Math.PI / 2); heldItemStack.setRotationPoint(0, -8.5F, -3.5F); @@ -115,7 +121,8 @@ public class ModelHandPedestal extends ModelBase { float partialRenderTicks, float scale) { handleHeldItemStack(pedestal.getHeldItemStack()); float gripScale = pedestal.getGripScale(); - float grip = easeInOut.eval(pedestal.getGrip(partialRenderTicks)) + float grip = easeInOut + .eval(pedestal.getGrip(partialRenderTicks)) * gripScale; float rotateAngleX = (float) (grip * 75 * Math.PI / 180 + (1 - grip) * 10 * Math.PI / 180); @@ -123,8 +130,9 @@ public class ModelHandPedestal extends ModelBase { for (int i = 0; i < fingers.length; i++) { ModelRenderer phalanges = fingers[i]; phalanges.rotateAngleX = rotateAngleX; - phalanges.rotateAngleZ = - rotateAngleZ * (2F / (fingers.length - 1) * i - 1); + phalanges.rotateAngleZ = rotateAngleZ + * (2F / (fingers.length - 1) * i + - 1); } thumb.rotateAngleX = (float) (grip * 60 * Math.PI / 180 + (1 - grip) * 10 * Math.PI / 180); @@ -143,7 +151,8 @@ public class ModelHandPedestal extends ModelBase { heldItemStack.rotateAngleX = 0; heldItemStack.rotationPointZ = 0; } else { - heldItemStack.rotateAngleX = (float) (Math.PI / 2); + heldItemStack.rotateAngleX = (float) (Math.PI + / 2); heldItemStack.rotationPointZ = -3.5F; } } diff --git a/src/main/java/darkknight/jewelrycraft/model/ModelHeart.java b/src/main/java/darkknight/jewelrycraft/model/ModelHeart.java index f9a29e0..474dc69 100755 --- a/src/main/java/darkknight/jewelrycraft/model/ModelHeart.java +++ b/src/main/java/darkknight/jewelrycraft/model/ModelHeart.java @@ -11,14 +11,14 @@ import net.minecraft.entity.Entity; public class ModelHeart extends ModelBase { // fields - ModelRenderer s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, s13, - s14, s15, s16, s17, s18, s19, s20, s21, s22; - ModelRenderer f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, - f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, - f26; - ModelRenderer b1, b2, b3, b4, b5, b6, b7, b8, b9, b10, b11, b12, b13, - b14, b15, b16, b17, b18, b19, b20, b21, b22, b23, b24, b25, - b26; + ModelRenderer s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, + s13, s14, s15, s16, s17, s18, s19, s20, s21, s22; + ModelRenderer f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, + f23, f24, f25, f26; + ModelRenderer b1, b2, b3, b4, b5, b6, b7, b8, b9, b10, b11, b12, + b13, b14, b15, b16, b17, b18, b19, b20, b21, b22, + b23, b24, b25, b26; public ModelHeart() { textureWidth = 64; @@ -471,10 +471,12 @@ public class ModelHeart extends ModelBase { @Override public void render(Entity entity, float angle1, float angle2, - float angle3, float angle4, float angle5, float angle6) { - super.render(entity, angle1, angle2, angle3, angle4, angle5, + float angle3, float angle4, float angle5, + float angle6) { + super.render(entity, angle1, angle2, angle3, angle4, + angle5, angle6); + setRotationAngles(angle1, angle2, angle3, angle4, angle5, angle6); - setRotationAngles(angle1, angle2, angle3, angle4, angle5, angle6); s1.render(angle6); s2.render(angle6); s3.render(angle6); @@ -558,8 +560,8 @@ public class ModelHeart extends ModelBase { model.rotateAngleZ = z; } - public void setRotationAngles(float f, float f1, float f2, float f3, - float f4, float f5) { + public void setRotationAngles(float f, float f1, float f2, + float f3, float f4, float f5) { super.setRotationAngles(f, f1, f2, f3, f4, f5, null); } } diff --git a/src/main/java/darkknight/jewelrycraft/model/ModelJewlersCraftingBench.java b/src/main/java/darkknight/jewelrycraft/model/ModelJewlersCraftingBench.java index adf976d..1ecfeb5 100755 --- a/src/main/java/darkknight/jewelrycraft/model/ModelJewlersCraftingBench.java +++ b/src/main/java/darkknight/jewelrycraft/model/ModelJewlersCraftingBench.java @@ -156,8 +156,8 @@ public class ModelJewlersCraftingBench extends ModelBase { * @param f4 * @param f5 */ - public void setRotationAngles(float f, float f1, float f2, float f3, - float f4, float f5) { + public void setRotationAngles(float f, float f1, float f2, + float f3, float f4, float f5) { super.setRotationAngles(f, f1, f2, f3, f4, f5, null); } } diff --git a/src/main/java/darkknight/jewelrycraft/model/ModelMask.java b/src/main/java/darkknight/jewelrycraft/model/ModelMask.java index 8d24ed7..d1934ab 100755 --- a/src/main/java/darkknight/jewelrycraft/model/ModelMask.java +++ b/src/main/java/darkknight/jewelrycraft/model/ModelMask.java @@ -65,8 +65,8 @@ public class ModelMask extends ModelBase { } /** - * This is a helper function from Tabula to set the rotation of model - * parts + * This is a helper function from Tabula to set the rotation of + * model parts */ public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) { diff --git a/src/main/java/darkknight/jewelrycraft/model/ModelMolder.java b/src/main/java/darkknight/jewelrycraft/model/ModelMolder.java index 7fdd195..36989af 100755 --- a/src/main/java/darkknight/jewelrycraft/model/ModelMolder.java +++ b/src/main/java/darkknight/jewelrycraft/model/ModelMolder.java @@ -92,8 +92,8 @@ public class ModelMolder extends ModelBase { * @param f4 * @param f5 */ - public void setRotationAngles(float f, float f1, float f2, float f3, - float f4, float f5) { + public void setRotationAngles(float f, float f1, float f2, + float f3, float f4, float f5) { super.setRotationAngles(f, f1, f2, f3, f4, f5, null); } } diff --git a/src/main/java/darkknight/jewelrycraft/model/ModelNeckalce.java b/src/main/java/darkknight/jewelrycraft/model/ModelNeckalce.java index f6db653..537a8c2 100755 --- a/src/main/java/darkknight/jewelrycraft/model/ModelNeckalce.java +++ b/src/main/java/darkknight/jewelrycraft/model/ModelNeckalce.java @@ -65,16 +65,19 @@ public class ModelNeckalce extends ModelBase { int red = (ingotColor >> 16) & 0xff; int green = (ingotColor >> 8) & 0xff; int blue = ingotColor & 0xff; - GL11.glColor3f((float) red / 255, (float) green / 255, + GL11.glColor3f((float) red / 255, + (float) green / 255, (float) blue / 255); GL11.glPushMatrix(); - GL11.glTranslatef(this.neck1.offsetX, this.neck1.offsetY, + GL11.glTranslatef(this.neck1.offsetX, + this.neck1.offsetY, this.neck1.offsetZ); GL11.glTranslatef(this.neck1.rotationPointX * f5, this.neck1.rotationPointY * f5, this.neck1.rotationPointZ * f5); GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.neck1.offsetX, -this.neck1.offsetY, + GL11.glTranslatef(-this.neck1.offsetX, + -this.neck1.offsetY, -this.neck1.offsetZ); GL11.glTranslatef(-this.neck1.rotationPointX * f5, -this.neck1.rotationPointY * f5, @@ -82,13 +85,15 @@ public class ModelNeckalce extends ModelBase { this.neck1.render(f5); GL11.glPopMatrix(); GL11.glPushMatrix(); - GL11.glTranslatef(this.neck7.offsetX, this.neck7.offsetY, + GL11.glTranslatef(this.neck7.offsetX, + this.neck7.offsetY, this.neck7.offsetZ); GL11.glTranslatef(this.neck7.rotationPointX * f5, this.neck7.rotationPointY * f5, this.neck7.rotationPointZ * f5); GL11.glScaled(0.3D, 0.5D, 0.5D); - GL11.glTranslatef(-this.neck7.offsetX, -this.neck7.offsetY, + GL11.glTranslatef(-this.neck7.offsetX, + -this.neck7.offsetY, -this.neck7.offsetZ); GL11.glTranslatef(-this.neck7.rotationPointX * f5, -this.neck7.rotationPointY * f5, @@ -96,13 +101,15 @@ public class ModelNeckalce extends ModelBase { this.neck7.render(f5); GL11.glPopMatrix(); GL11.glPushMatrix(); - GL11.glTranslatef(this.neck8.offsetX, this.neck8.offsetY, + GL11.glTranslatef(this.neck8.offsetX, + this.neck8.offsetY, this.neck8.offsetZ); GL11.glTranslatef(this.neck8.rotationPointX * f5, this.neck8.rotationPointY * f5, this.neck8.rotationPointZ * f5); GL11.glScaled(0.3D, 0.5D, 0.5D); - GL11.glTranslatef(-this.neck8.offsetX, -this.neck8.offsetY, + GL11.glTranslatef(-this.neck8.offsetX, + -this.neck8.offsetY, -this.neck8.offsetZ); GL11.glTranslatef(-this.neck8.rotationPointX * f5, -this.neck8.rotationPointY * f5, @@ -110,13 +117,15 @@ public class ModelNeckalce extends ModelBase { this.neck8.render(f5); GL11.glPopMatrix(); GL11.glPushMatrix(); - GL11.glTranslatef(this.neck3.offsetX, this.neck3.offsetY, + GL11.glTranslatef(this.neck3.offsetX, + this.neck3.offsetY, this.neck3.offsetZ); GL11.glTranslatef(this.neck3.rotationPointX * f5, this.neck3.rotationPointY * f5, this.neck3.rotationPointZ * f5); GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.neck3.offsetX, -this.neck3.offsetY, + GL11.glTranslatef(-this.neck3.offsetX, + -this.neck3.offsetY, -this.neck3.offsetZ); GL11.glTranslatef(-this.neck3.rotationPointX * f5, -this.neck3.rotationPointY * f5, @@ -124,13 +133,15 @@ public class ModelNeckalce extends ModelBase { this.neck3.render(f5); GL11.glPopMatrix(); GL11.glPushMatrix(); - GL11.glTranslatef(this.neck6.offsetX, this.neck6.offsetY, + GL11.glTranslatef(this.neck6.offsetX, + this.neck6.offsetY, this.neck6.offsetZ); GL11.glTranslatef(this.neck6.rotationPointX * f5, this.neck6.rotationPointY * f5, this.neck6.rotationPointZ * f5); GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.neck6.offsetX, -this.neck6.offsetY, + GL11.glTranslatef(-this.neck6.offsetX, + -this.neck6.offsetY, -this.neck6.offsetZ); GL11.glTranslatef(-this.neck6.rotationPointX * f5, -this.neck6.rotationPointY * f5, @@ -138,13 +149,15 @@ public class ModelNeckalce extends ModelBase { this.neck6.render(f5); GL11.glPopMatrix(); GL11.glPushMatrix(); - GL11.glTranslatef(this.neck9.offsetX, this.neck9.offsetY, + GL11.glTranslatef(this.neck9.offsetX, + this.neck9.offsetY, this.neck9.offsetZ); GL11.glTranslatef(this.neck9.rotationPointX * f5, this.neck9.rotationPointY * f5, this.neck9.rotationPointZ * f5); GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.neck9.offsetX, -this.neck9.offsetY, + GL11.glTranslatef(-this.neck9.offsetX, + -this.neck9.offsetY, -this.neck9.offsetZ); GL11.glTranslatef(-this.neck9.rotationPointX * f5, -this.neck9.rotationPointY * f5, @@ -152,13 +165,15 @@ public class ModelNeckalce extends ModelBase { this.neck9.render(f5); GL11.glPopMatrix(); GL11.glPushMatrix(); - GL11.glTranslatef(this.neck4.offsetX, this.neck4.offsetY, + GL11.glTranslatef(this.neck4.offsetX, + this.neck4.offsetY, this.neck4.offsetZ); GL11.glTranslatef(this.neck4.rotationPointX * f5, this.neck4.rotationPointY * f5, this.neck4.rotationPointZ * f5); GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.neck4.offsetX, -this.neck4.offsetY, + GL11.glTranslatef(-this.neck4.offsetX, + -this.neck4.offsetY, -this.neck4.offsetZ); GL11.glTranslatef(-this.neck4.rotationPointX * f5, -this.neck4.rotationPointY * f5, @@ -166,13 +181,15 @@ public class ModelNeckalce extends ModelBase { this.neck4.render(f5); GL11.glPopMatrix(); GL11.glPushMatrix(); - GL11.glTranslatef(this.neck2.offsetX, this.neck2.offsetY, + GL11.glTranslatef(this.neck2.offsetX, + this.neck2.offsetY, this.neck2.offsetZ); GL11.glTranslatef(this.neck2.rotationPointX * f5, this.neck2.rotationPointY * f5, this.neck2.rotationPointZ * f5); GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.neck2.offsetX, -this.neck2.offsetY, + GL11.glTranslatef(-this.neck2.offsetX, + -this.neck2.offsetY, -this.neck2.offsetZ); GL11.glTranslatef(-this.neck2.rotationPointX * f5, -this.neck2.rotationPointY * f5, @@ -180,13 +197,15 @@ public class ModelNeckalce extends ModelBase { this.neck2.render(f5); GL11.glPopMatrix(); GL11.glPushMatrix(); - GL11.glTranslatef(this.neck5.offsetX, this.neck5.offsetY, + GL11.glTranslatef(this.neck5.offsetX, + this.neck5.offsetY, this.neck5.offsetZ); GL11.glTranslatef(this.neck5.rotationPointX * f5, this.neck5.rotationPointY * f5, this.neck5.rotationPointZ * f5); GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.neck5.offsetX, -this.neck5.offsetY, + GL11.glTranslatef(-this.neck5.offsetX, + -this.neck5.offsetY, -this.neck5.offsetZ); GL11.glTranslatef(-this.neck5.rotationPointX * f5, -this.neck5.rotationPointY * f5, @@ -199,19 +218,22 @@ public class ModelNeckalce extends ModelBase { int red = gemColor >> 16 & 0xff; int green = gemColor >> 8 & 0xff; int blue = gemColor & 0xff; - GL11.glColor3f((float) red / 255, (float) green / 255, + GL11.glColor3f((float) red / 255, + (float) green / 255, (float) blue / 255); GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE_MINUS_DST_COLOR); GL11.glPushMatrix(); - GL11.glTranslatef(this.gem.offsetX, this.gem.offsetY, + GL11.glTranslatef(this.gem.offsetX, + this.gem.offsetY, this.gem.offsetZ); GL11.glTranslatef(this.gem.rotationPointX * f5, this.gem.rotationPointY * f5, this.gem.rotationPointZ * f5); GL11.glScaled(0.25D, 0.25D, 0.25D); - GL11.glTranslatef(-this.gem.offsetX, -this.gem.offsetY, + GL11.glTranslatef(-this.gem.offsetX, + -this.gem.offsetY, -this.gem.offsetZ); GL11.glTranslatef(-this.gem.rotationPointX * f5, -this.gem.rotationPointY * f5, @@ -224,8 +246,8 @@ public class ModelNeckalce extends ModelBase { } /** - * This is a helper function from Tabula to set the rotation of model - * parts + * This is a helper function from Tabula to set the rotation of + * model parts */ public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) { diff --git a/src/main/java/darkknight/jewelrycraft/model/ModelRing.java b/src/main/java/darkknight/jewelrycraft/model/ModelRing.java index d2f11c9..a9b8e34 100755 --- a/src/main/java/darkknight/jewelrycraft/model/ModelRing.java +++ b/src/main/java/darkknight/jewelrycraft/model/ModelRing.java @@ -49,16 +49,19 @@ public class ModelRing extends ModelBase { int red = (ingotColor >> 16) & 0xff; int green = (ingotColor >> 8) & 0xff; int blue = ingotColor & 0xff; - GL11.glColor3f((float) red / 255, (float) green / 255, + GL11.glColor3f((float) red / 255, + (float) green / 255, (float) blue / 255); GL11.glPushMatrix(); - GL11.glTranslatef(this.ring1.offsetX, this.ring1.offsetY, + GL11.glTranslatef(this.ring1.offsetX, + this.ring1.offsetY, this.ring1.offsetZ); GL11.glTranslatef(this.ring1.rotationPointX * f5, this.ring1.rotationPointY * f5, this.ring1.rotationPointZ * f5); GL11.glScaled(0.1D, 0.3D, 0.3D); - GL11.glTranslatef(-this.ring1.offsetX, -this.ring1.offsetY, + GL11.glTranslatef(-this.ring1.offsetX, + -this.ring1.offsetY, -this.ring1.offsetZ); GL11.glTranslatef(-this.ring1.rotationPointX * f5, -this.ring1.rotationPointY * f5, @@ -66,13 +69,15 @@ public class ModelRing extends ModelBase { this.ring1.render(f5); GL11.glPopMatrix(); GL11.glPushMatrix(); - GL11.glTranslatef(this.ring2.offsetX, this.ring2.offsetY, + GL11.glTranslatef(this.ring2.offsetX, + this.ring2.offsetY, this.ring2.offsetZ); GL11.glTranslatef(this.ring2.rotationPointX * f5, this.ring2.rotationPointY * f5, this.ring2.rotationPointZ * f5); GL11.glScaled(0.1D, 0.3D, 0.3D); - GL11.glTranslatef(-this.ring2.offsetX, -this.ring2.offsetY, + GL11.glTranslatef(-this.ring2.offsetX, + -this.ring2.offsetY, -this.ring2.offsetZ); GL11.glTranslatef(-this.ring2.rotationPointX * f5, -this.ring2.rotationPointY * f5, @@ -80,13 +85,15 @@ public class ModelRing extends ModelBase { this.ring2.render(f5); GL11.glPopMatrix(); GL11.glPushMatrix(); - GL11.glTranslatef(this.ring3.offsetX, this.ring3.offsetY, + GL11.glTranslatef(this.ring3.offsetX, + this.ring3.offsetY, this.ring3.offsetZ); GL11.glTranslatef(this.ring3.rotationPointX * f5, this.ring3.rotationPointY * f5, this.ring3.rotationPointZ * f5); GL11.glScaled(0.2D, 0.3D, 0.1D); - GL11.glTranslatef(-this.ring3.offsetX, -this.ring3.offsetY, + GL11.glTranslatef(-this.ring3.offsetX, + -this.ring3.offsetY, -this.ring3.offsetZ); GL11.glTranslatef(-this.ring3.rotationPointX * f5, -this.ring3.rotationPointY * f5, @@ -99,19 +106,22 @@ public class ModelRing extends ModelBase { int red = gemColor >> 16 & 0xff; int green = gemColor >> 8 & 0xff; int blue = gemColor & 0xff; - GL11.glColor3f((float) red / 255, (float) green / 255, + GL11.glColor3f((float) red / 255, + (float) green / 255, (float) blue / 255); GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE_MINUS_DST_COLOR); GL11.glPushMatrix(); - GL11.glTranslatef(this.gem.offsetX, this.gem.offsetY, + GL11.glTranslatef(this.gem.offsetX, + this.gem.offsetY, this.gem.offsetZ); GL11.glTranslatef(this.gem.rotationPointX * f5, this.gem.rotationPointY * f5, this.gem.rotationPointZ * f5); GL11.glScaled(0.1D, 0.1D, 0.1D); - GL11.glTranslatef(-this.gem.offsetX, -this.gem.offsetY, + GL11.glTranslatef(-this.gem.offsetX, + -this.gem.offsetY, -this.gem.offsetZ); GL11.glTranslatef(-this.gem.rotationPointX * f5, -this.gem.rotationPointY * f5, @@ -119,13 +129,15 @@ public class ModelRing extends ModelBase { this.gem.render(f5); GL11.glPopMatrix(); GL11.glPushMatrix(); - GL11.glTranslatef(this.gem1.offsetX, this.gem1.offsetY, + GL11.glTranslatef(this.gem1.offsetX, + this.gem1.offsetY, this.gem1.offsetZ); GL11.glTranslatef(this.gem1.rotationPointX * f5, this.gem1.rotationPointY * f5, this.gem1.rotationPointZ * f5); GL11.glScaled(0.1D, 0.05D, 0.1D); - GL11.glTranslatef(-this.gem1.offsetX, -this.gem1.offsetY, + GL11.glTranslatef(-this.gem1.offsetX, + -this.gem1.offsetY, -this.gem1.offsetZ); GL11.glTranslatef(-this.gem1.rotationPointX * f5, -this.gem1.rotationPointY * f5, @@ -133,13 +145,15 @@ public class ModelRing extends ModelBase { this.gem1.render(f5); GL11.glPopMatrix(); GL11.glPushMatrix(); - GL11.glTranslatef(this.gem2.offsetX, this.gem2.offsetY, + GL11.glTranslatef(this.gem2.offsetX, + this.gem2.offsetY, this.gem2.offsetZ); GL11.glTranslatef(this.gem2.rotationPointX * f5, this.gem2.rotationPointY * f5, this.gem2.rotationPointZ * f5); GL11.glScaled(0.1D, 0.05D, 0.1D); - GL11.glTranslatef(-this.gem2.offsetX, -this.gem2.offsetY, + GL11.glTranslatef(-this.gem2.offsetX, + -this.gem2.offsetY, -this.gem2.offsetZ); GL11.glTranslatef(-this.gem2.rotationPointX * f5, -this.gem2.rotationPointY * f5, @@ -151,8 +165,8 @@ public class ModelRing extends ModelBase { } /** - * This is a helper function from Tabula to set the rotation of model - * parts + * This is a helper function from Tabula to set the rotation of + * model parts */ public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) { diff --git a/src/main/java/darkknight/jewelrycraft/model/ModelShadowEye.java b/src/main/java/darkknight/jewelrycraft/model/ModelShadowEye.java index ba3426c..1ea7819 100755 --- a/src/main/java/darkknight/jewelrycraft/model/ModelShadowEye.java +++ b/src/main/java/darkknight/jewelrycraft/model/ModelShadowEye.java @@ -22,7 +22,7 @@ public class ModelShadowEye extends ModelBase { ModelRenderer Cable2; ModelRenderer Cable3; ModelRenderer Cable4; - float field_82221_e, field_82220_d; + float field_82221_e, field_82220_d; /** * @@ -121,18 +121,21 @@ public class ModelShadowEye extends ModelBase { Eye.rotateAngleX = 0F; Eye.rotateAngleZ = 0F; if (f3 == 0) - Eye.rotateAngleY = (float) (0.5F * Math.PI); + Eye.rotateAngleY = (float) (0.5F + * Math.PI); else if (f3 == 1) Eye.rotateAngleY = (float) (Math.PI); else if (f3 == 2) - Eye.rotateAngleY = (float) (1.5F * Math.PI); + Eye.rotateAngleY = (float) (1.5F + * Math.PI); else if (f3 == 3) Eye.rotateAngleY = (float) (0F * Math.PI); } } public static float[] getRotation(double posX1, double posY1, - double posZ1, double posX2, double posY2, double posZ2) { + double posZ1, double posX2, double posY2, + double posZ2) { float[] rotation = new float[2]; double diffX = posX2 - posX1; double diffZ = posZ2 - posZ1; @@ -146,9 +149,11 @@ public class ModelShadowEye extends ModelBase { } else if (diffZ >= 0.0D && diffX <= 0.0D) { yaw = Math.toDegrees(-Math.atan(diffX / diffZ)); } else if (diffZ <= 0.0D && diffX >= 0.0D) { - yaw = -90D + Math.toDegrees(Math.atan(diffZ / diffX)); + yaw = -90D + Math.toDegrees( + Math.atan(diffZ / diffX)); } else if (diffZ <= 0.0D && diffX <= 0.0D) { - yaw = 90D + Math.toDegrees(Math.atan(diffZ / diffX)); + yaw = 90D + Math.toDegrees( + Math.atan(diffZ / diffX)); } rotation[0] = (float) yaw; return rotation; diff --git a/src/main/java/darkknight/jewelrycraft/model/ModelShadowHand.java b/src/main/java/darkknight/jewelrycraft/model/ModelShadowHand.java index 116ba21..28d48d7 100755 --- a/src/main/java/darkknight/jewelrycraft/model/ModelShadowHand.java +++ b/src/main/java/darkknight/jewelrycraft/model/ModelShadowHand.java @@ -19,8 +19,11 @@ public class ModelShadowHand extends ModelHandPedestal { */ @Override protected void initPedestalRenderers() { - plinth = createModelRenderer(0, 0).addBox(-3, 6, -3, 6, 2, 6); - base = createModelRenderer(0, 15).addBox(-2, 0, -2, 4, 6, 4); - shaft = createModelRenderer(28, 0).addBox(-3, -4, -3, 6, 4, 6); + plinth = createModelRenderer(0, 0).addBox(-3, 6, -3, 6, 2, + 6); + base = createModelRenderer(0, 15).addBox(-2, 0, -2, 4, 6, + 4); + shaft = createModelRenderer(28, 0).addBox(-3, -4, -3, 6, 4, + 6); } }
\ No newline at end of file diff --git a/src/main/java/darkknight/jewelrycraft/model/ModelSmelter.java b/src/main/java/darkknight/jewelrycraft/model/ModelSmelter.java index d34d938..b5e3baf 100755 --- a/src/main/java/darkknight/jewelrycraft/model/ModelSmelter.java +++ b/src/main/java/darkknight/jewelrycraft/model/ModelSmelter.java @@ -292,8 +292,8 @@ public class ModelSmelter extends ModelBase { * @param f4 * @param f5 */ - public void setRotationAngles(float f, float f1, float f2, float f3, - float f4, float f5) { + public void setRotationAngles(float f, float f1, float f2, + float f3, float f4, float f5) { super.setRotationAngles(f, f1, f2, f3, f4, f5, null); } } diff --git a/src/main/java/darkknight/jewelrycraft/network/PacketHandler.java b/src/main/java/darkknight/jewelrycraft/network/PacketHandler.java index f98c14a..c9fefa3 100755 --- a/src/main/java/darkknight/jewelrycraft/network/PacketHandler.java +++ b/src/main/java/darkknight/jewelrycraft/network/PacketHandler.java @@ -9,25 +9,30 @@ import darkknight.jewelrycraft.util.Variables; public class PacketHandler {
public static void preInit(FMLPreInitializationEvent e) {
- JewelrycraftMod.netWrapper =
- NetworkRegistry.INSTANCE.newSimpleChannel(Variables.MODID);
+ JewelrycraftMod.netWrapper = NetworkRegistry.INSTANCE
+ .newSimpleChannel(Variables.MODID);
JewelrycraftMod.netWrapper.registerMessage(
- PacketKeyPressEvent.class, PacketKeyPressEvent.class, 3,
- Side.SERVER);
+ PacketKeyPressEvent.class,
+ PacketKeyPressEvent.class, 3, Side.SERVER);
JewelrycraftMod.netWrapper.registerMessage(
PacketRequestPlayerInfo.class,
- PacketRequestPlayerInfo.class, 4, Side.SERVER);
+ PacketRequestPlayerInfo.class, 4,
+ Side.SERVER);
JewelrycraftMod.netWrapper.registerMessage(
PacketSendClientPlayerInfo.class,
- PacketSendClientPlayerInfo.class, 5, Side.CLIENT);
+ PacketSendClientPlayerInfo.class, 5,
+ Side.CLIENT);
JewelrycraftMod.netWrapper.registerMessage(
PacketSendServerPlayersInfo.class,
- PacketSendServerPlayersInfo.class, 6, Side.CLIENT);
+ PacketSendServerPlayersInfo.class, 6,
+ Side.CLIENT);
JewelrycraftMod.netWrapper.registerMessage(
- PacketRequestSetSlot.class, PacketRequestSetSlot.class, 7,
+ PacketRequestSetSlot.class,
+ PacketRequestSetSlot.class, 7,
Side.SERVER);
JewelrycraftMod.netWrapper.registerMessage(
PacketSendServerPlayerInfo.class,
- PacketSendServerPlayerInfo.class, 8, Side.SERVER);
+ PacketSendServerPlayerInfo.class, 8,
+ Side.SERVER);
}
}
diff --git a/src/main/java/darkknight/jewelrycraft/network/PacketKeyPressEvent.java b/src/main/java/darkknight/jewelrycraft/network/PacketKeyPressEvent.java index 107ffd8..d90cf1a 100755 --- a/src/main/java/darkknight/jewelrycraft/network/PacketKeyPressEvent.java +++ b/src/main/java/darkknight/jewelrycraft/network/PacketKeyPressEvent.java @@ -35,12 +35,14 @@ public class PacketKeyPressEvent implements IMessage, EntityPlayer sender = ctx.getServerHandler().playerEntity;
// Jewelry inventory
if (message.actionID == 0)
- sender.openGui(JewelrycraftMod.instance, 2, sender.worldObj,
- (int) sender.posX, (int) sender.posY,
+ sender.openGui(JewelrycraftMod.instance, 2,
+ sender.worldObj, (int) sender.posX,
+ (int) sender.posY,
(int) sender.posZ);
if (message.actionID == 1)
- sender.openGui(JewelrycraftMod.instance, 4, sender.worldObj,
- (int) sender.posX, (int) sender.posY,
+ sender.openGui(JewelrycraftMod.instance, 4,
+ sender.worldObj, (int) sender.posX,
+ (int) sender.posY,
(int) sender.posZ);
return null;
}
diff --git a/src/main/java/darkknight/jewelrycraft/network/PacketRequestPlayerInfo.java b/src/main/java/darkknight/jewelrycraft/network/PacketRequestPlayerInfo.java index e3c3564..393647f 100755 --- a/src/main/java/darkknight/jewelrycraft/network/PacketRequestPlayerInfo.java +++ b/src/main/java/darkknight/jewelrycraft/network/PacketRequestPlayerInfo.java @@ -25,8 +25,8 @@ public class PacketRequestPlayerInfo implements IMessage, public IMessage onMessage(PacketRequestPlayerInfo message,
MessageContext ctx) {
return new PacketSendClientPlayerInfo(
- PlayerUtils.getModPlayerPersistTag(
- ctx.getServerHandler().playerEntity,
+ PlayerUtils.getModPlayerPersistTag(ctx
+ .getServerHandler().playerEntity,
Variables.MODID));
}
diff --git a/src/main/java/darkknight/jewelrycraft/network/PacketRequestSetSlot.java b/src/main/java/darkknight/jewelrycraft/network/PacketRequestSetSlot.java index bf6c1aa..d335b6a 100755 --- a/src/main/java/darkknight/jewelrycraft/network/PacketRequestSetSlot.java +++ b/src/main/java/darkknight/jewelrycraft/network/PacketRequestSetSlot.java @@ -37,7 +37,9 @@ public class PacketRequestSetSlot implements IMessage, if (ctx.getServerHandler().playerEntity.openContainer instanceof ContainerJewelryModifier) {
((ContainerJewelryModifier) ctx
.getServerHandler().playerEntity.openContainer).modInv
- .setInventorySlotContents(36, message.stack);
+ .setInventorySlotContents(
+ 36,
+ message.stack);
}
return null;
}
diff --git a/src/main/java/darkknight/jewelrycraft/network/PacketSendServerPlayerInfo.java b/src/main/java/darkknight/jewelrycraft/network/PacketSendServerPlayerInfo.java index da18c17..bf3ce1a 100755 --- a/src/main/java/darkknight/jewelrycraft/network/PacketSendServerPlayerInfo.java +++ b/src/main/java/darkknight/jewelrycraft/network/PacketSendServerPlayerInfo.java @@ -13,7 +13,7 @@ import net.minecraft.nbt.NBTTagCompound; public class PacketSendServerPlayerInfo implements IMessage,
IMessageHandler<PacketSendServerPlayerInfo, IMessage> {
public NBTTagCompound tagCompound;
- public String curse, action;
+ public String curse, action;
/**
* @param tagCompound
@@ -39,16 +39,20 @@ public class PacketSendServerPlayerInfo implements IMessage, @Override
public IMessage onMessage(PacketSendServerPlayerInfo message,
MessageContext ctx) {
- EntityPlayerMP serverPlayer = ctx.getServerHandler().playerEntity;
+ EntityPlayerMP serverPlayer = ctx
+ .getServerHandler().playerEntity;
NBTTagCompound playerInfo = PlayerUtils
- .getModPlayerPersistTag(serverPlayer, Variables.MODID);
+ .getModPlayerPersistTag(serverPlayer,
+ Variables.MODID);
playerInfo.setInteger(message.curse,
message.action.equals("remove") ? 0 : 1);
- playerInfo.setInteger("activeCurses",
- message.tagCompound.getInteger("activeCurses"));
- System.out.println(message.action + " " + message.curse + " "
- + message.tagCompound.getInteger(curse) + " "
- + message.tagCompound.getInteger("activeCurses"));
+ playerInfo.setInteger("activeCurses", message.tagCompound
+ .getInteger("activeCurses"));
+ System.out.println(message.action + " " + message.curse
+ + " "
+ + message.tagCompound.getInteger(curse)
+ + " " + message.tagCompound.getInteger(
+ "activeCurses"));
return null;
}
diff --git a/src/main/java/darkknight/jewelrycraft/network/PacketSendServerPlayersInfo.java b/src/main/java/darkknight/jewelrycraft/network/PacketSendServerPlayersInfo.java index 1785741..5b67e59 100755 --- a/src/main/java/darkknight/jewelrycraft/network/PacketSendServerPlayersInfo.java +++ b/src/main/java/darkknight/jewelrycraft/network/PacketSendServerPlayersInfo.java @@ -55,13 +55,17 @@ public class PacketSendServerPlayersInfo implements IMessage, */
@Override
public void toBytes(ByteBuf buf) {
- Iterator<EntityPlayer> players = MinecraftServer.getServer()
- .getConfigurationManager().playerEntityList.iterator();
+ Iterator<EntityPlayer> players = MinecraftServer
+ .getServer()
+ .getConfigurationManager().playerEntityList
+ .iterator();
NBTTagCompound nbt = new NBTTagCompound();
while (players.hasNext()) {
EntityPlayer current = players.next();
- nbt.setTag(current.getDisplayName(), PlayerUtils
- .getModPlayerPersistTag(current, Variables.MODID));
+ nbt.setTag(current.getDisplayName(),
+ PlayerUtils.getModPlayerPersistTag(
+ current,
+ Variables.MODID));
}
ByteBufUtils.writeTag(buf, nbt);
}
diff --git a/src/main/java/darkknight/jewelrycraft/particles/EntityFlatShadowFX.java b/src/main/java/darkknight/jewelrycraft/particles/EntityFlatShadowFX.java index fd788f6..2fd304d 100755 --- a/src/main/java/darkknight/jewelrycraft/particles/EntityFlatShadowFX.java +++ b/src/main/java/darkknight/jewelrycraft/particles/EntityFlatShadowFX.java @@ -9,7 +9,7 @@ import net.minecraft.util.ResourceLocation; import net.minecraft.world.World;
public class EntityFlatShadowFX extends EntityFX {
- float moteParticleScale;
+ float moteParticleScale;
ResourceLocation texture;
/**
@@ -21,11 +21,12 @@ public class EntityFlatShadowFX extends EntityFX { * @param maxAge
* @param texture
*/
- public EntityFlatShadowFX(World world, double x, double y, double z,
- float size, float maxAge, ResourceLocation texture) {
+ public EntityFlatShadowFX(World world, double x, double y,
+ double z, float size, float maxAge,
+ ResourceLocation texture) {
super(world, x, y, z, 0D, 0D, 0D);
- particleMaxAge =
- (int) (28D / (Math.random() * 0.3D + 0.7D) * maxAge);
+ particleMaxAge = (int) (28D / (Math.random() * 0.3D + 0.7D)
+ * maxAge);
particleGravity = 0F;
motionX = motionY = motionZ = 0;
particleScale = size;
@@ -44,27 +45,37 @@ public class EntityFlatShadowFX extends EntityFX { * @param maxZ
*/
@Override
- public void renderParticle(Tessellator tessellator, float partialTicks,
- float minX, float minY, float minZ, float maxX, float maxZ) {
+ public void renderParticle(Tessellator tessellator,
+ float partialTicks, float minX, float minY,
+ float minZ, float maxX, float maxZ) {
tessellator.draw();
Minecraft.getMinecraft().renderEngine.bindTexture(texture);
tessellator.startDrawingQuads();
GL11.glEnable(GL11.GL_BLEND);
- GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
+ GL11.glBlendFunc(GL11.GL_SRC_ALPHA,
+ GL11.GL_ONE_MINUS_SRC_ALPHA);
GL11.glDepthMask(false);
float scale = 1F * particleScale;
float x = (float) (posX - interpPosX);
float y = (float) (posX - interpPosY);
float z = (float) (posZ - interpPosZ);
tessellator.setColorRGBA_F(0F, 0F, 0F, 1F);
- tessellator.addVertexWithUV(x - minX * scale - maxX * scale,
- y + minY * scale, z - minZ * scale - maxZ * scale, 0, 0);
- tessellator.addVertexWithUV(x - minX * scale + maxX * scale,
- y + minY * scale, z - minZ * scale + maxZ * scale, 1, 0);
- tessellator.addVertexWithUV(x + minX * scale + maxX * scale,
- y + minY * scale, z + minZ * scale + maxZ * scale, 1, 1);
- tessellator.addVertexWithUV(x + minX * scale - maxX * scale,
- y + minY * scale, z + minZ * scale - maxZ * scale, 0, 1);
+ tessellator.addVertexWithUV(
+ x - minX * scale - maxX * scale,
+ y + minY * scale,
+ z - minZ * scale - maxZ * scale, 0, 0);
+ tessellator.addVertexWithUV(
+ x - minX * scale + maxX * scale,
+ y + minY * scale,
+ z - minZ * scale + maxZ * scale, 1, 0);
+ tessellator.addVertexWithUV(
+ x + minX * scale + maxX * scale,
+ y + minY * scale,
+ z + minZ * scale + maxZ * scale, 1, 1);
+ tessellator.addVertexWithUV(
+ x + minX * scale - maxX * scale,
+ y + minY * scale,
+ z + minZ * scale - maxZ * scale, 0, 1);
tessellator.draw();
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
GL11.glDisable(GL11.GL_BLEND);
diff --git a/src/main/java/darkknight/jewelrycraft/particles/EntityShadowsFX.java b/src/main/java/darkknight/jewelrycraft/particles/EntityShadowsFX.java index 7e492bc..6157927 100755 --- a/src/main/java/darkknight/jewelrycraft/particles/EntityShadowsFX.java +++ b/src/main/java/darkknight/jewelrycraft/particles/EntityShadowsFX.java @@ -16,7 +16,7 @@ import net.minecraft.util.ResourceLocation; import net.minecraft.world.World;
public class EntityShadowsFX extends EntityFX {
- float moteParticleScale;
+ float moteParticleScale;
ResourceLocation texture;
/**
@@ -29,10 +29,11 @@ public class EntityShadowsFX extends EntityFX { * @param texture
*/
public EntityShadowsFX(World world, double x, double y, double z,
- float size, float maxAge, ResourceLocation texture) {
+ float size, float maxAge,
+ ResourceLocation texture) {
super(world, x, y, z, 0D, 0D, 0D);
- particleMaxAge =
- (int) (28D / (Math.random() * 0.3D + 0.7D) * maxAge);
+ particleMaxAge = (int) (28D / (Math.random() * 0.3D + 0.7D)
+ * maxAge);
particleGravity = 0F;
motionX = motionY = motionZ = 0;
particleScale *= size;
@@ -52,8 +53,9 @@ public class EntityShadowsFX extends EntityFX { * @param maxZ
*/
@Override
- public void renderParticle(Tessellator tessellator, float partialTicks,
- float minX, float minY, float minZ, float maxX, float maxZ) {
+ public void renderParticle(Tessellator tessellator,
+ float partialTicks, float minX, float minY,
+ float minZ, float maxX, float maxZ) {
tessellator.draw();
Minecraft.getMinecraft().renderEngine.bindTexture(texture);
GL11.glColor4f(1, 1, 1, 1);
@@ -64,14 +66,22 @@ public class EntityShadowsFX extends EntityFX { float y = (float) (posY - interpPosY);
float z = (float) (posZ - interpPosZ);
tessellator.setColorRGBA_F(0F, 0F, 0F, 0.5F);
- tessellator.addVertexWithUV(x - minX * scale - maxX * scale,
- y - minY * scale, z - minZ * scale - maxZ * scale, 0, 0);
- tessellator.addVertexWithUV(x - minX * scale + maxX * scale,
- y + minY * scale, z - minZ * scale + maxZ * scale, 1, 0);
- tessellator.addVertexWithUV(x + minX * scale + maxX * scale,
- y + minY * scale, z + minZ * scale + maxZ * scale, 1, 1);
- tessellator.addVertexWithUV(x + minX * scale - maxX * scale,
- y - minY * scale, z + minZ * scale - maxZ * scale, 0, 1);
+ tessellator.addVertexWithUV(
+ x - minX * scale - maxX * scale,
+ y - minY * scale,
+ z - minZ * scale - maxZ * scale, 0, 0);
+ tessellator.addVertexWithUV(
+ x - minX * scale + maxX * scale,
+ y + minY * scale,
+ z - minZ * scale + maxZ * scale, 1, 0);
+ tessellator.addVertexWithUV(
+ x + minX * scale + maxX * scale,
+ y + minY * scale,
+ z + minZ * scale + maxZ * scale, 1, 1);
+ tessellator.addVertexWithUV(
+ x + minX * scale - maxX * scale,
+ y - minY * scale,
+ z + minZ * scale - maxZ * scale, 0, 1);
tessellator.draw();
tessellator.startDrawingQuads();
}
@@ -87,22 +97,30 @@ public class EntityShadowsFX extends EntityFX { motionX = motionY = motionZ = 0;
if (particleAge++ >= particleMaxAge)
setDead();
- AxisAlignedBB axisalignedbb =
- boundingBox.expand(16.0D, 16.0D, 16.0D);
- List<?> list1 = worldObj.getEntitiesWithinAABB(Entity.class,
- axisalignedbb);
- if (!worldObj.isRemote && list1 != null && !list1.isEmpty()) {
+ AxisAlignedBB axisalignedbb = boundingBox.expand(16.0D,
+ 16.0D, 16.0D);
+ List<?> list1 = worldObj.getEntitiesWithinAABB(
+ Entity.class, axisalignedbb);
+ if (!worldObj.isRemote && list1 != null
+ && !list1.isEmpty()) {
Iterator<?> iterator = list1.iterator();
while (iterator.hasNext()) {
Entity entity = (Entity) iterator.next();
- if (entity != null && posX <= entity.posX + 0.5F
- && posX >= entity.posX - 0.5F
- && posZ <= entity.posZ + 0.5F
- && posZ >= entity.posZ - 0.5F)
- entity.attackEntityFrom(DamageSourceList.shadows,
+ if (entity != null
+ && posX <= entity.posX
+ + 0.5F
+ && posX >= entity.posX
+ - 0.5F
+ && posZ <= entity.posZ
+ + 0.5F
+ && posZ >= entity.posZ
+ - 0.5F)
+ entity.attackEntityFrom(
+ DamageSourceList.shadows,
100F);
if (entity instanceof EntityThrowable)
- ((EntityThrowable) entity).setDead();
+ ((EntityThrowable) entity)
+ .setDead();
}
}
}
diff --git a/src/main/java/darkknight/jewelrycraft/potions/PotionList.java b/src/main/java/darkknight/jewelrycraft/potions/PotionList.java index 632e92a..53c768e 100755 --- a/src/main/java/darkknight/jewelrycraft/potions/PotionList.java +++ b/src/main/java/darkknight/jewelrycraft/potions/PotionList.java @@ -23,8 +23,9 @@ public class PotionList { if (Potion.potionTypes.length > 231) {
stun = new PotionStun(230, true, 0x000000);
} else {
- stun = new PotionStun(Potion.potionTypes.length - 2, true,
- 0x000000);
+ stun = new PotionStun(
+ Potion.potionTypes.length - 2,
+ true, 0x000000);
}
}
diff --git a/src/main/java/darkknight/jewelrycraft/potions/PotionStun.java b/src/main/java/darkknight/jewelrycraft/potions/PotionStun.java index a361e9f..a0fca81 100755 --- a/src/main/java/darkknight/jewelrycraft/potions/PotionStun.java +++ b/src/main/java/darkknight/jewelrycraft/potions/PotionStun.java @@ -36,8 +36,8 @@ public class PotionStun extends PotionBase { entity.rotationYaw = entity.prevRotationYaw;
entity.worldObj.spawnParticle("spell", entity.posX,
- entity.posY + entity.getEyeHeight(), entity.posZ, 0.0D,
- 0.3D, 0.0D);
+ entity.posY + entity.getEyeHeight(),
+ entity.posZ, 0.0D, 0.3D, 0.0D);
if (entity.getActivePotionEffect(PotionList.stun)
.getDuration() == 0) {
diff --git a/src/main/java/darkknight/jewelrycraft/proxy/ClientProxy.java b/src/main/java/darkknight/jewelrycraft/proxy/ClientProxy.java index 5faa43f..f7a6842 100755 --- a/src/main/java/darkknight/jewelrycraft/proxy/ClientProxy.java +++ b/src/main/java/darkknight/jewelrycraft/proxy/ClientProxy.java @@ -71,21 +71,23 @@ public class ClientProxy extends CommonProxy { @Override
public void preInit() {
- TileEntityHandPedestalRender pedestalRender =
- new TileEntityHandPedestalRender(
- new ModelHandPedestal(Variables.PEDESTAL_TEXTURE),
- Variables.PEDESTAL_TEXTURE);
- TileEntityShadowHandRender shadowHandRender =
- new TileEntityShadowHandRender(
- new ModelShadowHand(Variables.SHADOW_HAND_TEXTURE),
- Variables.SHADOW_HAND_TEXTURE);
+ TileEntityHandPedestalRender pedestalRender = new TileEntityHandPedestalRender(
+ new ModelHandPedestal(
+ Variables.PEDESTAL_TEXTURE),
+ Variables.PEDESTAL_TEXTURE);
+ TileEntityShadowHandRender shadowHandRender = new TileEntityShadowHandRender(
+ new ModelShadowHand(
+ Variables.SHADOW_HAND_TEXTURE),
+ Variables.SHADOW_HAND_TEXTURE);
JewelrycraftMod.logger.log(Level.INFO,
"Binding Tileentities to their Special Rendered");
ClientRegistry.bindTileEntitySpecialRenderer(
- TileEntitySmelter.class, new TileEntitySmelterRender());
+ TileEntitySmelter.class,
+ new TileEntitySmelterRender());
ClientRegistry.bindTileEntitySpecialRenderer(
- TileEntityMolder.class, new TileEntityMolderRender());
+ TileEntityMolder.class,
+ new TileEntityMolderRender());
ClientRegistry.bindTileEntitySpecialRenderer(
TileEntityJewelrsCraftingTable.class,
new TileEntityJewelrsCraftingTableRender());
@@ -99,43 +101,53 @@ public class ClientProxy extends CommonProxy { TileEntityMidasTouch.class,
new TileEntityMidasTouchRender());
ClientRegistry.bindTileEntitySpecialRenderer(
- TileEntityHandPedestal.class, pedestalRender);
+ TileEntityHandPedestal.class,
+ pedestalRender);
ClientRegistry.bindTileEntitySpecialRenderer(
- TileEntityShadowHand.class, shadowHandRender);
+ TileEntityShadowHand.class,
+ shadowHandRender);
JewelrycraftMod.logger.log(Level.INFO,
"Registering Item Renderes");
MinecraftForgeClient.registerItemRenderer(
Item.getItemFromBlock(BlockList.displayer),
new ItemRender(new TileEntityDisplayerRender(),
- new TileEntityDisplayer(), new ModelDisplayer()));
+ new TileEntityDisplayer(),
+ new ModelDisplayer()));
MinecraftForgeClient.registerItemRenderer(
- Item.getItemFromBlock(BlockList.jewelCraftingTable),
+ Item.getItemFromBlock(
+ BlockList.jewelCraftingTable),
new ItemRender(new TileEntityJewelrsCraftingTableRender(),
new TileEntityJewelrsCraftingTable(),
new ModelJewlersCraftingBench()));
MinecraftForgeClient.registerItemRenderer(
Item.getItemFromBlock(BlockList.smelter),
new ItemRender(new TileEntitySmelterRender(),
- new TileEntitySmelter(), new ModelSmelter()));
+ new TileEntitySmelter(),
+ new ModelSmelter()));
MinecraftForgeClient.registerItemRenderer(
Item.getItemFromBlock(BlockList.molder),
new ItemRender(new TileEntityMolderRender(),
- new TileEntityMolder(), new ModelMolder()));
+ new TileEntityMolder(),
+ new ModelMolder()));
MinecraftForgeClient.registerItemRenderer(
Item.getItemFromBlock(BlockList.shadowEye),
new ItemRender(new TileEntityShadowEyeRender(),
- new TileEntityShadowEye(), new ModelShadowEye()));
+ new TileEntityShadowEye(),
+ new ModelShadowEye()));
MinecraftForgeClient.registerItemRenderer(
- Item.getItemFromBlock(BlockList.handPedestal),
+ Item.getItemFromBlock(
+ BlockList.handPedestal),
new ItemRender(pedestalRender,
new TileEntityHandPedestal(),
new ModelHandPedestal(
Variables.PEDESTAL_TEXTURE)));
MinecraftForgeClient.registerItemRenderer(
- Item.getItemFromBlock(BlockList.shadowHand),
+ Item.getItemFromBlock(
+ BlockList.shadowHand),
new ItemRender(shadowHandRender,
- new TileEntityShadowHand(), new ModelShadowHand(
+ new TileEntityShadowHand(),
+ new ModelShadowHand(
Variables.SHADOW_HAND_TEXTURE)));
MinecraftForgeClient.registerItemRenderer(ItemList.goldObj,
new ItemRender());
@@ -145,26 +157,31 @@ public class ClientProxy extends CommonProxy { JewelrycraftMod.logger.log(Level.INFO,
"Registering Entity Renders");
- RenderingRegistry.registerEntityRenderingHandler(EntityHeart.class,
+ RenderingRegistry.registerEntityRenderingHandler(
+ EntityHeart.class,
new HeartRender(new ModelHeart(), 0.25F));
RenderingRegistry.registerEntityRenderingHandler(
EntityHalfHeart.class,
- new HeartRender(new ModelHalfHeart(), 0.25F));
+ new HeartRender(new ModelHalfHeart(),
+ 0.25F));
- RenderingRegistry.registerBlockHandler(new BlockCrystalRenderer());
+ RenderingRegistry.registerBlockHandler(
+ new BlockCrystalRenderer());
TabRegistry.registerTab(new InventoryTabVanilla());
TabRegistry.registerTab(new TabJewelry());
TabRegistry.registerTab(new TabCurses());
MinecraftForge.EVENT_BUS.register(new TabRegistry());
- MinecraftForge.EVENT_BUS.register(new PlayerRenderHandler());
MinecraftForge.EVENT_BUS
- .register(new ScreenHandler(Minecraft.getMinecraft()));
+ .register(new PlayerRenderHandler());
+ MinecraftForge.EVENT_BUS.register(new ScreenHandler(
+ Minecraft.getMinecraft()));
}
@Override
public void init() {
- FMLCommonHandler.instance().bus().register(new KeyBindings());
+ FMLCommonHandler.instance().bus()
+ .register(new KeyBindings());
MinecraftForge.EVENT_BUS.register(new TextureEvent());
}
diff --git a/src/main/java/darkknight/jewelrycraft/random/WeightedRandomItem.java b/src/main/java/darkknight/jewelrycraft/random/WeightedRandomItem.java index c522009..cc84ab4 100755 --- a/src/main/java/darkknight/jewelrycraft/random/WeightedRandomItem.java +++ b/src/main/java/darkknight/jewelrycraft/random/WeightedRandomItem.java @@ -7,7 +7,7 @@ import net.minecraft.util.WeightedRandom; public class WeightedRandomItem extends WeightedRandom.Item {
private final ItemStack item;
- private int maxMeta, minMeta, minItem, maxItem;
+ private int maxMeta, minMeta, minItem, maxItem;
public WeightedRandomItem(ItemStack item, int weight) {
super(weight);
@@ -54,11 +54,13 @@ public class WeightedRandomItem extends WeightedRandom.Item { public ItemStack getItem(Random random) {
ItemStack itemstack = this.item.copy();
if (maxMeta > 0)
- itemstack.setItemDamage(
- minMeta + random.nextInt(maxMeta - minMeta));
+ itemstack.setItemDamage(minMeta + random
+ .nextInt(maxMeta - minMeta));
if (maxItem > 1)
itemstack.stackSize = this.minItem
- + random.nextInt(this.maxItem - this.minItem + 1);
+ + random.nextInt(this.maxItem
+ - this.minItem
+ + 1);
return itemstack;
}
}
\ No newline at end of file diff --git a/src/main/java/darkknight/jewelrycraft/recipes/CraftingRecipes.java b/src/main/java/darkknight/jewelrycraft/recipes/CraftingRecipes.java index 34374d1..ca2f2aa 100755 --- a/src/main/java/darkknight/jewelrycraft/recipes/CraftingRecipes.java +++ b/src/main/java/darkknight/jewelrycraft/recipes/CraftingRecipes.java @@ -18,82 +18,154 @@ public class CraftingRecipes { public static void preInit(FMLPreInitializationEvent e) {
if (!isInitialized) {
// Items
- GameRegistry.addRecipe(new ItemStack(ItemList.thiefGloves),
- "x x", "yxy", "yxy", 'x', ItemList.shadowIngot, 'y',
+ GameRegistry.addRecipe(new ItemStack(
+ ItemList.thiefGloves), "x x",
+ "yxy", "yxy", 'x',
+ ItemList.shadowIngot, 'y',
new ItemStack(Blocks.wool, 1, 15));
// Disable ingot molds for balance reasons
- //GameRegistry.addRecipe(new ItemStack(ItemList.clayMolds, 1, 0),
- // "xx", 'x', Items.clay_ball);
- GameRegistry.addRecipe(new ItemStack(ItemList.clayMolds, 1, 1),
- " x ", "x x", " x ", 'x', Items.clay_ball);
- GameRegistry.addRecipe(new ItemStack(ItemList.clayMolds, 1, 2),
- "x x", "x x", " x ", 'x', Items.clay_ball);
- GameRegistry.addRecipe(new ItemStack(ItemList.clayMolds, 1, 3),
- "xxx", "x x", "xxx", 'x', Items.clay_ball);
- GameRegistry.addRecipe(new ItemStack(ItemList.clayMolds, 1, 4),
+ // GameRegistry.addRecipe(new
+ // ItemStack(ItemList.clayMolds, 1, 0),
+ // "xx", 'x', Items.clay_ball);
+ GameRegistry.addRecipe(
+ new ItemStack(ItemList.clayMolds,
+ 1, 1),
+ " x ", "x x", " x ", 'x',
+ Items.clay_ball);
+ GameRegistry.addRecipe(
+ new ItemStack(ItemList.clayMolds,
+ 1, 2),
+ "x x", "x x", " x ", 'x',
+ Items.clay_ball);
+ GameRegistry.addRecipe(
+ new ItemStack(ItemList.clayMolds,
+ 1, 3),
+ "xxx", "x x", "xxx", 'x',
+ Items.clay_ball);
+ GameRegistry.addRecipe(
+ new ItemStack(ItemList.clayMolds,
+ 1, 4),
"x x", 'x', Items.clay_ball);
- GameRegistry.addRecipe(new ItemStack(BlockList.handPedestal),
- "bbb", " x ", "yxy", 'x', Blocks.stonebrick, 'y',
- new ItemStack(Blocks.stone_slab, 1, 5), 'b',
- Blocks.cobblestone_wall);
- GameRegistry.addRecipe(new ItemStack(BlockList.shadowEye),
- "bcb", "cec", "bcb", 'b', Blocks.stonebrick, 'c',
- new ItemStack(Blocks.stained_hardened_clay, 1, 15),
+ GameRegistry.addRecipe(new ItemStack(
+ BlockList.handPedestal), "bbb",
+ " x ", "yxy", 'x',
+ Blocks.stonebrick, 'y',
+ new ItemStack(Blocks.stone_slab, 1,
+ 5),
+ 'b', Blocks.cobblestone_wall);
+ GameRegistry.addRecipe(
+ new ItemStack(BlockList.shadowEye),
+ "bcb", "cec", "bcb", 'b',
+ Blocks.stonebrick, 'c',
+ new ItemStack(Blocks.stained_hardened_clay,
+ 1, 15),
'e', Items.ender_eye);
GameRegistry.addShapelessRecipe(
- new ItemStack(ItemList.shadowIngot, 9),
- new Object[] { new ItemStack(BlockList.shadowBlock) });
- GameRegistry.addShapelessRecipe(new ItemStack(ItemList.guide),
- new Object[] { new ItemStack(Items.book),
- new ItemStack(ItemList.molds, 1, 0) });
- GameRegistry.addShapelessRecipe(new ItemStack(ItemList.guide),
- new Object[] { new ItemStack(Items.book),
- new ItemStack(ItemList.molds, 1, 1) });
- GameRegistry.addShapelessRecipe(new ItemStack(ItemList.guide),
- new Object[] { new ItemStack(Items.book),
- new ItemStack(ItemList.molds, 1, 2) });
- GameRegistry.addShapelessRecipe(new ItemStack(ItemList.guide),
- new Object[] { new ItemStack(Items.book),
- new ItemStack(ItemList.molds, 1, 3) });
- GameRegistry.addShapelessRecipe(new ItemStack(ItemList.guide),
- new Object[] { new ItemStack(Items.book),
- new ItemStack(ItemList.molds, 1, 4) });
+ new ItemStack(ItemList.shadowIngot,
+ 9),
+ new Object[] {
+ new ItemStack(BlockList.shadowBlock)
+ });
+ GameRegistry.addShapelessRecipe(
+ new ItemStack(ItemList.guide),
+ new Object[] {
+ new ItemStack(Items.book),
+ new ItemStack(ItemList.molds,
+ 1,
+ 0)
+ });
+ GameRegistry.addShapelessRecipe(
+ new ItemStack(ItemList.guide),
+ new Object[] {
+ new ItemStack(Items.book),
+ new ItemStack(ItemList.molds,
+ 1,
+ 1)
+ });
+ GameRegistry.addShapelessRecipe(
+ new ItemStack(ItemList.guide),
+ new Object[] {
+ new ItemStack(Items.book),
+ new ItemStack(ItemList.molds,
+ 1,
+ 2)
+ });
+ GameRegistry.addShapelessRecipe(
+ new ItemStack(ItemList.guide),
+ new Object[] {
+ new ItemStack(Items.book),
+ new ItemStack(ItemList.molds,
+ 1,
+ 3)
+ });
+ GameRegistry.addShapelessRecipe(
+ new ItemStack(ItemList.guide),
+ new Object[] {
+ new ItemStack(Items.book),
+ new ItemStack(ItemList.molds,
+ 1,
+ 4)
+ });
// Blocks
- GameRegistry.addRecipe(
- new ShapedOreRecipe(new ItemStack(BlockList.molder),
- "x x", "xxx", 'x', Blocks.cobblestone));
- GameRegistry.addRecipe(
- new ShapedOreRecipe(new ItemStack(BlockList.smelter),
- "xyx", "x x", "xzx", 'x', Blocks.cobblestone,
- 'y', Items.bucket, 'z', Items.lava_bucket));
GameRegistry.addRecipe(new ShapedOreRecipe(
- new ItemStack(BlockList.jewelCraftingTable), "xxx",
- "y y", "y y", 'x', Blocks.planks, 'y', Blocks.stone));
+ new ItemStack(BlockList.molder),
+ "x x", "xxx", 'x',
+ Blocks.cobblestone));
+ GameRegistry.addRecipe(new ShapedOreRecipe(
+ new ItemStack(BlockList.smelter),
+ "xyx", "x x", "xzx", 'x',
+ Blocks.cobblestone, 'y',
+ Items.bucket, 'z',
+ Items.lava_bucket));
+ GameRegistry.addRecipe(new ShapedOreRecipe(
+ new ItemStack(BlockList.jewelCraftingTable),
+ "xxx", "y y", "y y", 'x',
+ Blocks.planks, 'y', Blocks.stone));
GameRegistry.addRecipe(new ShapedOreRecipe(
- new ItemStack(BlockList.displayer, 2), " x ", "xxx",
- "yyy", 'x', Items.iron_ingot, 'y',
+ new ItemStack(BlockList.displayer,
+ 2),
+ " x ", "xxx", "yyy", 'x',
+ Items.iron_ingot, 'y',
Blocks.emerald_block));
GameRegistry.addRecipe(new ShapedOreRecipe(
- new ItemStack(BlockList.shadowBlock, 1), "xxx", "xxx",
- "xxx", 'x', ItemList.shadowIngot));
+ new ItemStack(BlockList.shadowBlock,
+ 1),
+ "xxx", "xxx", "xxx", 'x',
+ ItemList.shadowIngot));
// Smelting
GameRegistry.addSmelting(BlockList.shadowOre,
- new ItemStack(ItemList.shadowIngot), 1.5f);
+ new ItemStack(ItemList.shadowIngot),
+ 1.5f);
GameRegistry.addSmelting(
- new ItemStack(ItemList.clayMolds, 1, 0),
- new ItemStack(ItemList.molds, 1, 0), 0.2F);
+ new ItemStack(ItemList.clayMolds,
+ 1, 0),
+ new ItemStack(ItemList.molds, 1,
+ 0),
+ 0.2F);
GameRegistry.addSmelting(
- new ItemStack(ItemList.clayMolds, 1, 1),
- new ItemStack(ItemList.molds, 1, 1), 0.2F);
+ new ItemStack(ItemList.clayMolds,
+ 1, 1),
+ new ItemStack(ItemList.molds, 1,
+ 1),
+ 0.2F);
GameRegistry.addSmelting(
- new ItemStack(ItemList.clayMolds, 1, 2),
- new ItemStack(ItemList.molds, 1, 2), 0.2F);
+ new ItemStack(ItemList.clayMolds,
+ 1, 2),
+ new ItemStack(ItemList.molds, 1,
+ 2),
+ 0.2F);
GameRegistry.addSmelting(
- new ItemStack(ItemList.clayMolds, 1, 3),
- new ItemStack(ItemList.molds, 1, 3), 0.2F);
+ new ItemStack(ItemList.clayMolds,
+ 1, 3),
+ new ItemStack(ItemList.molds, 1,
+ 3),
+ 0.2F);
GameRegistry.addSmelting(
- new ItemStack(ItemList.clayMolds, 1, 4),
- new ItemStack(ItemList.molds, 1, 4), 0.2F);
+ new ItemStack(ItemList.clayMolds,
+ 1, 4),
+ new ItemStack(ItemList.molds, 1,
+ 4),
+ 0.2F);
isInitialized = true;
}
}
diff --git a/src/main/java/darkknight/jewelrycraft/thirdparty/EE3.java b/src/main/java/darkknight/jewelrycraft/thirdparty/EE3.java index e9bb21f..8f61767 100755 --- a/src/main/java/darkknight/jewelrycraft/thirdparty/EE3.java +++ b/src/main/java/darkknight/jewelrycraft/thirdparty/EE3.java @@ -29,34 +29,49 @@ public class EE3 implements IThirdParty { new ItemStack(BlockList.shadowOre), 4096);
EnergyValueRegistryProxy.addPostAssignedEnergyValue(
- new ItemStack(BlockList.shadowBlock), 36864);
+ new ItemStack(BlockList.shadowBlock),
+ 36864);
EnergyValueRegistryProxy.addPostAssignedEnergyValue(
new ItemStack(ItemList.shadowIngot), 4096);
EnergyValueRegistryProxy.addPostAssignedEnergyValue(
- new ItemStack(BlockList.jewelCraftingTable), 16640);
+ new ItemStack(BlockList.jewelCraftingTable),
+ 16640);
EnergyValueRegistryProxy.addPostAssignedEnergyValue(
new ItemStack(ItemList.guide), 288);
for (int i = 0; i < ItemClayMolds.moldsItemNames.length; i++) {
- EnergyValueRegistryProxy.addPostAssignedEnergyValue(
- new ItemStack(ItemList.clayMolds, 1, i), 128);
+ EnergyValueRegistryProxy
+ .addPostAssignedEnergyValue(
+ new ItemStack(ItemList.clayMolds,
+ 1,
+ i),
+ 128);
}
for (int i = 0; i < ItemMolds.moldsItemNames.length; i++) {
- EnergyValueRegistryProxy.addPostAssignedEnergyValue(
- new ItemStack(ItemList.molds, 1, i), 128);
+ EnergyValueRegistryProxy
+ .addPostAssignedEnergyValue(
+ new ItemStack(ItemList.molds,
+ 1,
+ i),
+ 128);
}
for (int i = 0; i < BlockCrystal.colors.length; i++) {
- EnergyValueRegistryProxy.addPostAssignedEnergyValue(
- new ItemStack(BlockList.crystal, 1, i), 64);
+ EnergyValueRegistryProxy
+ .addPostAssignedEnergyValue(
+ new ItemStack(BlockList.crystal,
+ 1,
+ i),
+ 64);
}
for (int i = 0; i < Names.Items.GEM_SUBTYPES.length; i++) {
- JewelrycraftUtil.gem.add(new ItemStack(ModItems.gem, 1, i));
+ JewelrycraftUtil.gem.add(
+ new ItemStack(ModItems.gem, 1, i));
}
}
diff --git a/src/main/java/darkknight/jewelrycraft/thirdparty/ModIds.java b/src/main/java/darkknight/jewelrycraft/thirdparty/ModIds.java index 7bda520..42fc800 100755 --- a/src/main/java/darkknight/jewelrycraft/thirdparty/ModIds.java +++ b/src/main/java/darkknight/jewelrycraft/thirdparty/ModIds.java @@ -4,26 +4,26 @@ package darkknight.jewelrycraft.thirdparty; * @author MineMarteen from Pneumaticraft
*/
public class ModIds {
- public static final String BUILDCRAFT = "BuildCraft|Core";
+ public static final String BUILDCRAFT = "BuildCraft|Core";
public static final String COMPUTERCRAFT = "ComputerCraft";
public static final String INDUSTRIALCRAFT = "IC2";
- public static final String IGWMOD = "IGWMod";
- public static final String FMP = "ForgeMultipart";
- public static final String WAILA = "Waila";
- public static final String TE = "ThermalExpansion";
- public static final String HC = "HydCraft";
- public static final String NEI = "NotEnoughItems";
- public static final String THAUMCRAFT = "Thaumcraft";
- public static final String BLOOD_MAGIC = "AWWayofTime";
- public static final String AE2 = "appliedenergistics2";
- public static final String CHISEL = "chisel";
- public static final String FORESTRY = "Forestry";
- public static final String MFR = "MineFactoryReloaded";
- public static final String OPEN_BLOCKS = "OpenBlocks";
- public static final String COFH_CORE = "CoFHCore";
+ public static final String IGWMOD = "IGWMod";
+ public static final String FMP = "ForgeMultipart";
+ public static final String WAILA = "Waila";
+ public static final String TE = "ThermalExpansion";
+ public static final String HC = "HydCraft";
+ public static final String NEI = "NotEnoughItems";
+ public static final String THAUMCRAFT = "Thaumcraft";
+ public static final String BLOOD_MAGIC = "AWWayofTime";
+ public static final String AE2 = "appliedenergistics2";
+ public static final String CHISEL = "chisel";
+ public static final String FORESTRY = "Forestry";
+ public static final String MFR = "MineFactoryReloaded";
+ public static final String OPEN_BLOCKS = "OpenBlocks";
+ public static final String COFH_CORE = "CoFHCore";
public static final String NOT_ENOUGH_KEYS = "notenoughkeys";
public static final String OPEN_COMPUTERS = "OpenComputers|Core";
- public static final String EE3 = "EE3";
+ public static final String EE3 = "EE3";
public static final String PENUMATICRAFT = "PneumaticCraft";
- public static final String ALPACA = "alpaca";
+ public static final String ALPACA = "alpaca";
}
\ No newline at end of file diff --git a/src/main/java/darkknight/jewelrycraft/thirdparty/NEI.java b/src/main/java/darkknight/jewelrycraft/thirdparty/NEI.java index feb6e6f..70a8744 100755 --- a/src/main/java/darkknight/jewelrycraft/thirdparty/NEI.java +++ b/src/main/java/darkknight/jewelrycraft/thirdparty/NEI.java @@ -19,12 +19,14 @@ public class NEI implements IThirdParty { @Override
public void postInit() {
for (int i = 0; i < Curse.getCurseList().size(); i++)
- codechicken.nei.api.API
- .hideItem(new ItemStack(ItemList.testItem, 1, i));
- codechicken.nei.api.API.hideItem(new ItemStack(ItemList.goldObj));
+ codechicken.nei.api.API.hideItem(new ItemStack(
+ ItemList.testItem, 1, i));
codechicken.nei.api.API
- .hideItem(new ItemStack(BlockList.midasTouchBlock));
- codechicken.nei.api.API.hideItem(new ItemStack(ItemList.metal));
+ .hideItem(new ItemStack(ItemList.goldObj));
+ codechicken.nei.api.API.hideItem(
+ new ItemStack(BlockList.midasTouchBlock));
+ codechicken.nei.api.API
+ .hideItem(new ItemStack(ItemList.metal));
}
@Override
diff --git a/src/main/java/darkknight/jewelrycraft/thirdparty/ThirdPartyManager.java b/src/main/java/darkknight/jewelrycraft/thirdparty/ThirdPartyManager.java index 612d23d..bb819d5 100755 --- a/src/main/java/darkknight/jewelrycraft/thirdparty/ThirdPartyManager.java +++ b/src/main/java/darkknight/jewelrycraft/thirdparty/ThirdPartyManager.java @@ -21,18 +21,15 @@ import net.minecraft.world.World; */
public class ThirdPartyManager implements IGuiHandler {
- private static ThirdPartyManager INSTANCE =
- new ThirdPartyManager();
- private final List<IThirdParty> thirdPartyMods =
- new ArrayList<>();
+ private static ThirdPartyManager INSTANCE = new ThirdPartyManager();
+ private final List<IThirdParty> thirdPartyMods = new ArrayList<>();
public static ThirdPartyManager instance() {
return INSTANCE;
}
public void index() {
- Map<String, Class<? extends IThirdParty>> thirdPartyClasses =
- new HashMap<>();
+ Map<String, Class<? extends IThirdParty>> thirdPartyClasses = new HashMap<>();
thirdPartyClasses.put(ModIds.EE3, EE3.class);
thirdPartyClasses.put(ModIds.NEI, NEI.class);
@@ -46,7 +43,8 @@ public class ThirdPartyManager implements IGuiHandler { for (String modid : thirdPartyClasses.keySet()) {
if (ConfigHandler.config
- .get("Third_Party_Enabling", modid, true)
+ .get("Third_Party_Enabling", modid,
+ true)
.getBoolean()) {
enabledThirdParty.add(modid);
}
@@ -54,15 +52,17 @@ public class ThirdPartyManager implements IGuiHandler { ConfigHandler.config.save();
- for (Map.Entry<String,
- Class<? extends IThirdParty>> entry : thirdPartyClasses
- .entrySet()) {
+ for (Map.Entry<String, Class<? extends IThirdParty>> entry : thirdPartyClasses
+ .entrySet()) {
if (enabledThirdParty.contains(entry.getKey())
- && Loader.isModLoaded(entry.getKey())) {
+ && Loader.isModLoaded(
+ entry.getKey())) {
try {
- thirdPartyMods.add(entry.getValue().newInstance());
+ thirdPartyMods.add(entry.getValue()
+ .newInstance());
} catch (Exception e) {
- JewelrycraftMod.logger.log(Level.ERROR,
+ JewelrycraftMod.logger.log(
+ Level.ERROR,
"Failed to instantiate third party handler!");
e.printStackTrace();
}
@@ -73,14 +73,16 @@ public class ThirdPartyManager implements IGuiHandler { public void onItemRegistry(Item item) {
for (IThirdParty thirdParty : thirdPartyMods) {
if (thirdParty instanceof IRegistryListener)
- ((IRegistryListener) thirdParty).onItemRegistry(item);
+ ((IRegistryListener) thirdParty)
+ .onItemRegistry(item);
}
}
public void onBlockRegistry(Block block) {
for (IThirdParty thirdParty : thirdPartyMods) {
if (thirdParty instanceof IRegistryListener)
- ((IRegistryListener) thirdParty).onBlockRegistry(block);
+ ((IRegistryListener) thirdParty)
+ .onBlockRegistry(block);
}
}
@@ -133,7 +135,8 @@ public class ThirdPartyManager implements IGuiHandler { } catch (Throwable e) {
JewelrycraftMod.logger.log(Level.ERROR,
"Jewelrycraft wasn't able to load third party content from the third party class "
- + thirdParty.getClass() + " client side!");
+ + thirdParty.getClass()
+ + " client side!");
e.printStackTrace();
}
}
@@ -159,7 +162,10 @@ public class ThirdPartyManager implements IGuiHandler { for (IThirdParty thirdParty : thirdPartyMods) {
if (thirdParty instanceof IGuiHandler) {
Object obj = ((IGuiHandler) thirdParty)
- .getServerGuiElement(ID, player, world, x, y, z);
+ .getServerGuiElement(ID,
+ player,
+ world, x,
+ y, z);
if (obj != null)
return obj;
}
@@ -173,7 +179,10 @@ public class ThirdPartyManager implements IGuiHandler { for (IThirdParty thirdParty : thirdPartyMods) {
if (thirdParty instanceof IGuiHandler) {
Object obj = ((IGuiHandler) thirdParty)
- .getClientGuiElement(ID, player, world, x, y, z);
+ .getClientGuiElement(ID,
+ player,
+ world, x,
+ y, z);
if (obj != null)
return obj;
}
diff --git a/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityBlockShadow.java b/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityBlockShadow.java index b17047e..dc387ff 100755 --- a/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityBlockShadow.java +++ b/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityBlockShadow.java @@ -43,34 +43,45 @@ public class TileEntityBlockShadow extends TileEntity { public void updateEntity() { super.updateEntity(); int blockLight, realLight; - int lightValue = worldObj.getSavedLightValue(EnumSkyBlock.Sky, - xCoord, yCoord, zCoord) - worldObj.skylightSubtracted; - float sunPosAngle = worldObj.getCelestialAngleRadians(1.0F); + int lightValue = worldObj.getSavedLightValue( + EnumSkyBlock.Sky, xCoord, yCoord, zCoord) + - worldObj.skylightSubtracted; + float sunPosAngle = worldObj + .getCelestialAngleRadians(1.0F); if (sunPosAngle < (float) Math.PI) sunPosAngle += (0.0F - sunPosAngle) * 0.2F; else - sunPosAngle += ((float) Math.PI * 2F - sunPosAngle) * 0.2F; - lightValue = Math.round(lightValue * MathHelper.cos(sunPosAngle)); + sunPosAngle += ((float) Math.PI * 2F - sunPosAngle) + * 0.2F; + lightValue = Math.round( + lightValue * MathHelper.cos(sunPosAngle)); if (lightValue < 0) lightValue = 0; if (lightValue > 15) lightValue = 15; - blockLight = worldObj.getChunkFromBlockCoords(xCoord, zCoord) - .getSavedLightValue(EnumSkyBlock.Block, xCoord & 15, - yCoord, zCoord & 15); - realLight = worldObj.getChunkFromBlockCoords(xCoord, zCoord) - .getBlockLightValue(xCoord & 15, yCoord, zCoord & 15, 0); + blockLight = worldObj + .getChunkFromBlockCoords(xCoord, zCoord) + .getSavedLightValue(EnumSkyBlock.Block, + xCoord & 15, yCoord, + zCoord & 15); + realLight = worldObj + .getChunkFromBlockCoords(xCoord, zCoord) + .getBlockLightValue(xCoord & 15, yCoord, + zCoord & 15, 0); if (blockLight == 0 - && worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord) + && worldObj.canBlockSeeTheSky(xCoord, + yCoord, zCoord) || lightValue >= blockLight) metadata = 15 - lightValue; - else if (!worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord)) + else if (!worldObj.canBlockSeeTheSky(xCoord, yCoord, + zCoord)) metadata = 15 - realLight; else if (lightValue < blockLight) metadata = 15 - blockLight; worldObj.setBlockMetadataWithNotify(xCoord, yCoord, zCoord, metadata, 2); - worldObj.notifyBlocksOfNeighborChange(xCoord, yCoord, zCoord, + worldObj.notifyBlocksOfNeighborChange(xCoord, yCoord, + zCoord, worldObj.getBlock(xCoord, yCoord, zCoord)); } @@ -81,8 +92,8 @@ public class TileEntityBlockShadow extends TileEntity { public Packet getDescriptionPacket() { NBTTagCompound nbttagcompound = new NBTTagCompound(); writeToNBT(nbttagcompound); - return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, 1, - nbttagcompound); + return new S35PacketUpdateTileEntity(xCoord, yCoord, + zCoord, 1, nbttagcompound); } /** diff --git a/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityCrystal.java b/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityCrystal.java index 46288b4..90fbd99 100755 --- a/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityCrystal.java +++ b/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityCrystal.java @@ -12,7 +12,7 @@ import net.minecraft.tileentity.TileEntity; public class TileEntityCrystal extends TileEntity {
public int shine = 120;
boolean descent = false;
- int timer = 0;
+ int timer = 0;
@Override
public void updateEntity() {
@@ -28,8 +28,9 @@ public class TileEntityCrystal extends TileEntity { if (shine <= 100)
descent = false;
}
- this.worldObj.markBlockRangeForRenderUpdate(xCoord, yCoord,
- zCoord, xCoord, yCoord, zCoord);
+ this.worldObj.markBlockRangeForRenderUpdate(
+ xCoord, yCoord, zCoord,
+ xCoord, yCoord, zCoord);
timer = 0;
}
}
diff --git a/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityDisplayer.java b/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityDisplayer.java index a0c2600..72fa7c0 100755 --- a/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityDisplayer.java +++ b/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityDisplayer.java @@ -11,10 +11,10 @@ import net.minecraft.tileentity.TileEntity; public class TileEntityDisplayer extends TileEntity {
public float ringTranslation1, ringTranslation2,
ringTranslation3, rotAngle;
- public boolean isDescending1, isDescending2, isDescending3,
- isDirty, hasObject;
+ public boolean isDescending1, isDescending2,
+ isDescending3, isDirty, hasObject;
public ItemStack object;
- public int quantity, infoIndex, timer = 0;
+ public int quantity, infoIndex, timer = 0;
/**
*
@@ -82,7 +82,8 @@ public class TileEntityDisplayer extends TileEntity { public void updateEntity() {
super.updateEntity();
if (isDirty) {
- worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
+ worldObj.markBlockForUpdate(xCoord, yCoord,
+ zCoord);
isDirty = false;
}
if (ringTranslation1 >= 0.6)
@@ -127,8 +128,8 @@ public class TileEntityDisplayer extends TileEntity { public Packet getDescriptionPacket() {
NBTTagCompound nbttagcompound = new NBTTagCompound();
writeToNBT(nbttagcompound);
- return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, 1,
- nbttagcompound);
+ return new S35PacketUpdateTileEntity(xCoord, yCoord,
+ zCoord, 1, nbttagcompound);
}
/**
diff --git a/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityHandPedestal.java b/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityHandPedestal.java index c44cd88..f6fb323 100755 --- a/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityHandPedestal.java +++ b/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityHandPedestal.java @@ -57,7 +57,8 @@ public class TileEntityHandPedestal extends TileEntity { super.readFromNBT(tagCompound);
if (tagCompound.hasKey("object", 10))
setHeldItemStack(ItemStack.loadItemStackFromNBT(
- tagCompound.getCompoundTag("object")));
+ tagCompound.getCompoundTag(
+ "object")));
else
removeHeldItemStack();
isHandOpen = tagCompound.getBoolean("isHandOpen");
@@ -71,7 +72,8 @@ public class TileEntityHandPedestal extends TileEntity { super.updateEntity();
updateGrip();
if (isDirty) {
- worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
+ worldObj.markBlockForUpdate(xCoord, yCoord,
+ zCoord);
isDirty = false;
}
}
@@ -94,8 +96,8 @@ public class TileEntityHandPedestal extends TileEntity { public Packet getDescriptionPacket() {
NBTTagCompound nbttagcompound = new NBTTagCompound();
writeToNBT(nbttagcompound);
- return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, 0,
- nbttagcompound);
+ return new S35PacketUpdateTileEntity(xCoord, yCoord,
+ zCoord, 0, nbttagcompound);
}
/**
@@ -129,7 +131,8 @@ public class TileEntityHandPedestal extends TileEntity { * @param heldItemStack
*/
public void setHeldItemStack(ItemStack heldItemStack) {
- if (heldItemStack != null && heldItemStack.getItem() != null) {
+ if (heldItemStack != null
+ && heldItemStack.getItem() != null) {
heldItemStack.stackSize = 1;
this.heldItemStack = heldItemStack;
if (heldItemStack.getItem() instanceof ItemBlock)
diff --git a/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityJewelrsCraftingTable.java b/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityJewelrsCraftingTable.java index 1b0ec8a..66d54b0 100755 --- a/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityJewelrsCraftingTable.java +++ b/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityJewelrsCraftingTable.java @@ -14,9 +14,10 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World;
public class TileEntityJewelrsCraftingTable extends TileEntity {
- public boolean hasJewelry, hasEndItem, isDirty, hasGem, crafting;
+ public boolean hasJewelry, hasEndItem, isDirty, hasGem,
+ crafting;
public ItemStack jewelry, endItem, gem;
- public int carving, effect;
+ public int carving, effect;
public float angle;
/**
@@ -88,7 +89,8 @@ public class TileEntityJewelrsCraftingTable extends TileEntity { public void updateEntity() {
super.updateEntity();
if (isDirty) {
- worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
+ worldObj.markBlockForUpdate(xCoord, yCoord,
+ zCoord);
isDirty = false;
}
if (angle < 360F)
@@ -102,46 +104,78 @@ public class TileEntityJewelrsCraftingTable extends TileEntity { for (int l = 0; l < ConfigHandler.GEM_PLACEMENT_TIME
/ (carving + 2); ++l) {
if (worldObj.rand.nextInt(10) == 0)
- worldObj.playSoundEffect(xCoord, yCoord + 0.5F,
- zCoord, "random.orb", 0.05F, 1F);
+ worldObj.playSoundEffect(
+ xCoord,
+ yCoord + 0.5F,
+ zCoord,
+ "random.orb",
+ 0.05F, 1F);
if (getBlockMetadata() == 0)
- worldObj.spawnParticle("instantSpell",
- xCoord + 0.5F, (double) yCoord + 0.8F,
- zCoord + 0.2F, 0.0D, 0.0D, 0.0D);
+ worldObj.spawnParticle(
+ "instantSpell",
+ xCoord + 0.5F,
+ (double) yCoord + 0.8F,
+ zCoord + 0.2F,
+ 0.0D, 0.0D,
+ 0.0D);
if (getBlockMetadata() == 1)
- worldObj.spawnParticle("instantSpell",
- xCoord + 0.8F, (double) yCoord + 0.8F,
- zCoord + 0.5F, 0.0D, 0.0D, 0.0D);
+ worldObj.spawnParticle(
+ "instantSpell",
+ xCoord + 0.8F,
+ (double) yCoord + 0.8F,
+ zCoord + 0.5F,
+ 0.0D, 0.0D,
+ 0.0D);
if (getBlockMetadata() == 2)
- worldObj.spawnParticle("instantSpell",
- xCoord + 0.5F, (double) yCoord + 0.8F,
- zCoord + 0.8F, 0.0D, 0.0D, 0.0D);
+ worldObj.spawnParticle(
+ "instantSpell",
+ xCoord + 0.5F,
+ (double) yCoord + 0.8F,
+ zCoord + 0.8F,
+ 0.0D, 0.0D,
+ 0.0D);
if (getBlockMetadata() == 3)
- worldObj.spawnParticle("instantSpell",
- xCoord + 0.2F, (double) yCoord + 0.8F,
- zCoord + 0.5F, 0.0D, 0.0D, 0.0D);
+ worldObj.spawnParticle(
+ "instantSpell",
+ xCoord + 0.2F,
+ (double) yCoord + 0.8F,
+ zCoord + 0.5F,
+ 0.0D, 0.0D,
+ 0.0D);
}
if (carving == 0) {
hasEndItem = true;
endItem = jewelry.copy();
- if (hasGem
- && gem != new ItemStack(Item.getItemById(0), 0, 0))
- if (!JewelryNBT.hasTag(jewelry, "gem")) {
- JewelryNBT.addGem(endItem, gem);
+ if (hasGem && gem != new ItemStack(
+ Item.getItemById(0), 0, 0))
+ if (!JewelryNBT.hasTag(jewelry,
+ "gem")) {
+ JewelryNBT.addGem(endItem,
+ gem);
hasGem = false;
- gem = new ItemStack(Item.getItemById(0), 0, 0);
+ gem = new ItemStack(Item
+ .getItemById(0),
+ 0, 0);
} else {
- ItemStack aux = JewelryNBT.gem(jewelry);
- JewelryNBT.addGem(endItem, gem);
- if (JewelrycraftUtil.rand.nextBoolean())
+ ItemStack aux = JewelryNBT
+ .gem(jewelry);
+ JewelryNBT.addGem(endItem,
+ gem);
+ if (JewelrycraftUtil.rand
+ .nextBoolean())
gem = aux.copy();
else {
hasGem = false;
- gem = new ItemStack(Item.getItemById(0), 0, 0);
+ gem = new ItemStack(
+ Item.getItemById(
+ 0),
+ 0,
+ 0);
}
}
hasJewelry = false;
- jewelry = new ItemStack(Item.getItemById(0), 0, 0);
+ jewelry = new ItemStack(
+ Item.getItemById(0), 0, 0);
carving = -1;
crafting = false;
isDirty = true;
@@ -203,8 +237,8 @@ public class TileEntityJewelrsCraftingTable extends TileEntity { public void dropItem(World world, double x, double y, double z,
ItemStack stack) {
- EntityItem entityitem =
- new EntityItem(world, x + 0.5D, y + 1D, z + 0.5D, stack);
+ EntityItem entityitem = new EntityItem(world, x + 0.5D,
+ y + 1D, z + 0.5D, stack);
entityitem.motionX = 0;
entityitem.motionZ = 0;
entityitem.motionY = 0.21000000298023224D;
@@ -218,8 +252,8 @@ public class TileEntityJewelrsCraftingTable extends TileEntity { public Packet getDescriptionPacket() {
NBTTagCompound nbttagcompound = new NBTTagCompound();
writeToNBT(nbttagcompound);
- return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, 1,
- nbttagcompound);
+ return new S35PacketUpdateTileEntity(xCoord, yCoord,
+ zCoord, 1, nbttagcompound);
}
/**
diff --git a/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityMidasTouch.java b/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityMidasTouch.java index 5d37f65..eab8bfb 100755 --- a/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityMidasTouch.java +++ b/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityMidasTouch.java @@ -62,8 +62,8 @@ public class TileEntityMidasTouch extends TileEntity { public Packet getDescriptionPacket() { NBTTagCompound nbttagcompound = new NBTTagCompound(); writeToNBT(nbttagcompound); - return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, 1, - nbttagcompound); + return new S35PacketUpdateTileEntity(xCoord, yCoord, + zCoord, 1, nbttagcompound); } /** diff --git a/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityMolder.java b/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityMolder.java index 9fca5fc..c7607a4 100755 --- a/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityMolder.java +++ b/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityMolder.java @@ -11,8 +11,9 @@ import net.minecraft.network.play.server.S35PacketUpdateTileEntity; import net.minecraft.tileentity.TileEntity;
public class TileEntityMolder extends TileEntity {
- public int cooling;
- public boolean hasMoltenMetal, hasJewelBase, hasMold, isDirty;
+ public int cooling;
+ public boolean hasMoltenMetal, hasJewelBase, hasMold,
+ isDirty;
public ItemStack mold, jewelBase, moltenMetal, ringMetal;
public float quantity;
@@ -85,17 +86,23 @@ public class TileEntityMolder extends TileEntity { public void updateEntity() {
super.updateEntity();
if (isDirty) {
- worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
+ worldObj.markBlockForUpdate(xCoord, yCoord,
+ zCoord);
isDirty = false;
}
- if (hasMoltenMetal && moltenMetal.getItem() != Item.getItemById(0)
+ if (hasMoltenMetal
+ && moltenMetal.getItem() != Item
+ .getItemById(0)
&& quantity > 0f) {
if (worldObj.rand.nextInt(20) == 0)
- worldObj.playSoundEffect(xCoord, yCoord + 0.5F, zCoord,
+ worldObj.playSoundEffect(xCoord,
+ yCoord + 0.5F, zCoord,
"random.fizz", 0.5F, 1F);
for (int l = 0; l < 2; ++l)
- worldObj.spawnParticle("reddust", xCoord + Math.random(),
- (double) yCoord + 0.2F, zCoord + Math.random(),
+ worldObj.spawnParticle("reddust",
+ xCoord + Math.random(),
+ (double) yCoord + 0.2F,
+ zCoord + Math.random(),
0.0D, 1.0D, 1.0D);
}
if (hasMoltenMetal && !hasJewelBase && quantity >= 0.1f) {
@@ -106,21 +113,29 @@ public class TileEntityMolder extends TileEntity { if (mold.getItemDamage() == 0)
jewelBase = moltenMetal;
else if (mold.getItemDamage() == 1)
- jewelBase = new ItemStack(ItemList.ring);
+ jewelBase = new ItemStack(
+ ItemList.ring);
else if (mold.getItemDamage() == 2)
- jewelBase = new ItemStack(ItemList.necklace);
+ jewelBase = new ItemStack(
+ ItemList.necklace);
else if (mold.getItemDamage() == 3)
- jewelBase = new ItemStack(ItemList.bracelet);
+ jewelBase = new ItemStack(
+ ItemList.bracelet);
else if (mold.getItemDamage() == 4)
- jewelBase = new ItemStack(ItemList.earrings);
+ jewelBase = new ItemStack(
+ ItemList.earrings);
ringMetal.stackSize = 1;
jewelBase.stackSize = 1;
if (mold.getItemDamage() != 0
- && jewelBase != new ItemStack(Item.getItemById(0),
+ && jewelBase != new ItemStack(
+ Item.getItemById(
+ 0),
0, 0))
- JewelryNBT.addMetal(jewelBase, ringMetal);
+ JewelryNBT.addMetal(jewelBase,
+ ringMetal);
hasMoltenMetal = false;
- moltenMetal = new ItemStack(Item.getItemById(0), 0, 0);
+ moltenMetal = new ItemStack(
+ Item.getItemById(0), 0, 0);
hasJewelBase = true;
cooling = -1;
quantity = 0f;
@@ -136,8 +151,8 @@ public class TileEntityMolder extends TileEntity { public Packet getDescriptionPacket() {
NBTTagCompound nbttagcompound = new NBTTagCompound();
writeToNBT(nbttagcompound);
- return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, 1,
- nbttagcompound);
+ return new S35PacketUpdateTileEntity(xCoord, yCoord,
+ zCoord, 1, nbttagcompound);
}
/**
diff --git a/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityMoltenMetal.java b/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityMoltenMetal.java index 405011a..77e06c7 100755 --- a/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityMoltenMetal.java +++ b/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityMoltenMetal.java @@ -50,8 +50,8 @@ public class TileEntityMoltenMetal extends TileEntity { public void readFromNBT(NBTTagCompound nbt) {
super.readFromNBT(nbt);
if (nbt.hasKey("metal"))
- setMetal(ItemStack
- .loadItemStackFromNBT(nbt.getCompoundTag("metal")));
+ setMetal(ItemStack.loadItemStackFromNBT(
+ nbt.getCompoundTag("metal")));
else
metal = null;
}
@@ -60,8 +60,8 @@ public class TileEntityMoltenMetal extends TileEntity { public Packet getDescriptionPacket() {
NBTTagCompound nbttagcompound = new NBTTagCompound();
writeToNBT(nbttagcompound);
- return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, 0,
- nbttagcompound);
+ return new S35PacketUpdateTileEntity(xCoord, yCoord,
+ zCoord, 0, nbttagcompound);
}
@Override
diff --git a/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityShadowEye.java b/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityShadowEye.java index 234417d..c5b5aef 100755 --- a/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityShadowEye.java +++ b/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityShadowEye.java @@ -27,14 +27,13 @@ import net.minecraft.util.ResourceLocation; import net.minecraft.world.World;
public class TileEntityShadowEye extends TileEntity {
- public int opening, timer, t = 20, soundTimer;
- public boolean active, shouldAddData;
- public ArrayList<ItemStack> pedestalItems =
- new ArrayList<ItemStack>();
- ResourceLocation particleTexture = new ResourceLocation(
+ public int opening, timer, t = 20, soundTimer;
+ public boolean active, shouldAddData;
+ public ArrayList<ItemStack> pedestalItems = new ArrayList<ItemStack>();
+ ResourceLocation particleTexture = new ResourceLocation(
Variables.MODID, "textures/particle/shadows.png");
- public EntityPlayer target;
- public ModelShadowEye model = new ModelShadowEye();
+ public EntityPlayer target;
+ public ModelShadowEye model = new ModelShadowEye();
public TileEntityShadowEye() {
opening = 1;
@@ -63,21 +62,27 @@ public class TileEntityShadowEye extends TileEntity { @Override
public void updateEntity() {
super.updateEntity();
- boolean valid = isValidStructure(worldObj, xCoord, yCoord, zCoord,
- blockMetadata);
+ boolean valid = isValidStructure(worldObj, xCoord, yCoord,
+ zCoord, blockMetadata);
boolean canStartRitual = valid
- && ((TileEntityHandPedestal) worldObj.getTileEntity(xCoord,
- yCoord - 3, zCoord)).heldItemStack != null
- && getNumberOfItems(worldObj, xCoord, yCoord, zCoord) > 0;
+ && ((TileEntityHandPedestal) worldObj
+ .getTileEntity(xCoord,
+ yCoord - 3,
+ zCoord)).heldItemStack != null
+ && getNumberOfItems(worldObj, xCoord,
+ yCoord, zCoord) > 0;
if (active) {
timer--;
- if (canStartRitual
- && canChangePedestals(worldObj, xCoord, yCoord, zCoord)
+ if (canStartRitual && canChangePedestals(worldObj,
+ xCoord, yCoord, zCoord)
&& opening == 4)
- changePedestals(worldObj, xCoord, yCoord, zCoord);
+ changePedestals(worldObj, xCoord, yCoord,
+ zCoord);
}
- if (active && target != null && this.getDistanceFrom(target.posX,
- target.posY, target.posZ) > 27D) {
+ if (active && target != null
+ && this.getDistanceFrom(target.posX,
+ target.posY,
+ target.posZ) > 27D) {
active = false;
timer = -1;
shouldAddData = false;
@@ -93,13 +98,16 @@ public class TileEntityShadowEye extends TileEntity { t = 20;
}
}
- if (opening == 2 && timer <= 0 && t == 10 && shouldAddData) {
+ if (opening == 2 && timer <= 0 && t == 10
+ && shouldAddData) {
addData(worldObj, xCoord, yCoord, zCoord);
- TileEntityHandPedestal target =
- (TileEntityHandPedestal) worldObj.getTileEntity(xCoord,
- yCoord - 3, zCoord);
- if (target != null && target.getHeldItemStack() != null)
- JewelryNBT.addModifiers(target.getHeldItemStack(),
+ TileEntityHandPedestal target = (TileEntityHandPedestal) worldObj
+ .getTileEntity(xCoord, yCoord - 3,
+ zCoord);
+ if (target != null && target
+ .getHeldItemStack() != null)
+ JewelryNBT.addModifiers(
+ target.getHeldItemStack(),
pedestalItems);
revertPedestals(worldObj, xCoord, yCoord, zCoord);
}
@@ -116,30 +124,38 @@ public class TileEntityShadowEye extends TileEntity { active = false;
timer = -1;
if (!worldObj.isRemote) {
- JewelrycraftUtil.addCursePoints(target, 50);
+ JewelrycraftUtil.addCursePoints(
+ target, 50);
target.addChatMessage(
- new ChatComponentText(EnumChatFormatting.BLACK
- + "The Shadows don't like to be disturbed for no reason!"));
- target.addChatMessage(new ChatComponentText(
- EnumChatFormatting.DARK_PURPLE
- + "You feel a strange aura encumbering you."));
+ new ChatComponentText(
+ EnumChatFormatting.BLACK
+ + "The Shadows don't like to be disturbed for no reason!"));
+ target.addChatMessage(
+ new ChatComponentText(
+ EnumChatFormatting.DARK_PURPLE
+ + "You feel a strange aura encumbering you."));
}
}
}
if (active && opening == 4) {
for (int l = 0; l <= 100; l++)
worldObj.spawnParticle("depthsuspend",
- xCoord + 6.5F - worldObj.rand.nextInt(12)
+ xCoord + 6.5F - worldObj.rand
+ .nextInt(12)
- worldObj.rand.nextFloat(),
- yCoord - 2F + worldObj.rand.nextInt(9)
+ yCoord - 2F + worldObj.rand
+ .nextInt(9)
- worldObj.rand.nextFloat(),
- zCoord + 6.5F - worldObj.rand.nextInt(12)
+ zCoord + 6.5F - worldObj.rand
+ .nextInt(12)
- worldObj.rand.nextFloat(),
0, 0, 0);
if (soundTimer == 0)
- worldObj.playSound(xCoord + 0.5D, yCoord + 0.5D,
- zCoord + 0.5D, "jewelrycraft2:Ritual", 1.0F, 1.0F,
- false);
+ worldObj.playSound(xCoord + 0.5D,
+ yCoord + 0.5D,
+ zCoord + 0.5D,
+ "jewelrycraft2:Ritual",
+ 1.0F, 1.0F, false);
if (soundTimer < 20 * 14)
soundTimer++;
else
@@ -153,250 +169,340 @@ public class TileEntityShadowEye extends TileEntity { || world.getBlockMetadata(x, y, z) == 2) {
// Layers from top to bottom
// 1st Layer
- if (world.getBlock(x, y + 1, z) != Blocks.stone_slab
- || world.getBlockMetadata(x, y + 1, z) != 5)
+ if (world.getBlock(x, y + 1,
+ z) != Blocks.stone_slab
+ || world.getBlockMetadata(x, y + 1,
+ z) != 5)
return false;
- if (world.getBlock(x + 1, y + 1, z) != Blocks.stone_slab
- || world.getBlockMetadata(x + 1, y + 1, z) != 5)
+ if (world.getBlock(x + 1, y + 1,
+ z) != Blocks.stone_slab
+ || world.getBlockMetadata(x + 1,
+ y + 1, z) != 5)
return false;
- if (world.getBlock(x - 1, y + 1, z) != Blocks.stone_slab
- || world.getBlockMetadata(x - 1, y + 1, z) != 5)
+ if (world.getBlock(x - 1, y + 1,
+ z) != Blocks.stone_slab
+ || world.getBlockMetadata(x - 1,
+ y + 1, z) != 5)
return false;
// 2nd Layer
- if (world.getBlock(x + 2, y, z) != Blocks.stone_brick_stairs
- || world.getBlockMetadata(x + 2, y, z) != 1)
+ if (world.getBlock(x + 2, y,
+ z) != Blocks.stone_brick_stairs
+ || world.getBlockMetadata(x + 2, y,
+ z) != 1)
return false;
- if (world.getBlock(x + 1, y, z) != Blocks.stone_brick_stairs
- || world.getBlockMetadata(x + 1, y, z) != 4)
+ if (world.getBlock(x + 1, y,
+ z) != Blocks.stone_brick_stairs
+ || world.getBlockMetadata(x + 1, y,
+ z) != 4)
return false;
- if (world.getBlock(x - 1, y, z) != Blocks.stone_brick_stairs
- || world.getBlockMetadata(x - 1, y, z) != 5)
+ if (world.getBlock(x - 1, y,
+ z) != Blocks.stone_brick_stairs
+ || world.getBlockMetadata(x - 1, y,
+ z) != 5)
return false;
- if (world.getBlock(x - 2, y, z) != Blocks.stone_brick_stairs
- || world.getBlockMetadata(x - 2, y, z) != 0)
+ if (world.getBlock(x - 2, y,
+ z) != Blocks.stone_brick_stairs
+ || world.getBlockMetadata(x - 2, y,
+ z) != 0)
return false;
// 3rd Layer
- if (world.getBlock(x + 2, y - 1, z) != Blocks.stonebrick)
+ if (world.getBlock(x + 2, y - 1,
+ z) != Blocks.stonebrick)
return false;
- if (world.getBlock(x - 2, y - 1, z) != Blocks.stonebrick)
+ if (world.getBlock(x - 2, y - 1,
+ z) != Blocks.stonebrick)
return false;
// 4th Layer
- if (world.getBlock(x + 2, y - 2, z) != Blocks.stonebrick)
+ if (world.getBlock(x + 2, y - 2,
+ z) != Blocks.stonebrick)
return false;
- if (world.getBlock(x - 2, y - 2, z) != Blocks.stonebrick)
+ if (world.getBlock(x - 2, y - 2,
+ z) != Blocks.stonebrick)
return false;
// 5th Layer
- if (world.getBlock(x + 2, y - 3, z) != Blocks.stonebrick)
+ if (world.getBlock(x + 2, y - 3,
+ z) != Blocks.stonebrick)
return false;
- if (world.getBlock(x - 2, y - 3, z) != Blocks.stonebrick)
+ if (world.getBlock(x - 2, y - 3,
+ z) != Blocks.stonebrick)
return false;
} else if (world.getBlockMetadata(x, y, z) == 1
|| world.getBlockMetadata(x, y, z) == 3) {
// Layers from top to bottom
// 1st Layer
- if (world.getBlock(x, y + 1, z) != Blocks.stone_slab
- || world.getBlockMetadata(x, y + 1, z) != 5)
+ if (world.getBlock(x, y + 1,
+ z) != Blocks.stone_slab
+ || world.getBlockMetadata(x, y + 1,
+ z) != 5)
return false;
- if (world.getBlock(x, y + 1, z + 1) != Blocks.stone_slab
- || world.getBlockMetadata(x, y + 1, z + 1) != 5)
+ if (world.getBlock(x, y + 1,
+ z + 1) != Blocks.stone_slab
+ || world.getBlockMetadata(x, y + 1,
+ z + 1) != 5)
return false;
- if (world.getBlock(x, y + 1, z - 1) != Blocks.stone_slab
- || world.getBlockMetadata(x, y + 1, z - 1) != 5)
+ if (world.getBlock(x, y + 1,
+ z - 1) != Blocks.stone_slab
+ || world.getBlockMetadata(x, y + 1,
+ z - 1) != 5)
return false;
// 2nd Layer
- if (world.getBlock(x, y, z + 2) != Blocks.stone_brick_stairs
- || world.getBlockMetadata(x, y, z + 2) != 3)
+ if (world.getBlock(x, y,
+ z + 2) != Blocks.stone_brick_stairs
+ || world.getBlockMetadata(x, y,
+ z + 2) != 3)
return false;
- if (world.getBlock(x, y, z + 1) != Blocks.stone_brick_stairs
- || world.getBlockMetadata(x, y, z + 1) != 6)
+ if (world.getBlock(x, y,
+ z + 1) != Blocks.stone_brick_stairs
+ || world.getBlockMetadata(x, y,
+ z + 1) != 6)
return false;
- if (world.getBlock(x, y, z - 1) != Blocks.stone_brick_stairs
- || world.getBlockMetadata(x, y, z - 1) != 7)
+ if (world.getBlock(x, y,
+ z - 1) != Blocks.stone_brick_stairs
+ || world.getBlockMetadata(x, y,
+ z - 1) != 7)
return false;
- if (world.getBlock(x, y, z - 2) != Blocks.stone_brick_stairs
- || world.getBlockMetadata(x, y, z - 2) != 2)
+ if (world.getBlock(x, y,
+ z - 2) != Blocks.stone_brick_stairs
+ || world.getBlockMetadata(x, y,
+ z - 2) != 2)
return false;
// 3rd Layer
- if (world.getBlock(x, y - 1, z + 2) != Blocks.stonebrick)
+ if (world.getBlock(x, y - 1,
+ z + 2) != Blocks.stonebrick)
return false;
- if (world.getBlock(x, y - 1, z - 2) != Blocks.stonebrick)
+ if (world.getBlock(x, y - 1,
+ z - 2) != Blocks.stonebrick)
return false;
// 4th Layer
- if (world.getBlock(x, y - 2, z + 2) != Blocks.stonebrick)
+ if (world.getBlock(x, y - 2,
+ z + 2) != Blocks.stonebrick)
return false;
- if (world.getBlock(x, y - 2, z - 2) != Blocks.stonebrick)
+ if (world.getBlock(x, y - 2,
+ z - 2) != Blocks.stonebrick)
return false;
// 5th Layer
- if (world.getBlock(x, y - 3, z + 2) != Blocks.stonebrick)
+ if (world.getBlock(x, y - 3,
+ z + 2) != Blocks.stonebrick)
return false;
- if (world.getBlock(x, y - 3, z - 2) != Blocks.stonebrick)
+ if (world.getBlock(x, y - 3,
+ z - 2) != Blocks.stonebrick)
return false;
}
// 3rd Layer
- if (world.getBlock(x - 4, y - 1, z - 4) != BlockList.shadowBlock)
+ if (world.getBlock(x - 4, y - 1,
+ z - 4) != BlockList.shadowBlock)
return false;
- if (world.getBlock(x - 4, y - 1, z + 4) != BlockList.shadowBlock)
+ if (world.getBlock(x - 4, y - 1,
+ z + 4) != BlockList.shadowBlock)
return false;
- if (world.getBlock(x + 4, y - 1, z - 4) != BlockList.shadowBlock)
+ if (world.getBlock(x + 4, y - 1,
+ z - 4) != BlockList.shadowBlock)
return false;
- if (world.getBlock(x + 4, y - 1, z + 4) != BlockList.shadowBlock)
+ if (world.getBlock(x + 4, y - 1,
+ z + 4) != BlockList.shadowBlock)
return false;
// 4th Layer
- if (world.getBlock(x - 4, y - 2, z - 4) != Blocks.stonebrick)
+ if (world.getBlock(x - 4, y - 2,
+ z - 4) != Blocks.stonebrick)
return false;
- if (world.getBlock(x - 4, y - 2, z + 4) != Blocks.stonebrick)
+ if (world.getBlock(x - 4, y - 2,
+ z + 4) != Blocks.stonebrick)
return false;
- if (world.getBlock(x + 4, y - 2, z - 4) != Blocks.stonebrick)
+ if (world.getBlock(x + 4, y - 2,
+ z - 4) != Blocks.stonebrick)
return false;
- if (world.getBlock(x + 4, y - 2, z + 4) != Blocks.stonebrick)
+ if (world.getBlock(x + 4, y - 2,
+ z + 4) != Blocks.stonebrick)
return false;
// 5th Layer
// Pillars
- if (world.getBlock(x - 4, y - 3, z - 4) != Blocks.stonebrick)
+ if (world.getBlock(x - 4, y - 3,
+ z - 4) != Blocks.stonebrick)
return false;
- if (world.getBlock(x - 4, y - 3, z + 4) != Blocks.stonebrick)
+ if (world.getBlock(x - 4, y - 3,
+ z + 4) != Blocks.stonebrick)
return false;
- if (world.getBlock(x + 4, y - 3, z - 4) != Blocks.stonebrick)
+ if (world.getBlock(x + 4, y - 3,
+ z - 4) != Blocks.stonebrick)
return false;
- if (world.getBlock(x + 4, y - 3, z + 4) != Blocks.stonebrick)
+ if (world.getBlock(x + 4, y - 3,
+ z + 4) != Blocks.stonebrick)
return false;
// Pedestals
- if (!(world.getBlock(x, y - 3, z) instanceof BlockHandPedestal))
- return false;
- if (world.getBlock(x - 4, y - 3, z + 2) != BlockList.handPedestal
- || world.getBlockMetadata(x - 4, y - 3, z + 2) != 1)
- return false;
- if (world.getBlock(x - 5, y - 3, z) != BlockList.handPedestal
- || world.getBlockMetadata(x - 5, y - 3, z) != 2)
- return false;
- if (world.getBlock(x - 4, y - 3, z - 2) != BlockList.handPedestal
- || world.getBlockMetadata(x - 4, y - 3, z - 2) != 3)
- return false;
- if (world.getBlock(x - 2, y - 3, z - 4) != BlockList.handPedestal
- || world.getBlockMetadata(x - 2, y - 3, z - 4) != 3)
- return false;
- if (world.getBlock(x, y - 3, z - 5) != BlockList.handPedestal
- || world.getBlockMetadata(x, y - 3, z - 5) != 4)
- return false;
- if (world.getBlock(x + 2, y - 3, z - 4) != BlockList.handPedestal
- || world.getBlockMetadata(x + 2, y - 3, z - 4) != 5)
- return false;
- if (world.getBlock(x + 4, y - 3, z - 2) != BlockList.handPedestal
- || world.getBlockMetadata(x + 4, y - 3, z - 2) != 5)
- return false;
- if (world.getBlock(x + 5, y - 3, z) != BlockList.handPedestal
- || world.getBlockMetadata(x + 5, y - 3, z) != 6)
- return false;
- if (world.getBlock(x + 4, y - 3, z + 2) != BlockList.handPedestal
- || world.getBlockMetadata(x + 4, y - 3, z + 2) != 7)
- return false;
- if (world.getBlock(x + 2, y - 3, z + 4) != BlockList.handPedestal
- || world.getBlockMetadata(x + 2, y - 3, z + 4) != 7)
- return false;
- if (world.getBlock(x, y - 3, z + 5) != BlockList.handPedestal
- || world.getBlockMetadata(x, y - 3, z + 5) != 0)
- return false;
- if (world.getBlock(x - 2, y - 3, z + 4) != BlockList.handPedestal
- || world.getBlockMetadata(x - 2, y - 3, z + 4) != 1)
+ if (!(world.getBlock(x, y - 3,
+ z) instanceof BlockHandPedestal))
+ return false;
+ if (world.getBlock(x - 4, y - 3,
+ z + 2) != BlockList.handPedestal
+ || world.getBlockMetadata(x - 4, y - 3,
+ z + 2) != 1)
+ return false;
+ if (world.getBlock(x - 5, y - 3,
+ z) != BlockList.handPedestal
+ || world.getBlockMetadata(x - 5, y - 3,
+ z) != 2)
+ return false;
+ if (world.getBlock(x - 4, y - 3,
+ z - 2) != BlockList.handPedestal
+ || world.getBlockMetadata(x - 4, y - 3,
+ z - 2) != 3)
+ return false;
+ if (world.getBlock(x - 2, y - 3,
+ z - 4) != BlockList.handPedestal
+ || world.getBlockMetadata(x - 2, y - 3,
+ z - 4) != 3)
+ return false;
+ if (world.getBlock(x, y - 3,
+ z - 5) != BlockList.handPedestal
+ || world.getBlockMetadata(x, y - 3,
+ z - 5) != 4)
+ return false;
+ if (world.getBlock(x + 2, y - 3,
+ z - 4) != BlockList.handPedestal
+ || world.getBlockMetadata(x + 2, y - 3,
+ z - 4) != 5)
+ return false;
+ if (world.getBlock(x + 4, y - 3,
+ z - 2) != BlockList.handPedestal
+ || world.getBlockMetadata(x + 4, y - 3,
+ z - 2) != 5)
+ return false;
+ if (world.getBlock(x + 5, y - 3,
+ z) != BlockList.handPedestal
+ || world.getBlockMetadata(x + 5, y - 3,
+ z) != 6)
+ return false;
+ if (world.getBlock(x + 4, y - 3,
+ z + 2) != BlockList.handPedestal
+ || world.getBlockMetadata(x + 4, y - 3,
+ z + 2) != 7)
+ return false;
+ if (world.getBlock(x + 2, y - 3,
+ z + 4) != BlockList.handPedestal
+ || world.getBlockMetadata(x + 2, y - 3,
+ z + 4) != 7)
+ return false;
+ if (world.getBlock(x, y - 3,
+ z + 5) != BlockList.handPedestal
+ || world.getBlockMetadata(x, y - 3,
+ z + 5) != 0)
+ return false;
+ if (world.getBlock(x - 2, y - 3,
+ z + 4) != BlockList.handPedestal
+ || world.getBlockMetadata(x - 2, y - 3,
+ z + 4) != 1)
return false;
return true;
}
public void addData(World world, int x, int y, int z) {
pedestalItems.clear();
- addPedestalInfo((TileEntityHandPedestal) world.getTileEntity(x + 2,
- y - 3, z - 4));
- addPedestalInfo((TileEntityHandPedestal) world.getTileEntity(x - 4,
- y - 3, z + 2));
- addPedestalInfo((TileEntityHandPedestal) world.getTileEntity(x,
- y - 3, z - 5));
- addPedestalInfo((TileEntityHandPedestal) world.getTileEntity(x - 2,
- y - 3, z - 4));
- addPedestalInfo((TileEntityHandPedestal) world.getTileEntity(x - 4,
- y - 3, z - 2));
- addPedestalInfo((TileEntityHandPedestal) world.getTileEntity(x - 5,
- y - 3, z));
- addPedestalInfo((TileEntityHandPedestal) world.getTileEntity(x + 4,
- y - 3, z - 2));
- addPedestalInfo((TileEntityHandPedestal) world.getTileEntity(x + 5,
- y - 3, z));
- addPedestalInfo((TileEntityHandPedestal) world.getTileEntity(x + 4,
- y - 3, z + 2));
- addPedestalInfo((TileEntityHandPedestal) world.getTileEntity(x + 2,
- y - 3, z + 4));
- addPedestalInfo((TileEntityHandPedestal) world.getTileEntity(x,
- y - 3, z + 5));
- addPedestalInfo((TileEntityHandPedestal) world.getTileEntity(x - 2,
- y - 3, z + 4));
+ addPedestalInfo((TileEntityHandPedestal) world
+ .getTileEntity(x + 2, y - 3, z - 4));
+ addPedestalInfo((TileEntityHandPedestal) world
+ .getTileEntity(x - 4, y - 3, z + 2));
+ addPedestalInfo((TileEntityHandPedestal) world
+ .getTileEntity(x, y - 3, z - 5));
+ addPedestalInfo((TileEntityHandPedestal) world
+ .getTileEntity(x - 2, y - 3, z - 4));
+ addPedestalInfo((TileEntityHandPedestal) world
+ .getTileEntity(x - 4, y - 3, z - 2));
+ addPedestalInfo((TileEntityHandPedestal) world
+ .getTileEntity(x - 5, y - 3, z));
+ addPedestalInfo((TileEntityHandPedestal) world
+ .getTileEntity(x + 4, y - 3, z - 2));
+ addPedestalInfo((TileEntityHandPedestal) world
+ .getTileEntity(x + 5, y - 3, z));
+ addPedestalInfo((TileEntityHandPedestal) world
+ .getTileEntity(x + 4, y - 3, z + 2));
+ addPedestalInfo((TileEntityHandPedestal) world
+ .getTileEntity(x + 2, y - 3, z + 4));
+ addPedestalInfo((TileEntityHandPedestal) world
+ .getTileEntity(x, y - 3, z + 5));
+ addPedestalInfo((TileEntityHandPedestal) world
+ .getTileEntity(x - 2, y - 3, z + 4));
}
public int getNumberOfItems(World world, int x, int y, int z) {
int items = 0;
- if (((TileEntityHandPedestal) world.getTileEntity(x + 2, y - 3,
- z - 4)).heldItemStack != null)
+ if (((TileEntityHandPedestal) world.getTileEntity(x + 2,
+ y - 3, z - 4)).heldItemStack != null)
items++;
- if (((TileEntityHandPedestal) world.getTileEntity(x - 4, y - 3,
- z + 2)).heldItemStack != null)
+ if (((TileEntityHandPedestal) world.getTileEntity(x - 4,
+ y - 3, z + 2)).heldItemStack != null)
items++;
if (((TileEntityHandPedestal) world.getTileEntity(x, y - 3,
z - 5)).heldItemStack != null)
items++;
- if (((TileEntityHandPedestal) world.getTileEntity(x - 2, y - 3,
- z - 4)).heldItemStack != null)
+ if (((TileEntityHandPedestal) world.getTileEntity(x - 2,
+ y - 3, z - 4)).heldItemStack != null)
items++;
- if (((TileEntityHandPedestal) world.getTileEntity(x - 4, y - 3,
- z - 2)).heldItemStack != null)
+ if (((TileEntityHandPedestal) world.getTileEntity(x - 4,
+ y - 3, z - 2)).heldItemStack != null)
items++;
- if (((TileEntityHandPedestal) world.getTileEntity(x - 5, y - 3,
- z)).heldItemStack != null)
+ if (((TileEntityHandPedestal) world.getTileEntity(x - 5,
+ y - 3, z)).heldItemStack != null)
items++;
- if (((TileEntityHandPedestal) world.getTileEntity(x + 4, y - 3,
- z - 2)).heldItemStack != null)
+ if (((TileEntityHandPedestal) world.getTileEntity(x + 4,
+ y - 3, z - 2)).heldItemStack != null)
items++;
- if (((TileEntityHandPedestal) world.getTileEntity(x + 5, y - 3,
- z)).heldItemStack != null)
+ if (((TileEntityHandPedestal) world.getTileEntity(x + 5,
+ y - 3, z)).heldItemStack != null)
items++;
- if (((TileEntityHandPedestal) world.getTileEntity(x + 4, y - 3,
- z + 2)).heldItemStack != null)
+ if (((TileEntityHandPedestal) world.getTileEntity(x + 4,
+ y - 3, z + 2)).heldItemStack != null)
items++;
- if (((TileEntityHandPedestal) world.getTileEntity(x + 2, y - 3,
- z + 4)).heldItemStack != null)
+ if (((TileEntityHandPedestal) world.getTileEntity(x + 2,
+ y - 3, z + 4)).heldItemStack != null)
items++;
if (((TileEntityHandPedestal) world.getTileEntity(x, y - 3,
z + 5)).heldItemStack != null)
items++;
- if (((TileEntityHandPedestal) world.getTileEntity(x - 2, y - 3,
- z + 4)).heldItemStack != null)
+ if (((TileEntityHandPedestal) world.getTileEntity(x - 2,
+ y - 3, z + 4)).heldItemStack != null)
items++;
return items;
}
- public boolean canChangePedestals(World world, int x, int y, int z) {
+ public boolean canChangePedestals(World world, int x, int y,
+ int z) {
if (world.getBlock(x, y - 3, z) != BlockList.handPedestal)
return false;
- if (world.getBlock(x + 2, y - 3, z - 4) != BlockList.handPedestal)
+ if (world.getBlock(x + 2, y - 3,
+ z - 4) != BlockList.handPedestal)
return false;
- if (world.getBlock(x - 4, y - 3, z + 2) != BlockList.handPedestal)
+ if (world.getBlock(x - 4, y - 3,
+ z + 2) != BlockList.handPedestal)
return false;
- if (world.getBlock(x, y - 3, z - 5) != BlockList.handPedestal)
+ if (world.getBlock(x, y - 3,
+ z - 5) != BlockList.handPedestal)
return false;
- if (world.getBlock(x - 2, y - 3, z - 4) != BlockList.handPedestal)
+ if (world.getBlock(x - 2, y - 3,
+ z - 4) != BlockList.handPedestal)
return false;
- if (world.getBlock(x - 4, y - 3, z - 2) != BlockList.handPedestal)
+ if (world.getBlock(x - 4, y - 3,
+ z - 2) != BlockList.handPedestal)
return false;
- if (world.getBlock(x - 5, y - 3, z) != BlockList.handPedestal)
+ if (world.getBlock(x - 5, y - 3,
+ z) != BlockList.handPedestal)
return false;
- if (world.getBlock(x + 4, y - 3, z - 2) != BlockList.handPedestal)
+ if (world.getBlock(x + 4, y - 3,
+ z - 2) != BlockList.handPedestal)
return false;
- if (world.getBlock(x + 5, y - 3, z) != BlockList.handPedestal)
+ if (world.getBlock(x + 5, y - 3,
+ z) != BlockList.handPedestal)
return false;
- if (world.getBlock(x + 4, y - 3, z + 2) != BlockList.handPedestal)
+ if (world.getBlock(x + 4, y - 3,
+ z + 2) != BlockList.handPedestal)
return false;
- if (world.getBlock(x + 2, y - 3, z + 4) != BlockList.handPedestal)
+ if (world.getBlock(x + 2, y - 3,
+ z + 4) != BlockList.handPedestal)
return false;
- if (world.getBlock(x, y - 3, z + 5) != BlockList.handPedestal)
+ if (world.getBlock(x, y - 3,
+ z + 5) != BlockList.handPedestal)
return false;
- if (world.getBlock(x - 2, y - 3, z + 4) != BlockList.handPedestal)
+ if (world.getBlock(x - 2, y - 3,
+ z + 4) != BlockList.handPedestal)
return false;
return true;
}
@@ -419,20 +525,25 @@ public class TileEntityShadowEye extends TileEntity { public void changeHand(World world, int x, int y, int z) {
int l = world.getBlockMetadata(x, y, z);
- world.playAuxSFX(2001, x, y, z,
- Block.getIdFromBlock(world.getBlock(x, y, z)));
+ world.playAuxSFX(2001, x, y, z, Block
+ .getIdFromBlock(world.getBlock(x, y, z)));
TileEntityShadowHand tile = new TileEntityShadowHand();
if (world.getTileEntity(x, y,
z) instanceof TileEntityHandPedestal) {
- if (((TileEntityHandPedestal) world.getTileEntity(x, y,
- z)).heldItemStack != null)
- tile.setHeldItemStack(((TileEntityHandPedestal) world
- .getTileEntity(x, y, z)).heldItemStack.copy());
+ if (((TileEntityHandPedestal) world.getTileEntity(
+ x, y, z)).heldItemStack != null)
+ tile.setHeldItemStack(
+ ((TileEntityHandPedestal) world
+ .getTileEntity(x,
+ y,
+ z)).heldItemStack
+ .copy());
if (tile.heldItemStack != null)
tile.closeHand();
- ((TileEntityHandPedestal) world.getTileEntity(x, y, z))
- .removeHeldItemStack();
- world.setBlock(x, y, z, BlockList.shadowHand, l, 2);
+ ((TileEntityHandPedestal) world.getTileEntity(x, y,
+ z)).removeHeldItemStack();
+ world.setBlock(x, y, z, BlockList.shadowHand, l,
+ 2);
world.setTileEntity(x, y, z, tile);
}
}
@@ -455,51 +566,66 @@ public class TileEntityShadowEye extends TileEntity { public void revertHand(World world, int x, int y, int z) {
int l = world.getBlockMetadata(x, y, z);
- world.playAuxSFX(2001, x, y, z,
- Block.getIdFromBlock(BlockList.handPedestal));
+ world.playAuxSFX(2001, x, y, z, Block
+ .getIdFromBlock(BlockList.handPedestal));
world.playSoundEffect(x, y + 0.5F, z, "step.wood", 1F, 1F);
TileEntityHandPedestal tile = new TileEntityHandPedestal();
- if (world.getTileEntity(x, y, z) instanceof TileEntityShadowHand) {
- if (((TileEntityShadowHand) world.getTileEntity(x, y,
- z)).heldItemStack != null)
- tile.setHeldItemStack(((TileEntityShadowHand) world
- .getTileEntity(x, y, z)).heldItemStack.copy());
- ((TileEntityShadowHand) world.getTileEntity(x, y, z))
- .removeHeldItemStack();
- world.setBlock(x, y, z, BlockList.handPedestal, l, 2);
+ if (world.getTileEntity(x, y,
+ z) instanceof TileEntityShadowHand) {
+ if (((TileEntityShadowHand) world.getTileEntity(x,
+ y, z)).heldItemStack != null)
+ tile.setHeldItemStack(
+ ((TileEntityShadowHand) world
+ .getTileEntity(x,
+ y,
+ z)).heldItemStack
+ .copy());
+ ((TileEntityShadowHand) world.getTileEntity(x, y,
+ z)).removeHeldItemStack();
+ world.setBlock(x, y, z, BlockList.handPedestal, l,
+ 2);
world.setTileEntity(x, y, z, tile);
}
}
public void addPedestalInfo(TileEntityHandPedestal pedestal) {
ItemStack heldItemStack;
- if (pedestal != null
- && (heldItemStack = pedestal.getHeldItemStack()) != null) {
+ if (pedestal != null && (heldItemStack = pedestal
+ .getHeldItemStack()) != null) {
if (pedestalItems.isEmpty())
pedestalItems.add(heldItemStack.copy());
else {
boolean hasItem = false;
int index = 0;
- for (int ind = 0; ind < pedestalItems.size() && !hasItem;
- ind++)
- if (heldItemStack.getItem()
- .equals(pedestalItems.get(ind).getItem())
- && heldItemStack
- .getItemDamage() == pedestalItems
- .get(ind).getItemDamage()) {
+ for (int ind = 0; ind < pedestalItems
+ .size() && !hasItem; ind++)
+ if (heldItemStack.getItem().equals(
+ pedestalItems.get(
+ ind)
+ .getItem())
+ && heldItemStack.getItemDamage() == pedestalItems
+ .get(ind)
+ .getItemDamage()) {
index = ind;
hasItem = true;
- if (heldItemStack.hasTagCompound()
- && pedestalItems.get(ind).hasTagCompound()
- && !heldItemStack.getTagCompound()
- .equals(pedestalItems.get(ind)
+ if (heldItemStack
+ .hasTagCompound()
+ && pedestalItems.get(
+ ind)
+ .hasTagCompound()
+ && !heldItemStack
+ .getTagCompound()
+ .equals(pedestalItems
+ .get(ind)
.getTagCompound()))
hasItem = false;
}
if (!hasItem)
- pedestalItems.add(heldItemStack.copy());
+ pedestalItems.add(heldItemStack
+ .copy());
else {
- ItemStack object = pedestalItems.get(index).copy();
+ ItemStack object = pedestalItems
+ .get(index).copy();
object.stackSize++;
pedestalItems.set(index, object);
}
@@ -513,9 +639,10 @@ public class TileEntityShadowEye extends TileEntity { @Override
@SideOnly(Side.CLIENT)
public AxisAlignedBB getRenderBoundingBox() {
- AxisAlignedBB bb = AxisAlignedBB.getBoundingBox(xCoord - 5.5D,
- yCoord - 5.5D, zCoord - 5.5D, xCoord + 5.5D, yCoord + 5.5D,
- zCoord + 5.5D);
+ AxisAlignedBB bb = AxisAlignedBB.getBoundingBox(
+ xCoord - 5.5D, yCoord - 5.5D,
+ zCoord - 5.5D, xCoord + 5.5D,
+ yCoord + 5.5D, zCoord + 5.5D);
return bb;
}
@@ -523,8 +650,8 @@ public class TileEntityShadowEye extends TileEntity { public Packet getDescriptionPacket() {
NBTTagCompound nbttagcompound = new NBTTagCompound();
writeToNBT(nbttagcompound);
- return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, 1,
- nbttagcompound);
+ return new S35PacketUpdateTileEntity(xCoord, yCoord,
+ zCoord, 1, nbttagcompound);
}
@Override
diff --git a/src/main/java/darkknight/jewelrycraft/tileentity/TileEntitySmelter.java b/src/main/java/darkknight/jewelrycraft/tileentity/TileEntitySmelter.java index 2f170f9..dd73951 100755 --- a/src/main/java/darkknight/jewelrycraft/tileentity/TileEntitySmelter.java +++ b/src/main/java/darkknight/jewelrycraft/tileentity/TileEntitySmelter.java @@ -14,7 +14,7 @@ import net.minecraft.network.play.server.S35PacketUpdateTileEntity; import net.minecraft.tileentity.TileEntity;
public class TileEntitySmelter extends TileEntity {
- public int melting, flow, n = 0, p = 0;
+ public int melting, flow, n = 0, p = 0;
public boolean hasMetal, hasMoltenMetal, isDirty, pouring;
public ItemStack metal, moltenMetal;
public float quantity, pouredQuantity = 0.1f;
@@ -78,7 +78,8 @@ public class TileEntitySmelter extends TileEntity { super.updateEntity();
Random rand = new Random();
if (isDirty) {
- worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
+ worldObj.markBlockForUpdate(xCoord, yCoord,
+ zCoord);
isDirty = false;
}
if (p > 0)
@@ -97,8 +98,10 @@ public class TileEntitySmelter extends TileEntity { }
if (hasMetal)
for (int l = 0; l < 2; ++l)
- worldObj.spawnParticle("flame", xCoord + rand.nextFloat(),
- (double) yCoord + 0.3F, zCoord + rand.nextFloat(),
+ worldObj.spawnParticle("flame",
+ xCoord + rand.nextFloat(),
+ (double) yCoord + 0.3F,
+ zCoord + rand.nextFloat(),
0.0D, 0.0D, 0.0D);
if (rand.nextInt(65) == 0) {
double d5 = xCoord + rand.nextFloat();
@@ -106,7 +109,8 @@ public class TileEntitySmelter extends TileEntity { double d6 = zCoord + rand.nextFloat();
worldObj.playSound(d5, d7, d6, "liquid.lavapop",
0.2F + rand.nextFloat() * 0.2F,
- 0.9F + rand.nextFloat() * 0.15F, false);
+ 0.9F + rand.nextFloat() * 0.15F,
+ false);
}
if (hasMetal && !hasMoltenMetal) {
boolean isOre = JewelrycraftUtil.isOre(metal);
@@ -115,12 +119,16 @@ public class TileEntitySmelter extends TileEntity { if (melting == 0) {
hasMetal = false;
if (!isOre) {
- if (JewelryNBT.ingot(metal) == null)
+ if (JewelryNBT.ingot(
+ metal) == null)
moltenMetal = metal;
else
- moltenMetal = JewelryNBT.ingot(metal);
+ moltenMetal = JewelryNBT
+ .ingot(metal);
} else {
- moltenMetal = JewelrycraftUtil.getIngotFromOre(metal);
+ moltenMetal = JewelrycraftUtil
+ .getIngotFromOre(
+ metal);
moltenMetal.stackSize *= 2;
}
hasMoltenMetal = true;
@@ -128,7 +136,8 @@ public class TileEntitySmelter extends TileEntity { quantity = 0.1f * metal.stackSize;
else
quantity = 0.2f * metal.stackSize;
- metal = new ItemStack(Item.getItemById(0), 0, 0);
+ metal = new ItemStack(Item.getItemById(0),
+ 0, 0);
melting = -1;
isDirty = true;
}
@@ -141,12 +150,14 @@ public class TileEntitySmelter extends TileEntity { if (!isOre)
moltenMetal.stackSize += metal.stackSize;
else
- moltenMetal.stackSize += metal.stackSize * 2;
+ moltenMetal.stackSize += metal.stackSize
+ * 2;
if (!isOre)
quantity += 0.1f * metal.stackSize;
else
quantity += 0.2f * metal.stackSize;
- metal = new ItemStack(Item.getItemById(0), 0, 0);
+ metal = new ItemStack(Item.getItemById(0),
+ 0, 0);
melting = -1;
isDirty = true;
}
@@ -157,29 +168,34 @@ public class TileEntitySmelter extends TileEntity { zCoord - 1) != null
&& worldObj.getTileEntity(xCoord, yCoord,
zCoord - 1) instanceof TileEntityMolder)
- me = (TileEntityMolder) worldObj.getTileEntity(xCoord, yCoord,
- zCoord - 1);
- else if (worldObj.getBlockMetadata(xCoord, yCoord, zCoord) == 1
- && worldObj.getTileEntity(xCoord + 1, yCoord,
- zCoord) != null
- && worldObj.getTileEntity(xCoord + 1, yCoord,
+ me = (TileEntityMolder) worldObj.getTileEntity(
+ xCoord, yCoord, zCoord - 1);
+ else if (worldObj.getBlockMetadata(xCoord, yCoord,
+ zCoord) == 1
+ && worldObj.getTileEntity(xCoord + 1,
+ yCoord, zCoord) != null
+ && worldObj.getTileEntity(xCoord + 1,
+ yCoord,
zCoord) instanceof TileEntityMolder)
- me = (TileEntityMolder) worldObj.getTileEntity(xCoord + 1,
- yCoord, zCoord);
- else if (worldObj.getBlockMetadata(xCoord, yCoord, zCoord) == 2
+ me = (TileEntityMolder) worldObj.getTileEntity(
+ xCoord + 1, yCoord, zCoord);
+ else if (worldObj.getBlockMetadata(xCoord, yCoord,
+ zCoord) == 2
&& worldObj.getTileEntity(xCoord, yCoord,
zCoord + 1) != null
&& worldObj.getTileEntity(xCoord, yCoord,
zCoord + 1) instanceof TileEntityMolder)
- me = (TileEntityMolder) worldObj.getTileEntity(xCoord, yCoord,
- zCoord + 1);
- else if (worldObj.getBlockMetadata(xCoord, yCoord, zCoord) == 3
- && worldObj.getTileEntity(xCoord - 1, yCoord,
- zCoord) != null
- && worldObj.getTileEntity(xCoord - 1, yCoord,
+ me = (TileEntityMolder) worldObj.getTileEntity(
+ xCoord, yCoord, zCoord + 1);
+ else if (worldObj.getBlockMetadata(xCoord, yCoord,
+ zCoord) == 3
+ && worldObj.getTileEntity(xCoord - 1,
+ yCoord, zCoord) != null
+ && worldObj.getTileEntity(xCoord - 1,
+ yCoord,
zCoord) instanceof TileEntityMolder)
- me = (TileEntityMolder) worldObj.getTileEntity(xCoord - 1,
- yCoord, zCoord);
+ me = (TileEntityMolder) worldObj.getTileEntity(
+ xCoord - 1, yCoord, zCoord);
if (pouring && pouredQuantity > 0f) {
quantity -= 0.01f;
pouredQuantity -= 0.01f;
@@ -196,7 +212,8 @@ public class TileEntitySmelter extends TileEntity { if (quantity <= 0f) {
quantity = 0f;
hasMoltenMetal = false;
- moltenMetal = new ItemStack(Item.getItemById(0), 0, 0);
+ moltenMetal = new ItemStack(
+ Item.getItemById(0), 0, 0);
me.cooling = ConfigHandler.INGOT_COOLING_TIME;
}
me.isDirty = true;
@@ -210,8 +227,8 @@ public class TileEntitySmelter extends TileEntity { public Packet getDescriptionPacket() {
NBTTagCompound nbttagcompound = new NBTTagCompound();
writeToNBT(nbttagcompound);
- return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, 1,
- nbttagcompound);
+ return new S35PacketUpdateTileEntity(xCoord, yCoord,
+ zCoord, 1, nbttagcompound);
}
/**
diff --git a/src/main/java/darkknight/jewelrycraft/tileentity/renders/TileEntityDisplayerRender.java b/src/main/java/darkknight/jewelrycraft/tileentity/renders/TileEntityDisplayerRender.java index f20c853..aaf4613 100755 --- a/src/main/java/darkknight/jewelrycraft/tileentity/renders/TileEntityDisplayerRender.java +++ b/src/main/java/darkknight/jewelrycraft/tileentity/renders/TileEntityDisplayerRender.java @@ -49,12 +49,9 @@ public class TileEntityDisplayerRender extends TileEntitySpecialRenderer { }
}
- ModelDisplayer displayer =
- new ModelDisplayer();
- String texture =
- "textures/tileentities/Displayer.png";
- HashMap<EnumChatFormatting, Integer> colors =
- new ChatColorMap();
+ ModelDisplayer displayer = new ModelDisplayer();
+ String texture = "textures/tileentities/Displayer.png";
+ HashMap<EnumChatFormatting, Integer> colors = new ChatColorMap();
@Override
public void renderTileEntityAt(TileEntity te, double x, double y,
@@ -63,34 +60,48 @@ public class TileEntityDisplayerRender extends TileEntitySpecialRenderer { GL11.glTranslatef((float) x + 0.5F, (float) y + 1.5F,
(float) z + 0.5F);
TileEntityDisplayer disp = (TileEntityDisplayer) te;
- ResourceLocation blockTexture =
- new ResourceLocation(Variables.MODID, texture);
- Minecraft.getMinecraft().renderEngine.bindTexture(blockTexture);
+ ResourceLocation blockTexture = new ResourceLocation(
+ Variables.MODID, texture);
+ Minecraft.getMinecraft().renderEngine
+ .bindTexture(blockTexture);
GL11.glPushMatrix();
GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
displayer.render((Entity) null, disp.ringTranslation1,
- disp.ringTranslation2, disp.ringTranslation3, 0.0F, 0.0F,
+ disp.ringTranslation2,
+ disp.ringTranslation3, 0.0F, 0.0F,
0.0625F);
try {
int block = disp.getBlockMetadata();
- if (disp != null && disp.hasObject && disp.object != null
+ if (disp != null && disp.hasObject
+ && disp.object != null
&& disp.object.getItem() != null
- && disp.object != new ItemStack(Item.getItemById(0), 0,
- 0)) {
+ && disp.object != new ItemStack(
+ Item.getItemById(
+ 0),
+ 0, 0)) {
int ind = -3;
GL11.glPushMatrix();
- EntityItem entityitem = new EntityItem(te.getWorldObj(),
- 0.0D, 0.0D, 0.0D, disp.object);
+ EntityItem entityitem = new EntityItem(
+ te.getWorldObj(), 0.0D,
+ 0.0D, 0.0D, disp.object);
entityitem.hoverStart = 0.0F;
disp.object.stackSize = 1;
GL11.glRotatef(180F, 1F, 0F, 0F);
- GL11.glTranslatef(0.0F, -0.6F + disp.ringTranslation1 / 5,
+ GL11.glTranslatef(0.0F, -0.6F
+ + disp.ringTranslation1
+ / 5,
0F);
GL11.glRotatef(disp.rotAngle, 0F, 1F, 0F);
GL11.glColor4f(1F, 1F, 1F, 1F);
if (RenderManager.instance.options.fancyGraphics)
- RenderManager.instance.renderEntityWithPosYaw(
- entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F);
+ RenderManager.instance
+ .renderEntityWithPosYaw(
+ entityitem,
+ 0.0D,
+ 0.0D,
+ 0.0D,
+ 0.0F,
+ 0.0F);
else {
GL11.glRotatef(180F, 0F, 1F, 0F);
RenderManager.instance.options.fancyGraphics = true;
@@ -98,57 +109,95 @@ public class TileEntityDisplayerRender extends TileEntitySpecialRenderer { int j = i % 65536;
int k = i / 65536;
OpenGlHelper.setLightmapTextureCoords(
- OpenGlHelper.lightmapTexUnit, j / 1.0F,
+ OpenGlHelper.lightmapTexUnit,
+ j / 1.0F,
k / 1.0F);
- RenderManager.instance.renderEntityWithPosYaw(
- entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F);
+ RenderManager.instance
+ .renderEntityWithPosYaw(
+ entityitem,
+ 0.0D,
+ 0.0D,
+ 0.0D,
+ 0.0F,
+ 0.0F);
RenderManager.instance.options.fancyGraphics = false;
}
- EntityPlayer player = te.getWorldObj().getClosestPlayer(
- te.xCoord, te.yCoord, te.zCoord, 5D);
+ EntityPlayer player = te.getWorldObj()
+ .getClosestPlayer(
+ te.xCoord,
+ te.yCoord,
+ te.zCoord,
+ 5D);
GL11.glPopMatrix();
GL11.glPushMatrix();
if (player != null)
- renderLabel(disp.object.getDisplayName(), 0F,
- -0.171F * ind, 0F, block, disp, colors.get(
- disp.object.getRarity().rarityColor));
+ renderLabel(disp.object
+ .getDisplayName(),
+ 0F, -0.171F * ind,
+ 0F, block, disp,
+ colors.get(disp.object
+ .getRarity().rarityColor));
GL11.glPopMatrix();
ind++;
if (player != null && disp.quantity > 1) {
GL11.glPushMatrix();
- renderLabel("x" + Integer.toString(disp.quantity), 0F,
- -0.171F * ind, 0F, block, disp,
+ renderLabel("x" + Integer.toString(
+ disp.quantity), 0F,
+ -0.171F * ind, 0F,
+ block, disp,
Color.GRAY.getRGB());
GL11.glPopMatrix();
ind++;
}
- if (disp.object.getItem() != Items.map && player != null
- && disp.object.getTooltip(player, true) != null) {
- List<?> tooltips =
- disp.object.getTooltip(player, true);
- if (disp.infoIndex + 5 > tooltips.size())
+ if (disp.object.getItem() != Items.map
+ && player != null
+ && disp.object.getTooltip(
+ player,
+ true) != null) {
+ List<?> tooltips = disp.object
+ .getTooltip(player,
+ true);
+ if (disp.infoIndex + 5 > tooltips
+ .size())
disp.infoIndex = 1;
if (tooltips.size() < 5)
- for (int i = 1; i < tooltips.size(); i++) {
- String tooltip = tooltips.get(i).toString();
- RenderManager.instance.getFontRenderer();
+ for (int i = 1; i < tooltips
+ .size(); i++) {
+ String tooltip = tooltips
+ .get(i)
+ .toString();
+ RenderManager.instance
+ .getFontRenderer();
if (tooltip != "") {
GL11.glPushMatrix();
- renderLabel(tooltip, 0F, -0.171F * ind, 0F,
- block, disp, Color.GRAY.getRGB());
+ renderLabel(tooltip,
+ 0F,
+ -0.171F * ind,
+ 0F,
+ block,
+ disp,
+ Color.GRAY.getRGB());
GL11.glPopMatrix();
ind++;
}
}
else
- for (int i = disp.infoIndex;
- i < disp.infoIndex + 5; i++) {
- String tooltip = tooltips.get(i).toString();
- RenderManager.instance.getFontRenderer();
+ for (int i = disp.infoIndex; i < disp.infoIndex
+ + 5; i++) {
+ String tooltip = tooltips
+ .get(i)
+ .toString();
+ RenderManager.instance
+ .getFontRenderer();
if (tooltip != "") {
GL11.glPushMatrix();
- renderLabel(tooltip, 0F, -0.171F * ind, 0F,
- block, disp, Color.GRAY.getRGB());
+ renderLabel(tooltip,
+ 0F,
+ -0.171F * ind,
+ 0F,
+ block,
+ disp,
+ Color.GRAY.getRGB());
GL11.glPopMatrix();
ind++;
}
@@ -161,10 +210,10 @@ public class TileEntityDisplayerRender extends TileEntitySpecialRenderer { GL11.glPopMatrix();
}
- protected void renderLabel(String text, double x, double y, double z,
- int metadata, TileEntity te, int color) {
- FontRenderer fontrenderer =
- RenderManager.instance.getFontRenderer();
+ protected void renderLabel(String text, double x, double y,
+ double z, int metadata, TileEntity te, int color) {
+ FontRenderer fontrenderer = RenderManager.instance
+ .getFontRenderer();
float width = 0.015F, height = 1F;
GL11.glRotatef(180F, 0F, 0F, 1F);
GL11.glRotatef(360 - metadata * 90F, 0F, 1F, 0F);
@@ -184,21 +233,31 @@ public class TileEntityDisplayerRender extends TileEntitySpecialRenderer { tessellator.draw();
if (fontrenderer.getStringWidth(text) / 2 > 20) {
width = 0.9F / fontrenderer.getStringWidth(text);
- height = 1F - fontrenderer.getStringWidth(text) / 20 * 0.06F;
+ height = 1F - fontrenderer.getStringWidth(text)
+ / 20 * 0.06F;
}
- GL11.glTranslatef((float) x + 1f, (float) y + 1f, (float) z);
+ GL11.glTranslatef((float) x + 1f, (float) y + 1f,
+ (float) z);
GL11.glPushMatrix();
GL11.glEnable(GL11.GL_TEXTURE_2D);
GL11.glScalef(width * 70F, height, 0F);
fontrenderer.drawString(
- text.replaceFirst("�0", "�r").replaceFirst("�1", "�r")
- .replaceFirst("�2", "�r").replaceFirst("�3", "�r")
- .replaceFirst("�4", "�r").replaceFirst("�5", "�r")
- .replaceFirst("�6", "�r").replaceFirst("�7", "�r")
- .replaceFirst("�8", "�r").replaceFirst("�9", "�r")
- .replaceFirst("�a", "�r").replaceFirst("�b", "�r")
- .replaceFirst("�c", "�r").replaceFirst("�d", "�r")
- .replaceFirst("�e", "�r").replaceFirst("�f", "�r"),
+ text.replaceFirst("�0", "�r")
+ .replaceFirst("�1", "�r")
+ .replaceFirst("�2", "�r")
+ .replaceFirst("�3", "�r")
+ .replaceFirst("�4", "�r")
+ .replaceFirst("�5", "�r")
+ .replaceFirst("�6", "�r")
+ .replaceFirst("�7", "�r")
+ .replaceFirst("�8", "�r")
+ .replaceFirst("�9", "�r")
+ .replaceFirst("�a", "�r")
+ .replaceFirst("�b", "�r")
+ .replaceFirst("�c", "�r")
+ .replaceFirst("�d", "�r")
+ .replaceFirst("�e", "�r")
+ .replaceFirst("�f", "�r"),
-j, 0, 1973790);
GL11.glPopMatrix();
GL11.glTranslatef((float) x - 0.5f, (float) y - 0.5f,
diff --git a/src/main/java/darkknight/jewelrycraft/tileentity/renders/TileEntityHandPedestalRender.java b/src/main/java/darkknight/jewelrycraft/tileentity/renders/TileEntityHandPedestalRender.java index 4dcdb1e..da8fa58 100755 --- a/src/main/java/darkknight/jewelrycraft/tileentity/renders/TileEntityHandPedestalRender.java +++ b/src/main/java/darkknight/jewelrycraft/tileentity/renders/TileEntityHandPedestalRender.java @@ -42,9 +42,9 @@ public class TileEntityHandPedestalRender TileEntityHandPedestal pedestal = (TileEntityHandPedestal) te;
bindTexture(texture);
GL11.glRotatef(180, 0, 0, 1);
- GL11.glRotatef(
- pedestal.getWorldObj() == null ? 180
- : pedestal.getBlockMetadata() % 8 / 8F * 360,
+ GL11.glRotatef(pedestal.getWorldObj() == null ? 180
+ : pedestal.getBlockMetadata() % 8 / 8F
+ * 360,
0, 1, 0);
model.render(pedestal, partialRenderTicks, 0.0625F);
GL11.glPopMatrix();
diff --git a/src/main/java/darkknight/jewelrycraft/tileentity/renders/TileEntityJewelrsCraftingTableRender.java b/src/main/java/darkknight/jewelrycraft/tileentity/renders/TileEntityJewelrsCraftingTableRender.java index a62d21d..fbe3db6 100755 --- a/src/main/java/darkknight/jewelrycraft/tileentity/renders/TileEntityJewelrsCraftingTableRender.java +++ b/src/main/java/darkknight/jewelrycraft/tileentity/renders/TileEntityJewelrsCraftingTableRender.java @@ -19,10 +19,8 @@ import net.minecraft.world.World; public class TileEntityJewelrsCraftingTableRender
extends TileEntitySpecialRenderer {
- ModelJewlersCraftingBench modelTable =
- new ModelJewlersCraftingBench();
- String texture =
- "textures/tileentities/JewelrsCraftingBench.png";
+ ModelJewlersCraftingBench modelTable = new ModelJewlersCraftingBench();
+ String texture = "textures/tileentities/JewelrsCraftingBench.png";
/**
* @param te
@@ -37,11 +35,11 @@ public class TileEntityJewelrsCraftingTableRender GL11.glPushMatrix();
GL11.glTranslatef((float) x + 0.5F, (float) y + 1.5F,
(float) z + 0.5F);
- ResourceLocation blockTexture =
- new ResourceLocation(Variables.MODID, texture);
- Minecraft.getMinecraft().renderEngine.bindTexture(blockTexture);
- TileEntityJewelrsCraftingTable jt =
- (TileEntityJewelrsCraftingTable) te;
+ ResourceLocation blockTexture = new ResourceLocation(
+ Variables.MODID, texture);
+ Minecraft.getMinecraft().renderEngine
+ .bindTexture(blockTexture);
+ TileEntityJewelrsCraftingTable jt = (TileEntityJewelrsCraftingTable) te;
GL11.glPushMatrix();
GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
try {
@@ -57,15 +55,18 @@ public class TileEntityJewelrsCraftingTableRender }
} catch (Exception e) {
}
- modelTable.render((Entity) null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F,
- 0.0625F);
+ modelTable.render((Entity) null, 0.0F, 0.0F, -0.1F, 0.0F,
+ 0.0F, 0.0625F);
if (jt != null) {
- if (jt.hasJewelry && jt.jewelry.getIconIndex() != null
- && jt.jewelry.getIconIndex().getIconName() != "") {
+ if (jt.hasJewelry && jt.jewelry
+ .getIconIndex() != null
+ && jt.jewelry.getIconIndex()
+ .getIconName() != "") {
GL11.glPushMatrix();
GL11.glDisable(GL11.GL_LIGHTING);
- EntityItem entityitem = new EntityItem(te.getWorldObj(),
- 0.0D, 0.0D, 0.0D, jt.jewelry);
+ EntityItem entityitem = new EntityItem(
+ te.getWorldObj(), 0.0D,
+ 0.0D, 0.0D, jt.jewelry);
entityitem.getEntityItem().stackSize = 1;
entityitem.hoverStart = 0.0F;
GL11.glRotatef(180F, 1F, 0F, 0F);
@@ -73,24 +74,37 @@ public class TileEntityJewelrsCraftingTableRender GL11.glTranslatef(0.55F, -1.5F, -0.45F);
GL11.glRotatef(jt.angle, 0F, 1F, 0F);
if (RenderManager.instance.options.fancyGraphics)
- RenderManager.instance.renderEntityWithPosYaw(
- entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F);
+ RenderManager.instance
+ .renderEntityWithPosYaw(
+ entityitem,
+ 0.0D,
+ 0.0D,
+ 0.0D,
+ 0.0F,
+ 0.0F);
else {
GL11.glRotatef(180F, 0F, 1F, 0F);
RenderManager.instance.options.fancyGraphics = true;
- RenderManager.instance.renderEntityWithPosYaw(
- entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F);
+ RenderManager.instance
+ .renderEntityWithPosYaw(
+ entityitem,
+ 0.0D,
+ 0.0D,
+ 0.0D,
+ 0.0F,
+ 0.0F);
RenderManager.instance.options.fancyGraphics = false;
}
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glPopMatrix();
}
- if (jt.hasEndItem
- && jt.endItem.getIconIndex().getIconName() != "") {
+ if (jt.hasEndItem && jt.endItem.getIconIndex()
+ .getIconName() != "") {
GL11.glPushMatrix();
GL11.glDisable(GL11.GL_LIGHTING);
- EntityItem entityitem = new EntityItem(te.getWorldObj(),
- 0.0D, 0.0D, 0.0D, jt.endItem);
+ EntityItem entityitem = new EntityItem(
+ te.getWorldObj(), 0.0D,
+ 0.0D, 0.0D, jt.endItem);
entityitem.getEntityItem().stackSize = 1;
entityitem.hoverStart = 0.0F;
GL11.glRotatef(180F, 1F, 0F, 0F);
@@ -98,23 +112,37 @@ public class TileEntityJewelrsCraftingTableRender GL11.glTranslatef(0.0F, -1.6F, 0.6F);
GL11.glRotatef(jt.angle, 0F, 1F, 0F);
if (RenderManager.instance.options.fancyGraphics)
- RenderManager.instance.renderEntityWithPosYaw(
- entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F);
+ RenderManager.instance
+ .renderEntityWithPosYaw(
+ entityitem,
+ 0.0D,
+ 0.0D,
+ 0.0D,
+ 0.0F,
+ 0.0F);
else {
GL11.glRotatef(180F, 0F, 1F, 0F);
RenderManager.instance.options.fancyGraphics = true;
- RenderManager.instance.renderEntityWithPosYaw(
- entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F);
+ RenderManager.instance
+ .renderEntityWithPosYaw(
+ entityitem,
+ 0.0D,
+ 0.0D,
+ 0.0D,
+ 0.0F,
+ 0.0F);
RenderManager.instance.options.fancyGraphics = false;
}
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glPopMatrix();
}
- if (jt.hasGem && jt.gem.getIconIndex().getIconName() != "") {
+ if (jt.hasGem && jt.gem.getIconIndex()
+ .getIconName() != "") {
GL11.glPushMatrix();
GL11.glDisable(GL11.GL_LIGHTING);
- EntityItem entityitem = new EntityItem(te.getWorldObj(),
- 0.0D, 0.0D, 0.0D, jt.gem);
+ EntityItem entityitem = new EntityItem(
+ te.getWorldObj(), 0.0D,
+ 0.0D, 0.0D, jt.gem);
entityitem.getEntityItem().stackSize = 1;
entityitem.hoverStart = 0.0F;
GL11.glRotatef(180F, 1F, 0F, 0F);
@@ -122,13 +150,25 @@ public class TileEntityJewelrsCraftingTableRender GL11.glTranslatef(-0.55F, -1.5F, -0.45F);
GL11.glRotatef(jt.angle, 0F, 1F, 0F);
if (RenderManager.instance.options.fancyGraphics)
- RenderManager.instance.renderEntityWithPosYaw(
- entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F);
+ RenderManager.instance
+ .renderEntityWithPosYaw(
+ entityitem,
+ 0.0D,
+ 0.0D,
+ 0.0D,
+ 0.0F,
+ 0.0F);
else {
GL11.glRotatef(180F, 0F, 1F, 0F);
RenderManager.instance.options.fancyGraphics = true;
- RenderManager.instance.renderEntityWithPosYaw(
- entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F);
+ RenderManager.instance
+ .renderEntityWithPosYaw(
+ entityitem,
+ 0.0D,
+ 0.0D,
+ 0.0D,
+ 0.0F,
+ 0.0F);
RenderManager.instance.options.fancyGraphics = false;
}
GL11.glEnable(GL11.GL_LIGHTING);
@@ -150,11 +190,13 @@ public class TileEntityJewelrsCraftingTableRender Block block) {
Tessellator tess = Tessellator.instance;
float brightness = block.getLightOpacity(world, i, j, k);
- int skyLight = world.getLightBrightnessForSkyBlocks(i, j, k, 0);
+ int skyLight = world.getLightBrightnessForSkyBlocks(i, j,
+ k, 0);
int modulousModifier = skyLight % 65536;
int divModifier = skyLight / 65536;
tess.setColorOpaque_F(brightness, brightness, brightness);
- OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit,
+ OpenGlHelper.setLightmapTextureCoords(
+ OpenGlHelper.lightmapTexUnit,
modulousModifier, divModifier);
}
}
diff --git a/src/main/java/darkknight/jewelrycraft/tileentity/renders/TileEntityMidasTouchRender.java b/src/main/java/darkknight/jewelrycraft/tileentity/renders/TileEntityMidasTouchRender.java index bf0a385..f423bc8 100755 --- a/src/main/java/darkknight/jewelrycraft/tileentity/renders/TileEntityMidasTouchRender.java +++ b/src/main/java/darkknight/jewelrycraft/tileentity/renders/TileEntityMidasTouchRender.java @@ -20,11 +20,12 @@ public class TileEntityMidasTouchRender extends TileEntitySpecialRenderer { target.hurtTime = 0;
GL11.glTranslatef(0.5F, 0.0F, 0.5F);
GL11.glColor3f(1.0F, 1.0F, 0.0F);
- RenderManager.instance.renderEntityWithPosYaw(target,
+ RenderManager.instance.renderEntityWithPosYaw(
+ target,
midas.xCoord - RenderManager.renderPosX,
midas.yCoord - RenderManager.renderPosY,
- midas.zCoord - RenderManager.renderPosZ, 0F,
- 1F);
+ midas.zCoord - RenderManager.renderPosZ,
+ 0F, 1F);
} else {
GL11.glTranslatef(0.5F, 0.0F, 0.5F);
GL11.glColor3f(1.0F, 1.0F, 0.0F);
@@ -32,8 +33,8 @@ public class TileEntityMidasTouchRender extends TileEntitySpecialRenderer { new EntityPig(te.getWorldObj()),
midas.xCoord - RenderManager.renderPosX,
midas.yCoord - RenderManager.renderPosY,
- midas.zCoord - RenderManager.renderPosZ, 0F,
- 1F);
+ midas.zCoord - RenderManager.renderPosZ,
+ 0F, 1F);
}
GL11.glPopMatrix();
}
diff --git a/src/main/java/darkknight/jewelrycraft/tileentity/renders/TileEntityMolderRender.java b/src/main/java/darkknight/jewelrycraft/tileentity/renders/TileEntityMolderRender.java index 6f55e1c..c93a09b 100755 --- a/src/main/java/darkknight/jewelrycraft/tileentity/renders/TileEntityMolderRender.java +++ b/src/main/java/darkknight/jewelrycraft/tileentity/renders/TileEntityMolderRender.java @@ -42,9 +42,10 @@ public class TileEntityMolderRender extends TileEntitySpecialRenderer { (float) z + 0.5F);
TileEntityMolder me = (TileEntityMolder) te;
String texture = "textures/tileentities/Molder.png";
- ResourceLocation blockTexture =
- new ResourceLocation(Variables.MODID, texture);
- Minecraft.getMinecraft().renderEngine.bindTexture(blockTexture);
+ ResourceLocation blockTexture = new ResourceLocation(
+ Variables.MODID, texture);
+ Minecraft.getMinecraft().renderEngine
+ .bindTexture(blockTexture);
GL11.glPushMatrix();
GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
try {
@@ -60,15 +61,16 @@ public class TileEntityMolderRender extends TileEntitySpecialRenderer { }
} catch (Exception e) {
}
- modelMolder.render((Entity) null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F,
- 0.0625F);
- boolean fancyGraphics =
- Minecraft.getMinecraft().gameSettings.fancyGraphics;
+ modelMolder.render((Entity) null, 0.0F, 0.0F, -0.1F, 0.0F,
+ 0.0F, 0.0625F);
+ boolean fancyGraphics = Minecraft
+ .getMinecraft().gameSettings.fancyGraphics;
if (me != null) {
if (me.hasMold) {
GL11.glPushMatrix();
- EntityItem entityitem = new EntityItem(te.getWorldObj(),
- 0.0D, 0.0D, 0.0D, me.mold);
+ EntityItem entityitem = new EntityItem(
+ te.getWorldObj(), 0.0D,
+ 0.0D, 0.0D, me.mold);
entityitem.getEntityItem().stackSize = 1;
entityitem.hoverStart = 0.0F;
GL11.glTranslatef(0F, 1.43F, -0.28F);
@@ -76,23 +78,37 @@ public class TileEntityMolderRender extends TileEntitySpecialRenderer { GL11.glRotatef(90F, 1F, 0F, 0f);
Minecraft.getMinecraft().gameSettings.fancyGraphics = true;
if (entityitem != null) {
- RenderManager.instance.renderEntityWithPosYaw(
- entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F);
- RenderManager.instance.renderEntityWithPosYaw(
- entityitem, 0.0D, 0.0D, 0.03D, 0.0F, 0.0F);
+ RenderManager.instance
+ .renderEntityWithPosYaw(
+ entityitem,
+ 0.0D,
+ 0.0D,
+ 0.0D,
+ 0.0F,
+ 0.0F);
+ RenderManager.instance
+ .renderEntityWithPosYaw(
+ entityitem,
+ 0.0D,
+ 0.0D,
+ 0.03D,
+ 0.0F,
+ 0.0F);
}
- Minecraft.getMinecraft().gameSettings.fancyGraphics =
- fancyGraphics;
+ Minecraft.getMinecraft().gameSettings.fancyGraphics = fancyGraphics;
GL11.glPopMatrix();
}
if (me.hasJewelBase && me.jewelBase != null
&& me.jewelBase.getItem() != Item
- .getItemFromBlock(Blocks.air)
+ .getItemFromBlock(
+ Blocks.air)
&& me.jewelBase.getIconIndex() != null
- && me.jewelBase.getIconIndex().getIconName() != "") {
+ && me.jewelBase.getIconIndex()
+ .getIconName() != "") {
GL11.glPushMatrix();
- EntityItem entityitem = new EntityItem(te.getWorldObj(),
- 0.0D, 0.0D, 0.0D, me.jewelBase);
+ EntityItem entityitem = new EntityItem(
+ te.getWorldObj(), 0.0D,
+ 0.0D, 0.0D, me.jewelBase);
entityitem.getEntityItem().stackSize = 1;
entityitem.hoverStart = 0.0F;
GL11.glTranslatef(0F, 1.4F, -0.28F);
@@ -100,36 +116,51 @@ public class TileEntityMolderRender extends TileEntitySpecialRenderer { GL11.glRotatef(90F, 1F, 0F, 0f);
Minecraft.getMinecraft().gameSettings.fancyGraphics = true;
if (entityitem != null)
- RenderManager.instance.renderEntityWithPosYaw(
- entityitem, 0.0D, 0.0D, 0.01D, 0.0F, 0.0F);
- Minecraft.getMinecraft().gameSettings.fancyGraphics =
- fancyGraphics;
+ RenderManager.instance
+ .renderEntityWithPosYaw(
+ entityitem,
+ 0.0D,
+ 0.0D,
+ 0.01D,
+ 0.0F,
+ 0.0F);
+ Minecraft.getMinecraft().gameSettings.fancyGraphics = fancyGraphics;
GL11.glColor4f(1, 1F, 1F, 1.0F);
GL11.glPopMatrix();
}
if (me.hasMoltenMetal && me.moltenMetal != null
- && me.moltenMetal != new ItemStack(Item.getItemById(0),
+ && me.moltenMetal != new ItemStack(
+ Item.getItemById(
+ 0),
0, 0)) {
GL11.glPushMatrix();
GL11.glDisable(GL11.GL_LIGHTING);
if (JewelrycraftMod.fancyRender) {
GL11.glEnable(GL11.GL_BLEND);
- OpenGlHelper.glBlendFunc(1, 1, 0, 0);
+ OpenGlHelper.glBlendFunc(1, 1, 0,
+ 0);
}
- ItemStack metal = new ItemStack(ItemList.metal);
+ ItemStack metal = new ItemStack(
+ ItemList.metal);
ItemStack ingot = me.moltenMetal.copy();
JewelryNBT.addMetal(metal, ingot);
- EntityItem moltenMetal = new EntityItem(te.getWorldObj(),
- 0.0D, 0.0D, 0.0D, metal);
+ EntityItem moltenMetal = new EntityItem(
+ te.getWorldObj(), 0.0D,
+ 0.0D, 0.0D, metal);
moltenMetal.getEntityItem().stackSize = 1;
moltenMetal.hoverStart = 0.0F;
- GL11.glTranslatef(-0F, 1.4f - 0.005f * me.quantity,
+ GL11.glTranslatef(-0F, 1.4f
+ - 0.005f * me.quantity,
-0.29F);
GL11.glScalef(1.2F, 1.0F, 1.4F);
GL11.glRotatef(90F, 1F, 0F, 0f);
RenderItem.renderInFrame = true;
- RenderManager.instance.renderEntityWithPosYaw(moltenMetal,
- 0.0D, 0.0D, 0.0D, 0.0F, 0.0F);
+ RenderManager.instance
+ .renderEntityWithPosYaw(
+ moltenMetal,
+ 0.0D, 0.0D,
+ 0.0D, 0.0F,
+ 0.0F);
RenderItem.renderInFrame = false;
if (JewelrycraftMod.fancyRender)
GL11.glDisable(GL11.GL_BLEND);
@@ -152,11 +183,13 @@ public class TileEntityMolderRender extends TileEntitySpecialRenderer { Block block) {
Tessellator tess = Tessellator.instance;
float brightness = block.getLightOpacity(world, i, j, k);
- int skyLight = world.getLightBrightnessForSkyBlocks(i, j, k, 0);
+ int skyLight = world.getLightBrightnessForSkyBlocks(i, j,
+ k, 0);
int modulousModifier = skyLight % 65536;
int divModifier = skyLight / 65536;
tess.setColorOpaque_F(brightness, brightness, brightness);
- OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit,
+ OpenGlHelper.setLightmapTextureCoords(
+ OpenGlHelper.lightmapTexUnit,
modulousModifier, divModifier);
}
}
diff --git a/src/main/java/darkknight/jewelrycraft/tileentity/renders/TileEntityShadowEyeRender.java b/src/main/java/darkknight/jewelrycraft/tileentity/renders/TileEntityShadowEyeRender.java index 60277a2..5e191ec 100755 --- a/src/main/java/darkknight/jewelrycraft/tileentity/renders/TileEntityShadowEyeRender.java +++ b/src/main/java/darkknight/jewelrycraft/tileentity/renders/TileEntityShadowEyeRender.java @@ -19,8 +19,8 @@ import net.minecraft.util.ResourceLocation; import net.minecraft.world.World;
public class TileEntityShadowEyeRender extends TileEntitySpecialRenderer {
- ModelShadowEye eye = new ModelShadowEye();
- Sphere shadow = new Sphere();
+ ModelShadowEye eye = new ModelShadowEye();
+ Sphere shadow = new Sphere();
/**
* @param te
@@ -36,11 +36,12 @@ public class TileEntityShadowEyeRender extends TileEntitySpecialRenderer { GL11.glTranslatef((float) x + 0.5F, (float) y + 1.6F,
(float) z + 0.5F);
TileEntityShadowEye eyeS = (TileEntityShadowEye) te;
- String texture =
- "textures/tileentities/ShadowEye" + eyeS.opening + ".png";
- ResourceLocation blockTexture =
- new ResourceLocation(Variables.MODID, texture);
- Minecraft.getMinecraft().renderEngine.bindTexture(blockTexture);
+ String texture = "textures/tileentities/ShadowEye"
+ + eyeS.opening + ".png";
+ ResourceLocation blockTexture = new ResourceLocation(
+ Variables.MODID, texture);
+ Minecraft.getMinecraft().renderEngine
+ .bindTexture(blockTexture);
GL11.glPushMatrix();
GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
try {
@@ -54,23 +55,32 @@ public class TileEntityShadowEyeRender extends TileEntitySpecialRenderer { } catch (Exception e) {
}
if (te != null && te.getWorldObj() != null) {
- EntityPlayer player = te.getWorldObj().getClosestPlayer(
- te.xCoord, te.yCoord, te.zCoord, 16D);
+ EntityPlayer player = te.getWorldObj()
+ .getClosestPlayer(te.xCoord,
+ te.yCoord,
+ te.zCoord, 16D);
if (player != null) {
- float x1 = (float) (te.xCoord - player.posX) + 0.5F;
- float y1 = (float) (te.yCoord - player.posY) + 0.5F;
- float z1 = (float) (te.zCoord - player.posZ) + 0.5F;
+ float x1 = (float) (te.xCoord
+ - player.posX) + 0.5F;
+ float y1 = (float) (te.yCoord
+ - player.posY) + 0.5F;
+ float z1 = (float) (te.zCoord
+ - player.posZ) + 0.5F;
eyeS.model.render(player, 0,
- (float) (x1 >= 0 ? Math.atan(z1 / x1)
- : Math.PI + Math.atan(z1 / x1)),
- (float) (y1 >= 0 ? Math.atan(y1 / x1)
+ (float) (x1 >= 0 ? Math
+ .atan(z1 / x1)
+ : Math.PI + Math.atan(
+ z1 / x1)),
+ (float) (y1 >= 0 ? Math
+ .atan(y1 / x1)
: Math.atan(y1 / x1)),
- te.blockMetadata, eyeS.opening, 0.0625F);
+ te.blockMetadata,
+ eyeS.opening, 0.0625F);
}
} else
- eyeS.model.render((Entity) null, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F,
- 0.0625F);
+ eyeS.model.render((Entity) null, 0.0F, 0.0F, 0.0F,
+ 0.0F, 0.0F, 0.0625F);
if (eyeS.opening == 4) {
GL11.glPushMatrix();
@@ -104,11 +114,13 @@ public class TileEntityShadowEyeRender extends TileEntitySpecialRenderer { Block block) {
Tessellator tess = Tessellator.instance;
float brightness = block.getLightOpacity(world, i, j, k);
- int skyLight = world.getLightBrightnessForSkyBlocks(i, j, k, 0);
+ int skyLight = world.getLightBrightnessForSkyBlocks(i, j,
+ k, 0);
int modulousModifier = skyLight % 65536;
int divModifier = skyLight / 65536;
tess.setColorOpaque_F(brightness, brightness, brightness);
- OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit,
+ OpenGlHelper.setLightmapTextureCoords(
+ OpenGlHelper.lightmapTexUnit,
modulousModifier, divModifier);
}
}
diff --git a/src/main/java/darkknight/jewelrycraft/tileentity/renders/TileEntitySmelterRender.java b/src/main/java/darkknight/jewelrycraft/tileentity/renders/TileEntitySmelterRender.java index 1cbd32c..b694afa 100755 --- a/src/main/java/darkknight/jewelrycraft/tileentity/renders/TileEntitySmelterRender.java +++ b/src/main/java/darkknight/jewelrycraft/tileentity/renders/TileEntitySmelterRender.java @@ -21,9 +21,9 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.util.ResourceLocation;
public class TileEntitySmelterRender extends TileEntitySpecialRenderer {
- ModelSmelter modelSmelter = new ModelSmelter();
- public static final float p = 1 / 16, p3 = 3 * p,
- p13 = 13 * p, p15 = 15 * p;
+ ModelSmelter modelSmelter = new ModelSmelter();
+ public static final float p = 1 / 16,
+ p3 = 3 * p, p13 = 13 * p, p15 = 15 * p;
/**
* @param te
@@ -39,9 +39,10 @@ public class TileEntitySmelterRender extends TileEntitySpecialRenderer { GL11.glTranslatef((float) x + 0.5F, (float) y + 1.5F,
(float) z + 0.5F);
String texture = "textures/tileentities/Smelter.png";
- ResourceLocation blockTexture =
- new ResourceLocation(Variables.MODID, texture);
- Minecraft.getMinecraft().renderEngine.bindTexture(blockTexture);
+ ResourceLocation blockTexture = new ResourceLocation(
+ Variables.MODID, texture);
+ Minecraft.getMinecraft().renderEngine
+ .bindTexture(blockTexture);
TileEntitySmelter st = (TileEntitySmelter) te;
GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
try {
@@ -57,10 +58,10 @@ public class TileEntitySmelterRender extends TileEntitySpecialRenderer { }
} catch (Exception e) {
}
- boolean fancyGraphics =
- Minecraft.getMinecraft().gameSettings.fancyGraphics;
- modelSmelter.render((Entity) null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F,
- 0.0625F);
+ boolean fancyGraphics = Minecraft
+ .getMinecraft().gameSettings.fancyGraphics;
+ modelSmelter.render((Entity) null, 0.0F, 0.0F, -0.1F, 0.0F,
+ 0.0F, 0.0625F);
if (scale != 0) {
GL11.glPushMatrix();
GL11.glDisable(GL11.GL_LIGHTING);
@@ -68,8 +69,9 @@ public class TileEntitySmelterRender extends TileEntitySpecialRenderer { GL11.glEnable(GL11.GL_BLEND);
OpenGlHelper.glBlendFunc(1, 1, 0, 0);
}
- EntityItem entityitem = new EntityItem(te.getWorldObj(), 0.0D,
- 0.0D, 0.0D, new ItemStack(Blocks.lava, 1, 1));
+ EntityItem entityitem = new EntityItem(
+ te.getWorldObj(), 0.0D, 0.0D, 0.0D,
+ new ItemStack(Blocks.lava, 1, 1));
entityitem.hoverStart = 0.0F;
GL11.glTranslatef(-0F, 1.25F, -0.345F);
GL11.glScalef(1.2F, 1.0F, 1.7F);
@@ -79,9 +81,11 @@ public class TileEntitySmelterRender extends TileEntitySpecialRenderer { int j = i % 65536;
int k = i / 65536;
OpenGlHelper.setLightmapTextureCoords(
- OpenGlHelper.lightmapTexUnit, j / 1.0F, k / 1.0F);
- RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D,
- 0.0D, 0.0D, 0.0F, 0.0F);
+ OpenGlHelper.lightmapTexUnit,
+ j / 1.0F, k / 1.0F);
+ RenderManager.instance.renderEntityWithPosYaw(
+ entityitem, 0.0D, 0.0D, 0.0D, 0.0F,
+ 0.0F);
RenderItem.renderInFrame = false;
if (JewelrycraftMod.fancyRender)
GL11.glDisable(GL11.GL_BLEND);
@@ -92,7 +96,8 @@ public class TileEntitySmelterRender extends TileEntitySpecialRenderer { if (st.hasMetal && st.metal != null
&& st.metal.getItem() != null) {
GL11.glPushMatrix();
- EntityItem metal = new EntityItem(te.getWorldObj(), 0.0D,
+ EntityItem metal = new EntityItem(
+ te.getWorldObj(), 0.0D,
0.0D, 0.0D, st.metal);
metal.getEntityItem().stackSize = 1;
metal.hoverStart = 0.0F;
@@ -102,33 +107,46 @@ public class TileEntitySmelterRender extends TileEntitySpecialRenderer { GL11.glScalef(0.5F, 0.5F, 0.5F);
GL11.glTranslatef(-0.9F, -0.9F, -1.6F);
Minecraft.getMinecraft().gameSettings.fancyGraphics = true;
- RenderManager.instance.renderEntityWithPosYaw(metal, 0.0D,
- 0.0D, 0.0D, 0.0F, 0.0F);
- Minecraft.getMinecraft().gameSettings.fancyGraphics =
- fancyGraphics;
+ RenderManager.instance
+ .renderEntityWithPosYaw(
+ metal,
+ 0.0D, 0.0D,
+ 0.0D, 0.0F,
+ 0.0F);
+ Minecraft.getMinecraft().gameSettings.fancyGraphics = fancyGraphics;
GL11.glPopMatrix();
}
if (st.hasMoltenMetal && st.moltenMetal != null
- && st.moltenMetal.getItem() != null) {
+ && st.moltenMetal
+ .getItem() != null) {
GL11.glPushMatrix();
GL11.glDisable(GL11.GL_LIGHTING);
if (JewelrycraftMod.fancyRender) {
GL11.glEnable(GL11.GL_BLEND);
- OpenGlHelper.glBlendFunc(1, 1, 0, 0);
+ OpenGlHelper.glBlendFunc(1, 1, 0,
+ 0);
}
- ItemStack metal = new ItemStack(ItemList.metal);
+ ItemStack metal = new ItemStack(
+ ItemList.metal);
ItemStack ingot = st.moltenMetal.copy();
JewelryNBT.addMetal(metal, ingot);
- EntityItem moltenMetal = new EntityItem(te.getWorldObj(),
- 0.0D, 0.0D, 0.0D, metal);
+ EntityItem moltenMetal = new EntityItem(
+ te.getWorldObj(), 0.0D,
+ 0.0D, 0.0D, metal);
moltenMetal.getEntityItem().stackSize = 1;
moltenMetal.hoverStart = 0.0F;
- GL11.glTranslatef(-0F, 1.00f - .4F * st.quantity, -0.14F);
+ GL11.glTranslatef(-0F,
+ 1.00f - .4F * st.quantity,
+ -0.14F);
GL11.glScalef(0.71F, 1F, 0.84F);
GL11.glRotatef(90F, 1F, 0F, 0f);
RenderItem.renderInFrame = true;
- RenderManager.instance.renderEntityWithPosYaw(moltenMetal,
- 0.0D, 0.0D, 0.0D, 0.0F, 0.0F);
+ RenderManager.instance
+ .renderEntityWithPosYaw(
+ moltenMetal,
+ 0.0D, 0.0D,
+ 0.0D, 0.0F,
+ 0.0F);
RenderItem.renderInFrame = false;
if (JewelrycraftMod.fancyRender)
GL11.glDisable(GL11.GL_BLEND);
diff --git a/src/main/java/darkknight/jewelrycraft/util/BlockUtils.java b/src/main/java/darkknight/jewelrycraft/util/BlockUtils.java index 18dc191..17a6cdc 100755 --- a/src/main/java/darkknight/jewelrycraft/util/BlockUtils.java +++ b/src/main/java/darkknight/jewelrycraft/util/BlockUtils.java @@ -10,21 +10,21 @@ import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection;
public class BlockUtils {
- public static final ForgeDirection DEFAULT_BLOCK_DIRECTION =
- ForgeDirection.WEST;
+ public static final ForgeDirection DEFAULT_BLOCK_DIRECTION = ForgeDirection.WEST;
/**
- * This method is used to get the direction an entity is facing (NORTH,
- * SOUTH, EAST or WEST) based on the entity's rotationYaw.
+ * This method is used to get the direction an entity is facing
+ * (NORTH, SOUTH, EAST or WEST) based on the entity's rotationYaw.
*
* @param entity
- * the living entity
+ * the living entity
* @return a direction
*/
- public static ForgeDirection
- get2dOrientation(EntityLivingBase entity) {
+ public static ForgeDirection get2dOrientation(
+ EntityLivingBase entity) {
int l = MathHelper.floor_double(
- entity.rotationYaw * 4.0F / 360.0F + 0.5D) & 0x3;
+ entity.rotationYaw * 4.0F / 360.0F + 0.5D)
+ & 0x3;
switch (l) {
case 0:
return ForgeDirection.SOUTH;
@@ -43,11 +43,11 @@ public class BlockUtils { * This gets a float value depending on a direction
*
* @param direction
- * the forge direction
+ * the forge direction
* @return value depending on direction
*/
- public static float
- getRotationFromDirection(ForgeDirection direction) {
+ public static float getRotationFromDirection(
+ ForgeDirection direction) {
switch (direction) {
case NORTH:
return 0F;
@@ -68,15 +68,15 @@ public class BlockUtils { }
/**
- * This method is used to get the direction an entity is looking at (UP
- * or DOWN) based on the entitiy's rotationPitch
+ * This method is used to get the direction an entity is looking at
+ * (UP or DOWN) based on the entitiy's rotationPitch
*
* @param entity
- * the living entity
+ * the living entity
* @return a forge direction
*/
- public static ForgeDirection
- get3dOrientation(EntityLivingBase entity) {
+ public static ForgeDirection get3dOrientation(
+ EntityLivingBase entity) {
if (entity.rotationPitch > 45.5F)
return ForgeDirection.DOWN;
else if (entity.rotationPitch < -45.5F)
@@ -85,32 +85,38 @@ public class BlockUtils { }
/**
- * This spawns the item specified and returns the EntityItem it created
+ * This spawns the item specified and returns the EntityItem it
+ * created
*
* @param worldObj
- * the world
+ * the world
* @param x
- * position of the item to drop on the X axis
+ * position of the item to drop on the X axis
* @param y
- * position of the item to drop on the Y axis
+ * position of the item to drop on the Y axis
* @param z
- * position of the item to drop on the Z axis
+ * position of the item to drop on the Z axis
* @param stack
- * the item to spawn
+ * the item to spawn
* @return the EntityItem of the stack
*/
- public static EntityItem dropItemStackInWorld(World worldObj, double x,
- double y, double z, ItemStack stack) {
+ public static EntityItem dropItemStackInWorld(World worldObj,
+ double x, double y, double z, ItemStack stack) {
float f = 0.7F;
- float d0 = worldObj.rand.nextFloat() * f + (1.0F - f) * 0.5F;
- float d1 = worldObj.rand.nextFloat() * f + (1.0F - f) * 0.5F;
- float d2 = worldObj.rand.nextFloat() * f + (1.0F - f) * 0.5F;
- EntityItem entityitem =
- new EntityItem(worldObj, x + d0, y + d1, z + d2, stack);
+ float d0 = worldObj.rand.nextFloat() * f
+ + (1.0F - f) * 0.5F;
+ float d1 = worldObj.rand.nextFloat() * f
+ + (1.0F - f) * 0.5F;
+ float d2 = worldObj.rand.nextFloat() * f
+ + (1.0F - f) * 0.5F;
+ EntityItem entityitem = new EntityItem(worldObj, x + d0,
+ y + d1, z + d2, stack);
entityitem.delayBeforeCanPickup = 10;
if (stack.hasTagCompound())
entityitem.getEntityItem().setTagCompound(
- (NBTTagCompound) stack.getTagCompound().copy());
+ (NBTTagCompound) stack
+ .getTagCompound()
+ .copy());
worldObj.spawnEntityInWorld(entityitem);
return entityitem;
}
@@ -119,24 +125,24 @@ public class BlockUtils { * It spawns the item with momentum in a certain direction
*
* @param world
- * the world to spawn the item
+ * the world to spawn the item
* @param x
- * the X coordinate to spawn it in
+ * the X coordinate to spawn it in
* @param y
- * the Y coordinate to spawn it in
+ * the Y coordinate to spawn it in
* @param z
- * the Z coordinate to spawn it in
+ * the Z coordinate to spawn it in
* @param direction
- * the direction towards which it should eject
+ * the direction towards which it should eject
* @param stack
- * the item to spawn
+ * the item to spawn
* @return the spawned EntityItem
*/
- public static EntityItem ejectItemInDirection(World world, double x,
- double y, double z, ForgeDirection direction,
- ItemStack stack) {
- EntityItem item =
- BlockUtils.dropItemStackInWorld(world, x, y, z, stack);
+ public static EntityItem ejectItemInDirection(World world,
+ double x, double y, double z,
+ ForgeDirection direction, ItemStack stack) {
+ EntityItem item = BlockUtils.dropItemStackInWorld(world, x,
+ y, z, stack);
item.motionX = direction.offsetX / 5F;
item.motionY = direction.offsetY / 5F;
item.motionZ = direction.offsetZ / 5F;
@@ -147,15 +153,15 @@ public class BlockUtils { * Drops the content of an inventory with doubles as coordinates
*
* @param inventory
- * the inventory the items are contained in
+ * the inventory the items are contained in
* @param world
- * the world in which to spawn
+ * the world in which to spawn
* @param x
- * the X coordinate to spawn it in
+ * the X coordinate to spawn it in
* @param y
- * the Y coordinate to spawn it in
+ * the Y coordinate to spawn it in
* @param z
- * the Z coordinate to spawn it in
+ * the Z coordinate to spawn it in
*/
public static void dropInventory(IInventory inventory, World world,
double x, double y, double z) {
@@ -164,7 +170,8 @@ public class BlockUtils { for (int i = 0; i < inventory.getSizeInventory(); ++i) {
ItemStack itemStack = inventory.getStackInSlot(i);
if (itemStack != null)
- dropItemStackInWorld(world, x, y, z, itemStack);
+ dropItemStackInWorld(world, x, y, z,
+ itemStack);
}
}
@@ -172,15 +179,15 @@ public class BlockUtils { * Drops the content of an inventory with integer as coordinates
*
* @param inventory
- * the inventory the items are contained in
+ * the inventory the items are contained in
* @param world
- * the world in which to spawn
+ * the world in which to spawn
* @param x
- * the X coordinate to spawn it in
+ * the X coordinate to spawn it in
* @param y
- * the Y coordinate to spawn it in
+ * the Y coordinate to spawn it in
* @param z
- * the Z coordinate to spawn it in
+ * the Z coordinate to spawn it in
*/
public static void dropInventory(IInventory inventory, World world,
int x, int y, int z) {
diff --git a/src/main/java/darkknight/jewelrycraft/util/EntitySelector.java b/src/main/java/darkknight/jewelrycraft/util/EntitySelector.java index 572e2e9..2398817 100755 --- a/src/main/java/darkknight/jewelrycraft/util/EntitySelector.java +++ b/src/main/java/darkknight/jewelrycraft/util/EntitySelector.java @@ -13,7 +13,9 @@ public class EntitySelector { @Override public boolean isEntityApplicable(Entity arg0) { - if (arg0.isCreatureType(EnumCreatureType.monster, false)) { + if (arg0.isCreatureType( + EnumCreatureType.monster, + false)) { return true; } diff --git a/src/main/java/darkknight/jewelrycraft/util/JewelryNBT.java b/src/main/java/darkknight/jewelrycraft/util/JewelryNBT.java index 7b74403..320497b 100755 --- a/src/main/java/darkknight/jewelrycraft/util/JewelryNBT.java +++ b/src/main/java/darkknight/jewelrycraft/util/JewelryNBT.java @@ -25,9 +25,9 @@ public class JewelryNBT { /**
* @param item
- * The item you want to add the NBT data on
+ * The item you want to add the NBT data on
* @param metal
- * The metal you want to add on the item
+ * The metal you want to add on the item
*/
public static void addMetal(ItemStack item, ItemStack metal) {
NBTTagCompound itemStackData;
@@ -46,9 +46,9 @@ public class JewelryNBT { /**
* @param item
- * The item you want to add the NBT data on
+ * The item you want to add the NBT data on
* @param gem
- * The gem you want to add on the item
+ * The gem you want to add on the item
*/
public static void addGem(ItemStack item, ItemStack gem) {
if (gem != null) {
@@ -67,9 +67,9 @@ public class JewelryNBT { /**
* @param item
- * The item you want to add the NBT data on
+ * The item you want to add the NBT data on
* @param modifier
- * The modifier you want to add on the item
+ * The modifier you want to add on the item
*/
public static void addModifiers(ItemStack item,
ArrayList<ItemStack> modifier) {
@@ -84,9 +84,11 @@ public class JewelryNBT { for (int i = 0; i < modifier.size(); i++) {
NBTTagCompound modifierNBT = new NBTTagCompound();
modifier.get(i).writeToNBT(modifierNBT);
- itemStackData.setTag("modifier" + i, modifierNBT);
+ itemStackData.setTag("modifier" + i,
+ modifierNBT);
}
- itemStackData.setInteger("modifierSize", modifier.size());
+ itemStackData.setInteger("modifierSize",
+ modifier.size());
}
}
@@ -146,8 +148,10 @@ public class JewelryNBT { * @return
*/
public static boolean isGemX(ItemStack stack, ItemStack gem) {
- if (gem(stack) != null && gem(stack).getItem() == gem.getItem()
- && gem(stack).getItemDamage() == gem.getItemDamage())
+ if (gem(stack) != null
+ && gem(stack).getItem() == gem.getItem()
+ && gem(stack).getItemDamage() == gem
+ .getItemDamage())
return true;
return false;
}
@@ -162,7 +166,8 @@ public class JewelryNBT { if (modifier(stack) != null) {
ArrayList<ItemStack> list = modifier(stack);
for (int i = 0; i < list.size(); i++)
- if (list.get(i).getItem() == modifier.getItem()
+ if (list.get(i).getItem() == modifier
+ .getItem()
&& list.get(i).getItemDamage() == modifier
.getItemDamage())
return true;
@@ -170,11 +175,13 @@ public class JewelryNBT { return false;
}
- public static int modifierSize(ItemStack stack, ItemStack modifier) {
+ public static int modifierSize(ItemStack stack,
+ ItemStack modifier) {
if (modifier(stack) != null) {
ArrayList<ItemStack> list = modifier(stack);
for (int i = 0; i < list.size(); i++)
- if (list.get(i).getItem() == modifier.getItem()
+ if (list.get(i).getItem() == modifier
+ .getItem()
&& list.get(i).getItemDamage() == modifier
.getItemDamage())
return list.get(i).stackSize;
@@ -195,8 +202,10 @@ public class JewelryNBT { */
public static boolean isIngotX(ItemStack stack, ItemStack ingot) {
if (ingot(stack) != null
- && ingot(stack).getItem() == ingot.getItem()
- && ingot(stack).getItemDamage() == ingot.getItemDamage())
+ && ingot(stack).getItem() == ingot
+ .getItem()
+ && ingot(stack).getItemDamage() == ingot
+ .getItemDamage())
return true;
return false;
}
@@ -204,12 +213,15 @@ public class JewelryNBT { // TODO Return components based on NBT
public static ItemStack item(ItemStack stack) {
if (stack != null
- && stack != new ItemStack(Item.getItemById(0), 0, 0)
+ && stack != new ItemStack(
+ Item.getItemById(0), 0, 0)
&& stack.hasTagCompound()
- && stack.getTagCompound().hasKey("target")) {
+ && stack.getTagCompound()
+ .hasKey("target")) {
NBTTagCompound itemNBT = (NBTTagCompound) stack
.getTagCompound().getTag("target");
- ItemStack target = new ItemStack(Item.getItemById(0), 0, 0);
+ ItemStack target = new ItemStack(
+ Item.getItemById(0), 0, 0);
target.readFromNBT(itemNBT);
return target;
}
@@ -222,12 +234,14 @@ public class JewelryNBT { */
public static ItemStack gem(ItemStack stack) {
if (stack != null
- && stack != new ItemStack(Item.getItemById(0), 0, 0)
+ && stack != new ItemStack(
+ Item.getItemById(0), 0, 0)
&& stack.hasTagCompound()
&& stack.getTagCompound().hasKey("gem")) {
- NBTTagCompound jewelNBT =
- (NBTTagCompound) stack.getTagCompound().getTag("gem");
- ItemStack gem = new ItemStack(Item.getItemById(0), 0, 0);
+ NBTTagCompound jewelNBT = (NBTTagCompound) stack
+ .getTagCompound().getTag("gem");
+ ItemStack gem = new ItemStack(Item.getItemById(0),
+ 0, 0);
gem.readFromNBT(jewelNBT);
return gem;
}
@@ -240,15 +254,18 @@ public class JewelryNBT { */
public static ArrayList<ItemStack> modifier(ItemStack stack) {
if (stack != null
- && stack != new ItemStack(Item.getItemById(0), 0, 0)
+ && stack != new ItemStack(
+ Item.getItemById(0), 0, 0)
&& stack.hasTagCompound()) {
- int size = stack.getTagCompound().getInteger("modifierSize");
+ int size = stack.getTagCompound()
+ .getInteger("modifierSize");
ArrayList<ItemStack> list = new ArrayList<>();
for (int i = 0; i < size; i++) {
- ItemStack modifier =
- new ItemStack(Item.getItemById(0), 0, 0);
+ ItemStack modifier = new ItemStack(
+ Item.getItemById(0), 0, 0);
NBTTagCompound modifierNBT = (NBTTagCompound) stack
- .getTagCompound().getTag("modifier" + i);
+ .getTagCompound()
+ .getTag("modifier" + i);
modifier.readFromNBT(modifierNBT);
list.add(modifier);
}
@@ -263,12 +280,15 @@ public class JewelryNBT { */
public static ItemStack ingot(ItemStack stack) {
if (stack != null
- && stack != new ItemStack(Item.getItemById(0), 0, 0)
+ && stack != new ItemStack(
+ Item.getItemById(0), 0, 0)
&& stack.hasTagCompound()
- && stack.getTagCompound().hasKey("ingot")) {
+ && stack.getTagCompound()
+ .hasKey("ingot")) {
NBTTagCompound ingotNBT = (NBTTagCompound) stack
.getTagCompound().getTag("ingot");
- ItemStack ingot = new ItemStack(Item.getItemById(0), 0, 0);
+ ItemStack ingot = new ItemStack(
+ Item.getItemById(0), 0, 0);
ingot.readFromNBT(ingotNBT);
return ingot;
}
@@ -281,10 +301,13 @@ public class JewelryNBT { */
public static int ingotColor(ItemStack stack) {
if (stack != null
- && stack != new ItemStack(Item.getItemById(0), 0, 0)
+ && stack != new ItemStack(
+ Item.getItemById(0), 0, 0)
&& stack.hasTagCompound()
- && stack.getTagCompound().hasKey("ingotColor"))
- return stack.getTagCompound().getInteger("ingotColor");
+ && stack.getTagCompound()
+ .hasKey("ingotColor"))
+ return stack.getTagCompound()
+ .getInteger("ingotColor");
return 16777215;
}
@@ -295,10 +318,13 @@ public class JewelryNBT { */
public static int gemColor(ItemStack stack) {
if (stack != null
- && stack != new ItemStack(Item.getItemById(0), 0, 0)
+ && stack != new ItemStack(
+ Item.getItemById(0), 0, 0)
&& stack.hasTagCompound()
- && stack.getTagCompound().hasKey("gemColor"))
- return stack.getTagCompound().getInteger("gemColor");
+ && stack.getTagCompound()
+ .hasKey("gemColor"))
+ return stack.getTagCompound()
+ .getInteger("gemColor");
return 16777215;
}
diff --git a/src/main/java/darkknight/jewelrycraft/util/JewelrycraftUtil.java b/src/main/java/darkknight/jewelrycraft/util/JewelrycraftUtil.java index c61e82b..bab97d1 100755 --- a/src/main/java/darkknight/jewelrycraft/util/JewelrycraftUtil.java +++ b/src/main/java/darkknight/jewelrycraft/util/JewelrycraftUtil.java @@ -38,39 +38,28 @@ import net.minecraft.world.World; import net.minecraftforge.oredict.OreDictionary;
public class JewelrycraftUtil {
- public static ArrayList<ItemStack> objects =
- new ArrayList<>();
+ public static ArrayList<ItemStack> objects = new ArrayList<>();
- public static ArrayList<ItemStack> gem =
- new ArrayList<>();
+ public static ArrayList<ItemStack> gem = new ArrayList<>();
- public static ArrayList<ItemStack> jewelry =
- new ArrayList<>();
+ public static ArrayList<ItemStack> jewelry = new ArrayList<>();
- public static ArrayList<ItemStack> metal =
- new ArrayList<>();
+ public static ArrayList<ItemStack> metal = new ArrayList<>();
- public static ArrayList<ItemStack> ores =
- new ArrayList<>();
+ public static ArrayList<ItemStack> ores = new ArrayList<>();
- public static HashMap<ItemStack, ItemStack> oreToIngot =
- new HashMap<>();
- public static HashMap<ItemStack, Integer> colors =
- new HashMap<>();
+ public static HashMap<ItemStack, ItemStack> oreToIngot = new HashMap<>();
+ public static HashMap<ItemStack, Integer> colors = new HashMap<>();
- public static ArrayList<String> jamcraftPlayers =
- new ArrayList<>();
+ public static ArrayList<String> jamcraftPlayers = new ArrayList<>();
- private static ArrayList<ItemStack> items =
- new ArrayList<>();
+ private static ArrayList<ItemStack> items = new ArrayList<>();
- public static ArrayList<WorldGenStructure> structures =
- new ArrayList<>();
+ public static ArrayList<WorldGenStructure> structures = new ArrayList<>();
- public static Random rand =
- new Random();
+ public static Random rand = new Random();
- public static EnumCreatureAttribute HEARTS;
+ public static EnumCreatureAttribute HEARTS;
/**
* Adds gems and jewelry to their appropriate lists
@@ -106,10 +95,13 @@ public class JewelrycraftUtil { try {
if (itemHasSubtypes(item)) {
- ((Item) item).getSubItems((Item) item, null,
+ ((Item) item).getSubItems(
+ (Item) item,
+ null,
items);
} else {
- objects.add(new ItemStack((Item) item));
+ objects.add(new ItemStack(
+ (Item) item));
}
if (!items.isEmpty()) {
@@ -118,8 +110,8 @@ public class JewelrycraftUtil { items.removeAll(items);
} catch (Exception e) {
- JewelrycraftMod.logger
- .info("Error, tried to add subtypes of item "
+ JewelrycraftMod.logger.info(
+ "Error, tried to add subtypes of item "
+ ((Item) item).getUnlocalizedName()
+ "\nItem is not added in the list.");
}
@@ -128,7 +120,8 @@ public class JewelrycraftUtil { // Structures
try {
- for (Field f : Generation.class.getDeclaredFields()) {
+ for (Field f : Generation.class
+ .getDeclaredFields()) {
Object obj = f.get(null);
if (obj instanceof WorldGenStructure) {
structures.add((WorldGenStructure) obj);
@@ -140,8 +133,8 @@ public class JewelrycraftUtil { }
private static boolean itemHasSubtypes(Object item) {
- return ((Item) item).getHasSubtypes()
- && FMLCommonHandler.instance().getSide() == Side.CLIENT;
+ return ((Item) item).getHasSubtypes() && FMLCommonHandler
+ .instance().getSide() == Side.CLIENT;
}
@SideOnly(Side.CLIENT)
@@ -156,23 +149,29 @@ public class JewelrycraftUtil { try {
if (itemHasSubtypes(item)) {
- ((Item) item).getSubItems((Item) item, null,
+ ((Item) item).getSubItems(
+ (Item) item,
+ null,
items);
} else {
- ItemStack it = new ItemStack((Item) item);
- colors.put(it, color(it, 0));
+ ItemStack it = new ItemStack(
+ (Item) item);
+ colors.put(it, color(it,
+ 0));
}
if (!items.isEmpty()) {
for (ItemStack it : items) {
- colors.put(it, color(it, 0));
+ colors.put(it, color(
+ it,
+ 0));
}
}
items.removeAll(items);
} catch (Exception e) {
- JewelrycraftMod.logger
- .info("Error, tried to add the color of the item "
+ JewelrycraftMod.logger.info(
+ "Error, tried to add the color of the item "
+ ((Item) item).getUnlocalizedName()
+ " but something went wrong.");
}
@@ -185,8 +184,10 @@ public class JewelrycraftUtil { for (ItemStack stack : colors.keySet()) {
if (item != null && item.getItem() != null
&& stack.getItem() != null
- && item.getItem().equals(stack.getItem())
- && item.getItemDamage() == stack.getItemDamage()) {
+ && item.getItem().equals(
+ stack.getItem())
+ && item.getItemDamage() == stack
+ .getItemDamage()) {
return colors.get(stack);
}
}
@@ -197,8 +198,11 @@ public class JewelrycraftUtil { @SideOnly(Side.CLIENT)
public static int color(ItemStack stack, int pass) {
if (stack != null) {
- if (Item.getIdFromItem(stack.getItem()) > 0 && stack.getItem()
- .getColorFromItemStack(stack, pass) == 16777215) {
+ if (Item.getIdFromItem(stack.getItem()) > 0
+ && stack.getItem()
+ .getColorFromItemStack(
+ stack,
+ pass) == 16777215) {
return (int) Math.random() * 16777215;
}
@@ -210,9 +214,11 @@ public class JewelrycraftUtil { // try {
// ingot = getLocation(stack);
// } catch (Exception e) {
- // ingot = new ResourceLocation("textures/items/apple.png");
+ // ingot = new
+ // ResourceLocation("textures/items/apple.png");
// }
- // icon = ImageIO.read(rm.getResource(ingot).getInputStream());
+ // icon =
+ // ImageIO.read(rm.getResource(ingot).getInputStream());
// int height = icon.getHeight();
// int width = icon.getWidth();
// Map m = new HashMap();
@@ -230,7 +236,8 @@ public class JewelrycraftUtil { // }
// return getMostCommonColour(m);
- return stack.getItem().getColorFromItemStack(stack, pass);
+ return stack.getItem().getColorFromItemStack(stack,
+ pass);
}
return (int) Math.random() * 16777215;
@@ -244,33 +251,40 @@ public class JewelrycraftUtil { IIcon itemIcon = item.getItem().getIcon(item, 0);
if (isValidBlockFromItem(item)) {
- itemIcon = Block.getBlockFromItem(item.getItem()).getIcon(0,
- item.getItemDamage());
+ itemIcon = Block.getBlockFromItem(item.getItem())
+ .getIcon(0, item.getItemDamage());
}
String iconName = itemIcon.getIconName();
- if (iconName.substring(0, iconName.indexOf(":") + 1) != "") {
- domain = iconName.substring(0, iconName.indexOf(":") + 1)
+ if (iconName.substring(0,
+ iconName.indexOf(":") + 1) != "") {
+ domain = iconName
+ .substring(0, iconName.indexOf(":")
+ + 1)
.replace(":", " ").trim();
} else {
domain = "minecraft";
}
- texture =
- iconName.substring(iconName.lastIndexOf(":") + 1) + ".png";
+ texture = iconName.substring(iconName.lastIndexOf(":") + 1)
+ + ".png";
ResourceLocation textureLocation = null;
- TextureManager texturemanager =
- Minecraft.getMinecraft().getTextureManager();
+ TextureManager texturemanager = Minecraft.getMinecraft()
+ .getTextureManager();
- if (texturemanager.getResourceLocation(item.getItemSpriteNumber())
+ if (texturemanager
+ .getResourceLocation(
+ item.getItemSpriteNumber())
.toString().contains("items")) {
- textureLocation = new ResourceLocation(domain.toLowerCase(),
+ textureLocation = new ResourceLocation(
+ domain.toLowerCase(),
"textures/items/" + texture);
} else {
- textureLocation = new ResourceLocation(domain.toLowerCase(),
+ textureLocation = new ResourceLocation(
+ domain.toLowerCase(),
"textures/blocks/" + texture);
}
@@ -278,24 +292,26 @@ public class JewelrycraftUtil { }
private static boolean isValidBlockFromItem(ItemStack item) {
- return !(Block
- .getBlockFromItem(item.getItem()) instanceof BlockAir)
+ return !(Block.getBlockFromItem(
+ item.getItem()) instanceof BlockAir)
&& !Block.getBlockFromItem(item.getItem())
- .getIcon(0, item.getItemDamage()).getIconName()
+ .getIcon(0, item.getItemDamage())
+ .getIconName()
.equals("soul_sand");
}
/*
* @SideOnly(Side.CLIENT) public static int getMostCommonColour(Map
* map) { List list = new LinkedList(map.entrySet());
- * Collections.sort(list, new Comparator() { public int compare(Object
- * o1, Object o2) { return ((Comparable) ((Map.Entry) o1).getValue())
- * .compareTo(((Map.Entry) o2).getValue()); } }); Map.Entry me =
- * (Map.Entry) list.get(list.size() - 1); for (int i = 0; i <
- * list.size(); i++) { float alpha = Float
- * .valueOf(list.get(i).toString().split("=")[1]); if (alpha < 180) me
- * = (Map.Entry) list.get(i); } int rgb = (Integer) me.getKey(); return
- * rgb; }
+ * Collections.sort(list, new Comparator() { public int
+ * compare(Object o1, Object o2) { return ((Comparable)
+ * ((Map.Entry) o1).getValue()) .compareTo(((Map.Entry)
+ * o2).getValue()); } }); Map.Entry me = (Map.Entry)
+ * list.get(list.size() - 1); for (int i = 0; i < list.size(); i++)
+ * { float alpha = Float
+ * .valueOf(list.get(i).toString().split("=")[1]); if (alpha < 180)
+ * me = (Map.Entry) list.get(i); } int rgb = (Integer) me.getKey();
+ * return rgb; }
*/
@SideOnly(Side.CLIENT)
@@ -311,13 +327,15 @@ public class JewelrycraftUtil { public static WeightedRandomCurse[] getCurses(World world,
EntityPlayer player, Random random) {
- WeightedRandomCurse[] curses =
- new WeightedRandomCurse[Curse.availableCurses.size()];
+ WeightedRandomCurse[] curses = new WeightedRandomCurse[Curse.availableCurses
+ .size()];
for (int c = 0; c < Curse.availableCurses.size(); c++) {
curses[c] = new WeightedRandomCurse(
- Curse.availableCurses.get(c), Curse.availableCurses
- .get(c).weight(world, player, random));
+ Curse.availableCurses.get(c),
+ Curse.availableCurses.get(c)
+ .weight(world, player,
+ random));
}
return curses;
@@ -327,25 +345,27 @@ public class JewelrycraftUtil { * Adds curse points to a player
*
* @param player
- * the player to add the points to
+ * the player to add the points to
* @param points
- * amount of curse points
+ * amount of curse points
*/
- public static void addCursePoints(EntityPlayer player, int points) {
+ public static void addCursePoints(EntityPlayer player,
+ int points) {
NBTTagCompound playerInfo = PlayerUtils
- .getModPlayerPersistTag(player, Variables.MODID);
+ .getModPlayerPersistTag(player,
+ Variables.MODID);
playerInfo.setInteger("cursePoints",
- playerInfo.hasKey("cursePoints")
- ? (playerInfo.getInteger("cursePoints") + points)
- : points);
+ playerInfo.hasKey(
+ "cursePoints") ? (playerInfo.getInteger("cursePoints") + points) : points);
playerInfo.setBoolean("playerCursePointsChanged", true);
}
public static int getCursePoints(EntityPlayer player) {
NBTTagCompound playerInfo = PlayerUtils
- .getModPlayerPersistTag(player, Variables.MODID);
+ .getModPlayerPersistTag(player,
+ Variables.MODID);
return playerInfo.getInteger("cursePoints");
}
@@ -354,38 +374,56 @@ public class JewelrycraftUtil { * Adds the UUID's of the jamcrafters in a list (+ special people)
*/
public static void jamcrafters() {
- jamcraftPlayers.add("d3214311-7550-4c9c-a372-d9292c10b8a6"); // allout58
- jamcraftPlayers.add("a690119f-c4a2-4bd6-a99d-d63679abb328"); // ChewBaker
- jamcraftPlayers.add("de7c9903-51fa-4a24-88cd-48faf122ca36"); // domi1819
- jamcraftPlayers.add("70aeb298-3a7b-46da-a393-ab10df9359f2"); // founderio
- jamcraftPlayers.add("6fbe603c-14bf-4085-afdd-abe592c26e7c"); // GerbShert
- jamcraftPlayers.add("b0d21306-36bf-4d85-84df-a956d183c45a"); // isomgirls6
- jamcraftPlayers.add("1733a31f-01f9-4f4d-82aa-7de30ca810d3"); // TH3N00B
- jamcraftPlayers.add("4833eacf-1d94-49a7-9f89-4cf88d69dcf9"); // Joban
- jamcraftPlayers.add("718cf671-9084-4e78-b91f-033e80aa11bf"); // KJ4IPS
- jamcraftPlayers.add("bea5e0c4-85c4-454d-a081-e1eaae6895ee"); // Mitchellbrine
- jamcraftPlayers.add("7ecf3e2f-fedf-4f7e-8d24-6731d078db4f"); // MrComputerGhost
- jamcraftPlayers.add("1b11ad3a-f0ca-4695-a019-2d7e5d83a5fd"); // Resinresin
- jamcraftPlayers.add("3ec9ac58-2f1b-4d3f-b4eb-3b875da877ae"); // sci4me
- jamcraftPlayers.add("cf9fa23f-205e-4eed-aba3-9f2848cd6a4d"); // OnyxDarkKnight
- jamcraftPlayers.add("91880caa-b032-48e3-bfe8-c2c7ed31824e"); // theminecoder
- jamcraftPlayers.add("8d0b3804-f71c-4219-897b-8c315448ea7c"); // YSPilot
- jamcraftPlayers.add("bbb87dbe-690f-4205-bdc5-72ffb8ebc29d"); // direwolf20
+ jamcraftPlayers.add(
+ "d3214311-7550-4c9c-a372-d9292c10b8a6"); // allout58
+ jamcraftPlayers.add(
+ "a690119f-c4a2-4bd6-a99d-d63679abb328"); // ChewBaker
+ jamcraftPlayers.add(
+ "de7c9903-51fa-4a24-88cd-48faf122ca36"); // domi1819
+ jamcraftPlayers.add(
+ "70aeb298-3a7b-46da-a393-ab10df9359f2"); // founderio
+ jamcraftPlayers.add(
+ "6fbe603c-14bf-4085-afdd-abe592c26e7c"); // GerbShert
+ jamcraftPlayers.add(
+ "b0d21306-36bf-4d85-84df-a956d183c45a"); // isomgirls6
+ jamcraftPlayers.add(
+ "1733a31f-01f9-4f4d-82aa-7de30ca810d3"); // TH3N00B
+ jamcraftPlayers.add(
+ "4833eacf-1d94-49a7-9f89-4cf88d69dcf9"); // Joban
+ jamcraftPlayers.add(
+ "718cf671-9084-4e78-b91f-033e80aa11bf"); // KJ4IPS
+ jamcraftPlayers.add(
+ "bea5e0c4-85c4-454d-a081-e1eaae6895ee"); // Mitchellbrine
+ jamcraftPlayers.add(
+ "7ecf3e2f-fedf-4f7e-8d24-6731d078db4f"); // MrComputerGhost
+ jamcraftPlayers.add(
+ "1b11ad3a-f0ca-4695-a019-2d7e5d83a5fd"); // Resinresin
+ jamcraftPlayers.add(
+ "3ec9ac58-2f1b-4d3f-b4eb-3b875da877ae"); // sci4me
+ jamcraftPlayers.add(
+ "cf9fa23f-205e-4eed-aba3-9f2848cd6a4d"); // OnyxDarkKnight
+ jamcraftPlayers.add(
+ "91880caa-b032-48e3-bfe8-c2c7ed31824e"); // theminecoder
+ jamcraftPlayers.add(
+ "8d0b3804-f71c-4219-897b-8c315448ea7c"); // YSPilot
+ jamcraftPlayers.add(
+ "bbb87dbe-690f-4205-bdc5-72ffb8ebc29d"); // direwolf20
}
/**
* Adds a random amount of modifiers to a list
*
* @param randValue
- * maximum number of modifiers
+ * maximum number of modifiers
* @return a list containing the random modifiers
*/
- public static ArrayList<ItemStack> addRandomModifiers(int randValue) {
+ public static ArrayList<ItemStack> addRandomModifiers(
+ int randValue) {
ArrayList<ItemStack> list = new ArrayList<>();
for (int i = 0; i < 2 + randValue; i++) {
- ItemStack item =
- objects.get(new Random().nextInt(objects.size()));
+ ItemStack item = objects.get(new Random()
+ .nextInt(objects.size()));
item.stackSize = 1 + new Random().nextInt(2);
@@ -400,64 +438,55 @@ public class JewelrycraftUtil { */
public static void addMetals() {
/*
- int index = 0;
-
- while (index < OreDictionary.getOreNames().length) {
- Iterator<ItemStack> i = OreDictionary
- .getOres(OreDictionary.getOreNames()[index])
- .iterator();
-
- while (i.hasNext()) {
- ItemStack nextStack = i.next();
-
- String stackName = nextStack.getItem().getUnlocalizedName()
- .toLowerCase();
-
- if ((stackName.contains("ingot")
- || stackName.contains("alloy"))
- && !metal.contains(nextStack)) {
- metal.add(nextStack);
- }
-
- if (nextStack.getItem().getUnlocalizedName().toLowerCase()
- .contains("ore") && !ores.contains(nextStack)) {
- ItemStack ingot = FurnaceRecipes.smelting()
- .getSmeltingResult(nextStack);
-
- if (ingot != null && (ingot.getItem()
- .getUnlocalizedName().toLowerCase()
- .contains("ingot")
- || ingot.getItem().getUnlocalizedName()
- .toLowerCase().contains("alloy"))) {
- ores.add(nextStack);
-
- oreToIngot.put(nextStack, ingot);
-
- JewelrycraftMod.logger.info(nextStack + " Adding "
- + nextStack.getDisplayName()
- + " with damage value "
- + nextStack.getItemDamage() + " and with "
- + nextStack.stackSize + " in stack");
-
- JewelrycraftMod.logger.info(ingot
- + " Adding ingot " + ingot.getDisplayName()
- + " with damage value "
- + ingot.getItemDamage() + " and with "
- + ingot.stackSize + " in stack");
- }
- }
- }
-
- index++;
- }
- */
+ * int index = 0;
+ *
+ * while (index < OreDictionary.getOreNames().length) {
+ * Iterator<ItemStack> i = OreDictionary
+ * .getOres(OreDictionary.getOreNames()[index])
+ * .iterator();
+ *
+ * while (i.hasNext()) { ItemStack nextStack = i.next();
+ *
+ * String stackName =
+ * nextStack.getItem().getUnlocalizedName() .toLowerCase();
+ *
+ * if ((stackName.contains("ingot") ||
+ * stackName.contains("alloy")) &&
+ * !metal.contains(nextStack)) { metal.add(nextStack); }
+ *
+ * if
+ * (nextStack.getItem().getUnlocalizedName().toLowerCase()
+ * .contains("ore") && !ores.contains(nextStack)) {
+ * ItemStack ingot = FurnaceRecipes.smelting()
+ * .getSmeltingResult(nextStack);
+ *
+ * if (ingot != null && (ingot.getItem()
+ * .getUnlocalizedName().toLowerCase() .contains("ingot")
+ * || ingot.getItem().getUnlocalizedName()
+ * .toLowerCase().contains("alloy"))) {
+ * ores.add(nextStack);
+ *
+ * oreToIngot.put(nextStack, ingot);
+ *
+ * JewelrycraftMod.logger.info(nextStack + " Adding " +
+ * nextStack.getDisplayName() + " with damage value " +
+ * nextStack.getItemDamage() + " and with " +
+ * nextStack.stackSize + " in stack");
+ *
+ * JewelrycraftMod.logger.info(ingot + " Adding ingot " +
+ * ingot.getDisplayName() + " with damage value " +
+ * ingot.getItemDamage() + " and with " + ingot.stackSize +
+ * " in stack"); } } }
+ *
+ * index++; }
+ */
}
/**
* Checks to see if the specified item is a gem
*
* @param item
- * ItemStack containing the item
+ * ItemStack containing the item
* @return is the item a gem
*/
public static boolean isGem(ItemStack item) {
@@ -468,7 +497,7 @@ public class JewelrycraftUtil { * Checks to see if the specified item is a metal
*
* @param item
- * ItemStack containing the item
+ * ItemStack containing the item
* @return is the item a metal
*/
public static boolean isMetal(ItemStack item) {
@@ -479,7 +508,7 @@ public class JewelrycraftUtil { * Checks to see if the specified item is a piece of jewelry
*
* @param item
- * ItemStack containing the item
+ * ItemStack containing the item
* @return is the item a piece of jewelry
*/
public static boolean isJewelry(ItemStack item) {
@@ -491,7 +520,8 @@ public class JewelrycraftUtil { while (i.hasNext()) {
ItemStack temp = i.next();
if (temp.getItem() == item.getItem()
- && temp.getItemDamage() == item.getItemDamage()) {
+ && temp.getItemDamage() == item
+ .getItemDamage()) {
return true;
}
}
@@ -503,7 +533,7 @@ public class JewelrycraftUtil { * Checks to see if the specified item is an ore
*
* @param item
- * ItemStack containing the item
+ * ItemStack containing the item
* @return is the item an ore
*/
public static boolean isOre(ItemStack item) {
@@ -514,13 +544,14 @@ public class JewelrycraftUtil { * Gets the ingot from the ore
*
* @param ore
- * the ore
+ * the ore
* @return the ingot
*/
public static ItemStack getIngotFromOre(ItemStack ore) {
for (ItemStack ors : JewelrycraftUtil.oreToIngot.keySet())
if (ors.getItem().equals(ore.getItem())
- && ors.getItemDamage() == ore.getItemDamage()) {
+ && ors.getItemDamage() == ore
+ .getItemDamage()) {
return oreToIngot.get(ors);
}
@@ -528,16 +559,17 @@ public class JewelrycraftUtil { }
/**
- * This determines whether the player unlocked an achievement or not.
+ * This determines whether the player unlocked an achievement or
+ * not.
*
* @param player
- * The player to unlock the achievement
+ * The player to unlock the achievement
* @param achievement
- * The achievement to be unlocked
+ * The achievement to be unlocked
* @return True or False depending if the player did unlock the
* achievement or not
*/
- public static boolean AchievemtUnlocked(EntityPlayer player,
+ public static boolean isAchievementUnlocked(EntityPlayer player,
Achievement achievement) {
return ((EntityPlayerMP) player).func_147099_x()
.hasAchievementUnlocked(achievement);
diff --git a/src/main/java/darkknight/jewelrycraft/util/PlayerUtils.java b/src/main/java/darkknight/jewelrycraft/util/PlayerUtils.java index c981555..8a3abe3 100755 --- a/src/main/java/darkknight/jewelrycraft/util/PlayerUtils.java +++ b/src/main/java/darkknight/jewelrycraft/util/PlayerUtils.java @@ -12,24 +12,26 @@ public class PlayerUtils { * Returns the NBTTag of the player * * @param player - * the player + * the player * @param modName - * the mod name + * the mod name * @return appropriate NBTTag */ - public static NBTTagCompound - getModPlayerPersistTag(EntityPlayer player, String modName) { - if (player.worldObj.isRemote && ScreenHandler.tagCache != null) + public static NBTTagCompound getModPlayerPersistTag( + EntityPlayer player, String modName) { + if (player.worldObj.isRemote + && ScreenHandler.tagCache != null) return ScreenHandler.tagCache; NBTTagCompound tag = player.getEntityData(); NBTTagCompound persistTag = null; if (tag.hasKey(EntityPlayer.PERSISTED_NBT_TAG)) - persistTag = - tag.getCompoundTag(EntityPlayer.PERSISTED_NBT_TAG); + persistTag = tag.getCompoundTag( + EntityPlayer.PERSISTED_NBT_TAG); else { persistTag = new NBTTagCompound(); - tag.setTag(EntityPlayer.PERSISTED_NBT_TAG, persistTag); + tag.setTag(EntityPlayer.PERSISTED_NBT_TAG, + persistTag); } NBTTagCompound modTag = null; if (persistTag.hasKey(modName)) diff --git a/src/main/java/darkknight/jewelrycraft/util/Variables.java b/src/main/java/darkknight/jewelrycraft/util/Variables.java index 53ec9fd..8b853ef 100755 --- a/src/main/java/darkknight/jewelrycraft/util/Variables.java +++ b/src/main/java/darkknight/jewelrycraft/util/Variables.java @@ -3,34 +3,25 @@ package darkknight.jewelrycraft.util; import net.minecraft.util.ResourceLocation;
public class Variables {
- public static final int CURSE_POINTS_PER_LEVEL = 7000;
+ public static final int CURSE_POINTS_PER_LEVEL = 7000;
- public static final String MODID =
- "jewelrycraft2";
- public static final String MODNAME =
- "Jewelrycraft 2";
- public static final String VERSION =
- "1.1.4";
- public static final String PACKET_CHANNEL =
- "jewelrycraft2";
+ public static final String MODID = "jewelrycraft2";
+ public static final String MODNAME = "Jewelrycraft 2";
+ public static final String VERSION = "1.1.4";
+ public static final String PACKET_CHANNEL = "jewelrycraft2";
- public static final String CONFIG_GUI =
- "darkknight.jewelrycraft.config.ConfigGuiFactory";
- public static final String CLIENT_PROXY =
- "darkknight.jewelrycraft.proxy.ClientProxy";
- public static final String SERVER_PROXY =
- "darkknight.jewelrycraft.proxy.CommonProxy";
+ public static final String CONFIG_GUI = "darkknight.jewelrycraft.config.ConfigGuiFactory";
+ public static final String CLIENT_PROXY = "darkknight.jewelrycraft.proxy.ClientProxy";
+ public static final String SERVER_PROXY = "darkknight.jewelrycraft.proxy.CommonProxy";
- public static final ResourceLocation PEDESTAL_TEXTURE =
- new ResourceLocation(Variables.MODID,
- "textures/tileentities/BricksPedestal.png");
- public static final ResourceLocation SHADOW_HAND_TEXTURE =
- new ResourceLocation(Variables.MODID,
- "textures/tileentities/ShadowHand.png");
- public static final ResourceLocation VILLAGER_TEXTURE =
- new ResourceLocation(Variables.MODID,
- "textures/entities/jeweler.png");
- public static final ResourceLocation MISC_TEXTURE =
- new ResourceLocation(Variables.MODID,
- "textures/gui/hearts.png");
+ public static final ResourceLocation PEDESTAL_TEXTURE = new ResourceLocation(
+ Variables.MODID,
+ "textures/tileentities/BricksPedestal.png");
+ public static final ResourceLocation SHADOW_HAND_TEXTURE = new ResourceLocation(
+ Variables.MODID,
+ "textures/tileentities/ShadowHand.png");
+ public static final ResourceLocation VILLAGER_TEXTURE = new ResourceLocation(
+ Variables.MODID, "textures/entities/jeweler.png");
+ public static final ResourceLocation MISC_TEXTURE = new ResourceLocation(
+ Variables.MODID, "textures/gui/hearts.png");
}
diff --git a/src/main/java/darkknight/jewelrycraft/worldGen/ChestGeneration.java b/src/main/java/darkknight/jewelrycraft/worldGen/ChestGeneration.java index 9e6e667..c84696d 100755 --- a/src/main/java/darkknight/jewelrycraft/worldGen/ChestGeneration.java +++ b/src/main/java/darkknight/jewelrycraft/worldGen/ChestGeneration.java @@ -17,58 +17,69 @@ import net.minecraftforge.common.ChestGenHooks; *
*/
public class ChestGeneration {
- static Item[] jewelry = new Item[] { ItemList.ring,
- ItemList.necklace, ItemList.bracelet, ItemList.earrings };
+ static Item[] jewelry = new Item[] {
+ ItemList.ring, ItemList.necklace,
+ ItemList.bracelet, ItemList.earrings
+ };
- static Random random = new Random();
+ static Random random = new Random();
- public static void preInit(
- FMLPreInitializationEvent e) {
- addItemToDifferentPlaces(
- new WeightedRandomChestContent(
- new ItemStack(ItemList.thiefGloves), 1, 1, 2),
- true, true, false, false, true);
+ public static void preInit(FMLPreInitializationEvent e) {
+ addItemToDifferentPlaces(new WeightedRandomChestContent(
+ new ItemStack(ItemList.thiefGloves), 1, 1,
+ 2), true, true, false, false, true);
- addItemToDifferentPlaces(
- new WeightedRandomChestContent(
- new ItemStack(ItemList.guide), 1, 1, 7),
- true, true, true, true, true, false, true, true);
+ addItemToDifferentPlaces(new WeightedRandomChestContent(
+ new ItemStack(ItemList.guide), 1, 1, 7),
+ true, true, true, true, true, false, true,
+ true);
addVillageBlacksmithLoot(new WeightedRandomChestContent(
- new ItemStack(ItemList.shadowIngot), 1, 4, 5));
+ new ItemStack(ItemList.shadowIngot), 1, 4,
+ 5));
for (int i = 0; i < 16 && i % 3 == 0; i++)
- addItemToDifferentPlaces(new WeightedRandomChestContent(
- new ItemStack(BlockList.crystal, 1, i), 1, 3, 3), true,
- true, true, true);
+ addItemToDifferentPlaces(
+ new WeightedRandomChestContent(
+ new ItemStack(BlockList.crystal,
+ 1,
+ i),
+ 1, 3, 3),
+ true, true, true, true);
- ItemStack special = new ItemStack(jewelry[random.nextInt(4)]);
+ ItemStack special = new ItemStack(
+ jewelry[random.nextInt(4)]);
int randValue = random.nextInt(4);
if (JewelrycraftUtil.metal.size() > 0) {
JewelryNBT.addMetal(special, JewelrycraftUtil.metal
- .get(random.nextInt(JewelrycraftUtil.metal.size())));
+ .get(random.nextInt(
+ JewelrycraftUtil.metal
+ .size())));
}
if (JewelrycraftUtil.objects.size() > 0) {
- JewelryNBT.addModifiers(special,
- JewelrycraftUtil.addRandomModifiers(randValue));
+ JewelryNBT.addModifiers(special, JewelrycraftUtil
+ .addRandomModifiers(randValue));
}
if (JewelrycraftUtil.gem.size() > 0) {
JewelryNBT.addGem(special, JewelrycraftUtil.gem
- .get(random.nextInt(JewelrycraftUtil.gem.size())));
+ .get(random.nextInt(
+ JewelrycraftUtil.gem
+ .size())));
}
addItemToDifferentPlaces(
- new WeightedRandomChestContent(special, 1, 1, 1), true,
- true, true, true);
+ new WeightedRandomChestContent(special, 1,
+ 1, 1),
+ true, true, true, true);
}
/**
- * The booleans determine in which places should the items be added.
- * The order is like so:
+ * The booleans determine in which places should the items be
+ * added. The order is like so:
* <p>
* <ul>
* <li>Dungeon
@@ -83,7 +94,8 @@ public class ChestGeneration { * <p>
*/
public static void addItemToDifferentPlaces(
- WeightedRandomChestContent item, Boolean... options) {
+ WeightedRandomChestContent item,
+ Boolean... options) {
if (options.length > 0 && options[0])
addDungeonLoot(item);
if (options.length > 1 && options[1])
@@ -102,40 +114,54 @@ public class ChestGeneration { addStrongholdLibraryLoot(item);
}
- public static void addDungeonLoot(WeightedRandomChestContent item) {
+ public static void addDungeonLoot(
+ WeightedRandomChestContent item) {
ChestGenHooks.addItem(ChestGenHooks.DUNGEON_CHEST, item);
}
- public static void addStrongholdLoot(WeightedRandomChestContent item) {
- ChestGenHooks.addItem(ChestGenHooks.STRONGHOLD_CORRIDOR, item);
- ChestGenHooks.addItem(ChestGenHooks.STRONGHOLD_CROSSING, item);
+ public static void addStrongholdLoot(
+ WeightedRandomChestContent item) {
+ ChestGenHooks.addItem(ChestGenHooks.STRONGHOLD_CORRIDOR,
+ item);
+ ChestGenHooks.addItem(ChestGenHooks.STRONGHOLD_CROSSING,
+ item);
}
- public static void addPyramidLoot(WeightedRandomChestContent item) {
- ChestGenHooks.addItem(ChestGenHooks.PYRAMID_DESERT_CHEST, item);
- ChestGenHooks.addItem(ChestGenHooks.PYRAMID_JUNGLE_CHEST, item);
+ public static void addPyramidLoot(
+ WeightedRandomChestContent item) {
+ ChestGenHooks.addItem(ChestGenHooks.PYRAMID_DESERT_CHEST,
+ item);
+ ChestGenHooks.addItem(ChestGenHooks.PYRAMID_JUNGLE_CHEST,
+ item);
}
- public static void addMineshaftLoot(WeightedRandomChestContent item) {
- ChestGenHooks.addItem(ChestGenHooks.MINESHAFT_CORRIDOR, item);
+ public static void addMineshaftLoot(
+ WeightedRandomChestContent item) {
+ ChestGenHooks.addItem(ChestGenHooks.MINESHAFT_CORRIDOR,
+ item);
}
- public static void
- addVillageBlacksmithLoot(WeightedRandomChestContent item) {
- ChestGenHooks.addItem(ChestGenHooks.VILLAGE_BLACKSMITH, item);
+ public static void addVillageBlacksmithLoot(
+ WeightedRandomChestContent item) {
+ ChestGenHooks.addItem(ChestGenHooks.VILLAGE_BLACKSMITH,
+ item);
}
- public static void addDispenserLoot(WeightedRandomChestContent item) {
- ChestGenHooks.addItem(ChestGenHooks.PYRAMID_JUNGLE_DISPENSER,
+ public static void addDispenserLoot(
+ WeightedRandomChestContent item) {
+ ChestGenHooks.addItem(
+ ChestGenHooks.PYRAMID_JUNGLE_DISPENSER,
item);
}
- public static void addBonusChestLoot(WeightedRandomChestContent item) {
+ public static void addBonusChestLoot(
+ WeightedRandomChestContent item) {
ChestGenHooks.addItem(ChestGenHooks.BONUS_CHEST, item);
}
- public static void
- addStrongholdLibraryLoot(WeightedRandomChestContent item) {
- ChestGenHooks.addItem(ChestGenHooks.STRONGHOLD_LIBRARY, item);
+ public static void addStrongholdLibraryLoot(
+ WeightedRandomChestContent item) {
+ ChestGenHooks.addItem(ChestGenHooks.STRONGHOLD_LIBRARY,
+ item);
}
}
diff --git a/src/main/java/darkknight/jewelrycraft/worldGen/Generation.java b/src/main/java/darkknight/jewelrycraft/worldGen/Generation.java index 8419533..cc7790b 100755 --- a/src/main/java/darkknight/jewelrycraft/worldGen/Generation.java +++ b/src/main/java/darkknight/jewelrycraft/worldGen/Generation.java @@ -26,21 +26,26 @@ public class Generation implements IWorldGenerator { IChunkProvider chunkProvider) {
switch (world.provider.dimensionId) {
case -1:
- generateNether(world, random, chunkX << 4, chunkZ << 4);
+ generateNether(world, random, chunkX << 4,
+ chunkZ << 4);
break;
case 0:
- generateSurface(world, random, chunkX << 4, chunkZ << 4);
+ generateSurface(world, random, chunkX << 4,
+ chunkZ << 4);
break;
case 1:
- generateEnd(world, random, chunkX << 4, chunkZ << 4);
+ generateEnd(world, random, chunkX << 4,
+ chunkZ << 4);
break;
default:
- generateSurface(world, random, chunkX << 4, chunkZ << 4);
+ generateSurface(world, random, chunkX << 4,
+ chunkZ << 4);
break;
}
}
- private void generateEnd(World world, Random random, int i, int j) {
+ private void generateEnd(World world, Random random, int i,
+ int j) {
}
private void generateSurface(World world, Random random, int i,
@@ -49,29 +54,44 @@ public class Generation implements IWorldGenerator { if (!world.getWorldInfo().getTerrainType()
.equals(WorldType.FLAT)) {
if (ConfigHandler.ORE_GEN)
- generateShadowOre(world, random, i, j);
+ generateShadowOre(world, random, i,
+ j);
if (ConfigHandler.CRYSTAL_GEN)
- generateCrystals(world, random, i, j);
+ generateCrystals(world, random, i,
+ j);
try {
- for (Field f : this.getClass().getDeclaredFields()) {
+ for (Field f : this.getClass()
+ .getDeclaredFields()) {
Object obj = f.get(null);
if (obj instanceof WorldGenStructure
&& ConfigHandler.STRUCTURES[((WorldGenStructure) obj)
- .structureNo() - 1])
- if (((WorldGenStructure) obj).isUnderground())
+ .structureNo()
+ - 1])
+ if (((WorldGenStructure) obj)
+ .isUnderground())
generateStructureUnderground(
- (WorldGenStructure) obj, world,
- random, i, j,
+ (WorldGenStructure) obj,
+ world,
+ random,
+ i,
+ j,
ConfigHandler.STRUCTURES_SPAWN_CHANCE[((WorldGenStructure) obj)
- .structureNo() - 1],
- false, true);
+ .structureNo()
+ - 1],
+ false,
+ true);
else
generateStructureOverground(
- (WorldGenStructure) obj, world,
- random, i, j,
+ (WorldGenStructure) obj,
+ world,
+ random,
+ i,
+ j,
ConfigHandler.STRUCTURES_SPAWN_CHANCE[((WorldGenStructure) obj)
- .structureNo() - 1],
- false, true);
+ .structureNo()
+ - 1],
+ false,
+ true);
}
} catch (IllegalAccessException e) {
throw new RuntimeException(e);
@@ -80,7 +100,8 @@ public class Generation implements IWorldGenerator { }
}
- private void generateNether(World world, Random random, int i, int j) {
+ private void generateNether(World world, Random random, int i,
+ int j) {
}
private void generateShadowOre(World world, Random random, int i,
@@ -90,12 +111,16 @@ public class Generation implements IWorldGenerator { int y = 5 + random.nextInt(4);
int z = j + random.nextInt(16);
if (world.getBlock(x, y, z) == Blocks.stone)
- world.setBlock(x, y, z, BlockList.shadowOre);
- int randX = random.nextInt(2), randY = random.nextInt(1),
+ world.setBlock(x, y, z,
+ BlockList.shadowOre);
+ int randX = random.nextInt(2),
+ randY = random.nextInt(1),
randZ = random.nextInt(2);
- if (random.nextInt(3) == 0 && world.getBlock(x + randX,
- y + randY, z + randZ) == Blocks.stone)
- world.setBlock(x + randX, y + randY, z + randZ,
+ if (random.nextInt(3) == 0 && world.getBlock(
+ x + randX, y + randY,
+ z + randZ) == Blocks.stone)
+ world.setBlock(x + randX, y + randY,
+ z + randZ,
BlockList.shadowOre);
}
}
@@ -110,18 +135,26 @@ public class Generation implements IWorldGenerator { int randX = random.nextInt(4);
int randY = random.nextInt(2);
int randZ = random.nextInt(4);
- if (world.getBlock(x + randX, y + randY - 1,
+ if (world.getBlock(x + randX,
+ y + randY - 1,
z + randZ) == Blocks.stone
- && world.getBlock(x + randX, y + randY,
+ && world.getBlock(
+ x + randX,
+ y + randY,
z + randZ) == Blocks.air)
- world.setBlock(x + randX, y + randY, z + randZ,
- BlockList.crystal, random.nextInt(16), 2);
+ world.setBlock(x + randX,
+ y + randY,
+ z + randZ,
+ BlockList.crystal,
+ random.nextInt(16),
+ 2);
}
}
}
- private void generateStructureUnderground(WorldGenStructure structure,
- World world, Random random, int i, int j, int maxAttempts,
+ private void generateStructureUnderground(
+ WorldGenStructure structure, World world,
+ Random random, int i, int j, int maxAttempts,
boolean noOfAttempts, boolean chanceOfSpawning) {
BiomeGenBase biomeBase = world.getBiomeGenForCoords(i, j);
if (noOfAttempts) {
@@ -129,57 +162,86 @@ public class Generation implements IWorldGenerator { int x = i + random.nextInt(16);
int y = random.nextInt(64);
int z = j + random.nextInt(16);
- if (world.getBlock(x, y, z) == Blocks.stone)
- structure.generate(world, biomeBase, random, x, y, z);
+ if (world.getBlock(x, y,
+ z) == Blocks.stone)
+ structure.generate(world,
+ biomeBase, random,
+ x, y, z);
}
} else if (chanceOfSpawning) {
if (random.nextInt(maxAttempts) == 0) {
int x = i + random.nextInt(16);
int y = random.nextInt(64);
int z = j + random.nextInt(16);
- if (world.getBlock(x, y, z) == Blocks.stone)
- structure.generate(world, biomeBase, random, x, y, z);
+ if (world.getBlock(x, y,
+ z) == Blocks.stone)
+ structure.generate(world,
+ biomeBase, random,
+ x, y, z);
}
}
}
- private void generateStructureOverground(WorldGenStructure structure,
- World world, Random random, int i, int j, int maxAttempts,
+ private void generateStructureOverground(
+ WorldGenStructure structure, World world,
+ Random random, int i, int j, int maxAttempts,
boolean noOfAttempts, boolean chanceOfSpawning) {
BiomeGenBase biomeBase = world.getBiomeGenForCoords(i, j);
if (noOfAttempts) {
for (int k = 0; k < maxAttempts; k++) {
int x = i + random.nextInt(16);
- int y = (world.getChunkHeightMapMinimum(i, j) > 0
- ? world.getChunkHeightMapMinimum(i, j)
- : world.getChunkFromChunkCoords(i,
- j).heightMapMinimum - 16)
+ int y = (world.getChunkHeightMapMinimum(i,
+ j) > 0 ? world.getChunkHeightMapMinimum(
+ i, j)
+ : world.getChunkFromChunkCoords(
+ i,
+ j).heightMapMinimum
+ - 16)
+ random.nextInt(4);
int z = j + random.nextInt(16);
if (world.getBlock(x, y, z) == Blocks.air
- && (world.getBlock(x, y - 1, z) == Blocks.stone
- || world.getBlock(x, y - 1,
+ && (world.getBlock(x,
+ y - 1,
+ z) == Blocks.stone
+ || world.getBlock(
+ x,
+ y - 1,
z) == Blocks.sand
- || world.getBlock(x, y - 1,
+ || world.getBlock(
+ x,
+ y - 1,
z) == Blocks.grass))
- structure.generate(world, biomeBase, random, x, y, z);
+ structure.generate(world,
+ biomeBase, random,
+ x, y, z);
}
} else if (chanceOfSpawning) {
if (random.nextInt(maxAttempts) == 0) {
int x = i + random.nextInt(16);
- int y = (world.getChunkHeightMapMinimum(i, j) > 0
- ? world.getChunkHeightMapMinimum(i, j)
- : world.getChunkFromChunkCoords(i,
- j).heightMapMinimum - 16)
+ int y = (world.getChunkHeightMapMinimum(i,
+ j) > 0 ? world.getChunkHeightMapMinimum(
+ i, j)
+ : world.getChunkFromChunkCoords(
+ i,
+ j).heightMapMinimum
+ - 16)
+ random.nextInt(4);
int z = j + random.nextInt(16);
if (world.getBlock(x, y, z) == Blocks.air
- && (world.getBlock(x, y - 1, z) == Blocks.stone
- || world.getBlock(x, y - 1,
+ && (world.getBlock(x,
+ y - 1,
+ z) == Blocks.stone
+ || world.getBlock(
+ x,
+ y - 1,
z) == Blocks.sand
- || world.getBlock(x, y - 1,
+ || world.getBlock(
+ x,
+ y - 1,
z) == Blocks.grass)) {
- structure.generate(world, biomeBase, random, x, y, z);
+ structure.generate(world,
+ biomeBase, random,
+ x, y, z);
System.out.println(x + " " + z);
}
}
diff --git a/src/main/java/darkknight/jewelrycraft/worldGen/WorldGenStructure.java b/src/main/java/darkknight/jewelrycraft/worldGen/WorldGenStructure.java index 9b99e5a..bc4f508 100755 --- a/src/main/java/darkknight/jewelrycraft/worldGen/WorldGenStructure.java +++ b/src/main/java/darkknight/jewelrycraft/worldGen/WorldGenStructure.java @@ -13,8 +13,8 @@ import net.minecraft.world.gen.feature.WorldGenerator; * @author Sorin
*/
public class WorldGenStructure extends WorldGenerator {
- public boolean generate(World world, BiomeGenBase biome, Random rand,
- int x, int y, int z) {
+ public boolean generate(World world, BiomeGenBase biome,
+ Random rand, int x, int y, int z) {
return false;
}
diff --git a/src/main/java/darkknight/jewelrycraft/worldGen/WorldGenStructure1.java b/src/main/java/darkknight/jewelrycraft/worldGen/WorldGenStructure1.java index 6ec6b81..9e86822 100755 --- a/src/main/java/darkknight/jewelrycraft/worldGen/WorldGenStructure1.java +++ b/src/main/java/darkknight/jewelrycraft/worldGen/WorldGenStructure1.java @@ -21,30 +21,34 @@ import net.minecraft.world.biome.BiomeGenBase; * @author Sorin
*/
public class WorldGenStructure1 extends WorldGenStructure {
- public static final WeightedRandomItem[] items =
- new WeightedRandomItem[] {
- new WeightedRandomItem(
- new ItemStack(ItemList.thiefGloves), 10),
- new WeightedRandomItem(
- new ItemStack(Items.golden_apple), 8),
- new WeightedRandomItem(
- new ItemStack(Items.golden_apple, 1, 1), 1),
- new WeightedRandomItem(new ItemStack(ItemList.guide),
- 20),
- new WeightedRandomItem(
- new ItemStack(ItemList.shadowIngot), 25),
- new WeightedRandomItem(
- new ItemStack(BlockList.shadowEye), 2),
- new WeightedRandomItem(
- new ItemStack(Items.nether_star), 1),
- new WeightedRandomItem(
- new ItemStack(BlockList.shadowBlock), 2),
- new WeightedRandomItem(
- new ItemStack(BlockList.crystal), 16, 20) };
+ public static final WeightedRandomItem[] items = new WeightedRandomItem[] {
+ new WeightedRandomItem(new ItemStack(
+ ItemList.thiefGloves), 10),
+ new WeightedRandomItem(
+ new ItemStack(Items.golden_apple),
+ 8),
+ new WeightedRandomItem(new ItemStack(
+ Items.golden_apple, 1, 1), 1),
+ new WeightedRandomItem(
+ new ItemStack(ItemList.guide), 20),
+ new WeightedRandomItem(new ItemStack(
+ ItemList.shadowIngot), 25),
+ new WeightedRandomItem(
+ new ItemStack(BlockList.shadowEye),
+ 2),
+ new WeightedRandomItem(
+ new ItemStack(Items.nether_star),
+ 1),
+ new WeightedRandomItem(new ItemStack(
+ BlockList.shadowBlock), 2),
+ new WeightedRandomItem(
+ new ItemStack(BlockList.crystal),
+ 16, 20)
+ };
@Override
- public boolean generate(World world, BiomeGenBase biome, Random rand,
- int x, int y, int z) {
+ public boolean generate(World world, BiomeGenBase biome,
+ Random rand, int x, int y, int z) {
Block block = Blocks.stonebrick;
int metadata = 0, slabMeta = 5;
if (biome == BiomeGenBase.desert
@@ -56,23 +60,30 @@ public class WorldGenStructure1 extends WorldGenStructure { for (int i = -2; i <= 2; i++)
for (int j = -1; j <= 4; j++)
for (int k = -2; k <= 2; k++)
- world.setBlock(x + i, y + j, z + k, Blocks.air);
+ world.setBlock(x + i, y + j, z + k,
+ Blocks.air);
for (int i = -2; i <= 2; i++)
for (int k = -2; k <= 2; k++) {
- world.setBlock(x + i, y - 1, z + k, block, metadata, 2);
- if (i % 2 == 0 && k % 2 == 0 && i != 0 && k != 0)
- world.setBlock(x + i, y, z + k, BlockList.crystal);
+ world.setBlock(x + i, y - 1, z + k, block,
+ metadata, 2);
+ if (i % 2 == 0 && k % 2 == 0 && i != 0
+ && k != 0)
+ world.setBlock(x + i, y, z + k,
+ BlockList.crystal);
}
for (int i = -1; i <= 1; i++)
for (int k = -1; k <= 1; k++)
- world.setBlock(x + i, y, z + k, Blocks.stone_slab,
+ world.setBlock(x + i, y, z + k,
+ Blocks.stone_slab,
slabMeta, 2);
world.setBlock(x, y, z, block, metadata, 2);
world.setBlock(x, y + 1, z, BlockList.handPedestal, 6, 2);
- TileEntityHandPedestal pedestal =
- (TileEntityHandPedestal) world.getTileEntity(x, y + 1, z);
- pedestal.setHeldItemStack(((WeightedRandomItem) WeightedRandom
- .getRandomItem(rand, items)).getItem(rand));
+ TileEntityHandPedestal pedestal = (TileEntityHandPedestal) world
+ .getTileEntity(x, y + 1, z);
+ pedestal.setHeldItemStack(
+ ((WeightedRandomItem) WeightedRandom
+ .getRandomItem(rand,
+ items)).getItem(rand));
return true;
}
diff --git a/src/main/java/darkknight/jewelrycraft/worldGen/WorldGenStructure2.java b/src/main/java/darkknight/jewelrycraft/worldGen/WorldGenStructure2.java index 0f285b3..b61b9cd 100755 --- a/src/main/java/darkknight/jewelrycraft/worldGen/WorldGenStructure2.java +++ b/src/main/java/darkknight/jewelrycraft/worldGen/WorldGenStructure2.java @@ -18,8 +18,8 @@ import net.minecraft.world.biome.BiomeGenBase; */
public class WorldGenStructure2 extends WorldGenStructure {
@Override
- public boolean generate(World world, BiomeGenBase biome, Random rand,
- int x, int y, int z) {
+ public boolean generate(World world, BiomeGenBase biome,
+ Random rand, int x, int y, int z) {
Block block = Blocks.stonebrick;
Block stair = Blocks.stone_brick_stairs;
int metadata = 0;
@@ -31,29 +31,40 @@ public class WorldGenStructure2 extends WorldGenStructure { }
for (int i = -1; i <= 1; i++)
for (int k = -1; k <= 1; k++)
- world.setBlock(x + i, y, z + k, Blocks.air);
+ world.setBlock(x + i, y, z + k,
+ Blocks.air);
for (int i = -1; i <= 1; i++)
for (int k = -1; k <= 1; k++)
- world.setBlock(x + i, y - 1, z + k, block, metadata, 2);
+ world.setBlock(x + i, y - 1, z + k, block,
+ metadata, 2);
for (int i = -1; i <= 1; i++)
for (int k = -1; k <= 1; k++)
world.setBlock(x + i, y, z + k, stair);
for (int i = -1; i <= 1; i++)
for (int k = -1; k <= 1; k++)
- world.setBlockMetadataWithNotify(x + i, y, z + k,
- (k == -1) ? 3 : (k == 0) ? (i == 1) ? 0 : 1 : 2,
+ world.setBlockMetadataWithNotify(x + i, y,
+ z + k,
+ (k == -1) ? 3
+ : (k == 0) ? (i == 1)
+ ? 0
+ : 1
+ : 2,
2);
world.setBlock(x, y, z, Blocks.air);
ItemStack stack = new ItemStack(ItemList.bucket);
- JewelryNBT.addMetal(stack, JewelrycraftUtil.metal
- .get(rand.nextInt(JewelrycraftUtil.metal.size())));
+ JewelryNBT.addMetal(stack, JewelrycraftUtil.metal.get(rand
+ .nextInt(JewelrycraftUtil.metal.size())));
if (stack != null && JewelryNBT.ingot(stack) != null) {
if (!world.isRemote)
world.func_147480_a(x, y, z, true);
- world.setBlock(x, y, z, BlockList.moltenMetal, 0, 3);
- if (BlockMoltenMetal.getTileEntity(world, x, y, z) != null)
- BlockMoltenMetal.getTileEntity(world, x, y, z)
- .setMetal(JewelryNBT.ingot(stack));
+ world.setBlock(x, y, z, BlockList.moltenMetal, 0,
+ 3);
+ if (BlockMoltenMetal.getTileEntity(world, x, y,
+ z) != null)
+ BlockMoltenMetal.getTileEntity(world, x, y,
+ z)
+ .setMetal(JewelryNBT.ingot(
+ stack));
}
return true;
}
diff --git a/src/main/java/darkknight/jewelrycraft/worldGen/WorldGenStructure3.java b/src/main/java/darkknight/jewelrycraft/worldGen/WorldGenStructure3.java index f5347ea..5eafd03 100755 --- a/src/main/java/darkknight/jewelrycraft/worldGen/WorldGenStructure3.java +++ b/src/main/java/darkknight/jewelrycraft/worldGen/WorldGenStructure3.java @@ -17,8 +17,8 @@ import net.minecraftforge.common.DungeonHooks; */
public class WorldGenStructure3 extends WorldGenStructure {
@Override
- public boolean generate(World world, BiomeGenBase biome, Random rand,
- int x, int y, int z) {
+ public boolean generate(World world, BiomeGenBase biome,
+ Random rand, int x, int y, int z) {
Block slab = Blocks.stone_slab;
Block stair = Blocks.stone_brick_stairs;
int slabMeta = 13;
@@ -30,25 +30,37 @@ public class WorldGenStructure3 extends WorldGenStructure { for (int i = -1; i <= 1; i++)
for (int j = -1; j <= 2; j++)
for (int k = -1; k <= 1; k++)
- world.setBlock(x + i, y + j, z + k, Blocks.air);
+ world.setBlock(x + i, y + j, z + k,
+ Blocks.air);
for (int i = -1; i <= 1; i++)
for (int k = -1; k <= 1; k++)
- world.setBlock(x + i, y - 1, z + k, slab, slabMeta, 1);
+ world.setBlock(x + i, y - 1, z + k, slab,
+ slabMeta, 1);
for (int i = -1; i <= 1; i++)
for (int k = -1; k <= 1; k++)
world.setBlock(x + i, y, z + k, stair);
for (int i = -1; i <= 1; i++)
for (int k = -1; k <= 1; k++)
- world.setBlockMetadataWithNotify(x + i, y, z + k,
- (k == -1) ? 3 : (k == 0) ? (i == 1) ? 0 : 1 : 2,
+ world.setBlockMetadataWithNotify(x + i, y,
+ z + k,
+ (k == -1) ? 3
+ : (k == 0) ? (i == 1)
+ ? 0
+ : 1
+ : 2,
2);
for (int i = -1; i <= 1; i++)
for (int k = -1; k <= 1; k++)
world.setBlock(x + i, y + 1, z + k, stair);
for (int i = -1; i <= 1; i++)
for (int k = -1; k <= 1; k++)
- world.setBlockMetadataWithNotify(x + i, y + 1, z + k,
- (k == -1) ? 7 : (k == 0) ? (i == 1) ? 4 : 5 : 6,
+ world.setBlockMetadataWithNotify(x + i,
+ y + 1, z + k,
+ (k == -1) ? 7
+ : (k == 0) ? (i == 1)
+ ? 4
+ : 5
+ : 6,
2);
slabMeta = 5;
if (biome == BiomeGenBase.desert
@@ -56,20 +68,25 @@ public class WorldGenStructure3 extends WorldGenStructure { slabMeta = 1;
for (int i = -1; i <= 1; i++)
for (int k = -1; k <= 1; k++)
- world.setBlock(x + i, y + 2, z + k, slab, slabMeta, 2);
+ world.setBlock(x + i, y + 2, z + k, slab,
+ slabMeta, 2);
world.setBlock(x, y, z, Blocks.mob_spawner);
world.setBlock(x, y + 1, z, Blocks.mob_spawner);
for (int l = 0; l < 2; l++) {
- TileEntityMobSpawner tileentitymobspawner =
- (TileEntityMobSpawner) world.getTileEntity(x, y + l,
- z);
+ TileEntityMobSpawner tileentitymobspawner = (TileEntityMobSpawner) world
+ .getTileEntity(x, y + l, z);
if (tileentitymobspawner != null)
- tileentitymobspawner.func_145881_a().setEntityName(
- DungeonHooks.getRandomDungeonMob(rand));
+ tileentitymobspawner.func_145881_a()
+ .setEntityName(DungeonHooks
+ .getRandomDungeonMob(
+ rand));
else
- System.err
- .println("Failed to fetch mob spawner entity at ("
- + x + ", " + (y + l) + ", " + z + ")");
+ System.err.println(
+ "Failed to fetch mob spawner entity at ("
+ + x + ", "
+ + (y + l)
+ + ", " + z
+ + ")");
}
return true;
}
diff --git a/src/main/java/darkknight/jewelrycraft/worldGen/WorldGenStructure4.java b/src/main/java/darkknight/jewelrycraft/worldGen/WorldGenStructure4.java index a791914..2dc2544 100755 --- a/src/main/java/darkknight/jewelrycraft/worldGen/WorldGenStructure4.java +++ b/src/main/java/darkknight/jewelrycraft/worldGen/WorldGenStructure4.java @@ -16,8 +16,8 @@ import net.minecraft.world.biome.BiomeGenBase; */
public class WorldGenStructure4 extends WorldGenStructure {
@Override
- public boolean generate(World world, BiomeGenBase biome, Random rand,
- int x, int y, int z) {
+ public boolean generate(World world, BiomeGenBase biome,
+ Random rand, int x, int y, int z) {
Block stair = Blocks.stone_brick_stairs;
Block block = Blocks.stonebrick;
int metadata = 0, slabMeta = 5;
@@ -31,10 +31,12 @@ public class WorldGenStructure4 extends WorldGenStructure { for (int i = -1; i <= 1; i++)
for (int j = 0; j <= 3; j++)
for (int k = -1; k <= 1; k++)
- world.setBlock(x + i, y + j, z + k, Blocks.air);
+ world.setBlock(x + i, y + j, z + k,
+ Blocks.air);
for (int i = -1; i <= 1; i++)
for (int k = -1; k <= 1; k++)
- world.setBlock(x + i, y, z + k, Blocks.stone_slab,
+ world.setBlock(x + i, y, z + k,
+ Blocks.stone_slab,
slabMeta, 2);
world.setBlock(x, y, z, block, metadata, 2);
world.setBlock(x, y, z - 1, stair, 3, 1);
@@ -53,7 +55,8 @@ public class WorldGenStructure4 extends WorldGenStructure { for (int i = -1; i <= 1; i++)
for (int k = -1; k <= 1; k++)
if (i == 0 || k == 0)
- world.setBlock(x + i, y + 2, z + k, Blocks.stone_slab,
+ world.setBlock(x + i, y + 2, z + k,
+ Blocks.stone_slab,
slabMeta, 2);
world.setBlock(x, y + 2, z, block, metadata, 2);
world.setBlock(x, y + 3, z, BlockList.crystal);
diff --git a/src/main/java/darkknight/jewelrycraft/worldGen/WorldGenStructure5.java b/src/main/java/darkknight/jewelrycraft/worldGen/WorldGenStructure5.java index ee74bdb..16782af 100755 --- a/src/main/java/darkknight/jewelrycraft/worldGen/WorldGenStructure5.java +++ b/src/main/java/darkknight/jewelrycraft/worldGen/WorldGenStructure5.java @@ -21,8 +21,8 @@ import net.minecraft.world.biome.BiomeGenBase; */
public class WorldGenStructure5 extends WorldGenStructure {
@Override
- public boolean generate(World world, BiomeGenBase biome, Random rand,
- int x, int y, int z) {
+ public boolean generate(World world, BiomeGenBase biome,
+ Random rand, int x, int y, int z) {
Block slab = Blocks.stone_slab;
Block stair = Blocks.stone_brick_stairs;
Block block = Blocks.stonebrick;
@@ -37,24 +37,30 @@ public class WorldGenStructure5 extends WorldGenStructure { for (int i = -2; i <= 2; i++)
for (int j = 0; j <= 3; j++)
for (int k = -3; k <= -1; k++)
- world.setBlock(x + i, y + j, z + k, Blocks.air);
+ world.setBlock(x + i, y + j, z + k,
+ Blocks.air);
for (int i = -5; i <= -3; i++)
for (int k = -3; k <= 2; k++)
- world.setBlock(x + i, y, z + k, Blocks.air);
+ world.setBlock(x + i, y, z + k,
+ Blocks.air);
for (int i = -2; i <= 2; i++)
for (int k = -3; k <= -1; k++)
- world.setBlock(x + i, y, z + k, block, metadata, 2);
+ world.setBlock(x + i, y, z + k, block,
+ metadata, 2);
for (int i = 1; i <= 2; i++)
for (int k = -3; k <= -1; k++)
- world.setBlock(x + i, y + 1, z + k, block, metadata, 2);
+ world.setBlock(x + i, y + 1, z + k, block,
+ metadata, 2);
for (int i = -5; i <= -3; i++)
for (int k = -3; k <= 2; k++)
- world.setBlock(x + i, y - 1, z + k, block, metadata, 2);
+ world.setBlock(x + i, y - 1, z + k, block,
+ metadata, 2);
for (int i = -5; i <= -3; i++)
for (int k = -3; k <= 2; k++)
if ((i != -4 || k <= -3 || k >= 2)
&& !(i == -3 && k == -2))
- world.setBlock(x + i, y, z + k, slab, slabMeta, 2);
+ world.setBlock(x + i, y, z + k,
+ slab, slabMeta, 2);
world.setBlock(x - 3, y, z - 1, stair, 0, 2);
world.setBlock(x - 3, y, z - 3, stair, 0, 2);
world.setBlock(x - 2, y + 1, z - 3, slab, slabMeta, 2);
@@ -66,23 +72,31 @@ public class WorldGenStructure5 extends WorldGenStructure { world.setBlock(x + 1, y + 2, z - 3, slab, slabMeta, 2);
world.setBlock(x + 1, y + 2, z - 1, slab, slabMeta, 2);
for (int k = -3; k <= -1; k++)
- world.setBlock(x + 2, y + 2, z + k, block, metadata, 2);
+ world.setBlock(x + 2, y + 2, z + k, block,
+ metadata, 2);
if (rand.nextInt(5) == 0) {
ItemStack stack = new ItemStack(ItemList.bucket);
- JewelryNBT.addMetal(stack, new ItemStack(Items.gold_ingot));
- if (stack != null && JewelryNBT.ingot(stack) != null) {
+ JewelryNBT.addMetal(stack,
+ new ItemStack(Items.gold_ingot));
+ if (stack != null && JewelryNBT
+ .ingot(stack) != null) {
if (!world.isRemote)
world.func_147480_a(x, y, z, true);
- world.setBlock(x + 1, y + 2, z - 2, BlockList.moltenMetal,
- 0, 3);
- if (BlockMoltenMetal.getTileEntity(world, x + 1, y + 2,
+ world.setBlock(x + 1, y + 2, z - 2,
+ BlockList.moltenMetal, 0,
+ 3);
+ if (BlockMoltenMetal.getTileEntity(world,
+ x + 1, y + 2,
z - 2) != null)
- BlockMoltenMetal
- .getTileEntity(world, x + 1, y + 2, z - 2)
- .setMetal(JewelryNBT.ingot(stack));
+ BlockMoltenMetal.getTileEntity(
+ world, x + 1,
+ y + 2, z - 2)
+ .setMetal(JewelryNBT
+ .ingot(stack));
}
} else
- world.setBlock(x + 1, y + 2, z - 2, Blocks.water, 0, 3);
+ world.setBlock(x + 1, y + 2, z - 2, Blocks.water,
+ 0, 3);
return true;
}
diff --git a/src/main/java/darkknight/jewelrycraft/worldGen/WorldGenStructure6.java b/src/main/java/darkknight/jewelrycraft/worldGen/WorldGenStructure6.java index 40fca43..ec85f35 100755 --- a/src/main/java/darkknight/jewelrycraft/worldGen/WorldGenStructure6.java +++ b/src/main/java/darkknight/jewelrycraft/worldGen/WorldGenStructure6.java @@ -29,14 +29,15 @@ import net.minecraft.world.biome.BiomeGenBase; */
public class WorldGenStructure6 extends WorldGenStructure {
@Override
- public boolean generate(World world, BiomeGenBase biome, Random rand,
- int x, int y, int z) {
+ public boolean generate(World world, BiomeGenBase biome,
+ Random rand, int x, int y, int z) {
int randBlock, randBlockMeta;
Block block;
for (int i = -2; i <= 1; i++)
for (int j = -1; j <= 1; j++)
for (int k = -2; k <= 1; k++)
- world.setBlock(x + i, y + j, z + k, Blocks.air);
+ world.setBlock(x + i, y + j, z + k,
+ Blocks.air);
for (int i = -2; i <= 1; i++)
for (int k = -2; k <= 1; k++) {
randBlock = rand.nextInt(4);
@@ -58,58 +59,80 @@ public class WorldGenStructure6 extends WorldGenStructure { randBlockMeta = 0;
break;
}
- world.setBlock(x + i, y - 1, z + k, block, randBlockMeta,
- 2);
+ world.setBlock(x + i, y - 1, z + k, block,
+ randBlockMeta, 2);
}
int crystalCol = rand.nextInt(15);
world.setBlock(x - 2, y, z - 2, BlockList.crystal, 0, 2);
- world.setBlock(x - 2, y, z + 1, BlockList.crystal, 1 + crystalCol,
- 2);
- world.setBlock(x + 1, y, z - 2, BlockList.crystal, 1 + crystalCol,
- 2);
+ world.setBlock(x - 2, y, z + 1, BlockList.crystal,
+ 1 + crystalCol, 2);
+ world.setBlock(x + 1, y, z - 2, BlockList.crystal,
+ 1 + crystalCol, 2);
world.setBlock(x + 1, y, z + 1, BlockList.crystal, 0, 2);
world.setBlock(x - 1, y, z - 1, Blocks.skull, 1, 2);
- TileEntity tileentity = world.getTileEntity(x - 1, y, z - 1);
- if (tileentity != null && tileentity instanceof TileEntitySkull) {
- ((TileEntitySkull) tileentity)
- .func_152107_a(rand.nextInt(50) == 0 ? 1 : 0);
- ((TileEntitySkull) tileentity)
- .func_145903_a(MathHelper.floor_double(
- (double) (rand.nextInt(361) * 16.0F / 360.0F)
+ TileEntity tileentity = world.getTileEntity(x - 1, y,
+ z - 1);
+ if (tileentity != null
+ && tileentity instanceof TileEntitySkull) {
+ ((TileEntitySkull) tileentity).func_152107_a(
+ rand.nextInt(50) == 0 ? 1 : 0);
+ ((TileEntitySkull) tileentity).func_145903_a(
+ MathHelper.floor_double(
+ (double) (rand.nextInt(
+ 361)
+ * 16.0F
+ / 360.0F)
+ 0.5D)
& 15);
- ((BlockSkull) Blocks.skull).func_149965_a(world, x - 1, y,
- z - 1, (TileEntitySkull) tileentity);
+ ((BlockSkull) Blocks.skull).func_149965_a(world,
+ x - 1, y, z - 1,
+ (TileEntitySkull) tileentity);
}
- world.setBlock(x + 1, y, z - 1, BlockList.jewelCraftingTable, 3,
- 2);
- TileEntity jewelersTable = world.getTileEntity(x + 1, y, z - 1);
- Item[] jewelry = new Item[] { ItemList.ring, ItemList.necklace,
- ItemList.bracelet, ItemList.earrings };
+ world.setBlock(x + 1, y, z - 1,
+ BlockList.jewelCraftingTable, 3, 2);
+ TileEntity jewelersTable = world.getTileEntity(x + 1, y,
+ z - 1);
+ Item[] jewelry = new Item[] {
+ ItemList.ring, ItemList.necklace,
+ ItemList.bracelet, ItemList.earrings
+ };
if (jewelersTable != null
&& jewelersTable instanceof TileEntityJewelrsCraftingTable) {
if (rand.nextBoolean())
((TileEntityJewelrsCraftingTable) jewelersTable)
- .setGemItemStack(JewelrycraftUtil.gem.get(rand
- .nextInt(JewelrycraftUtil.gem.size())));
+ .setGemItemStack(
+ JewelrycraftUtil.gem
+ .get(rand.nextInt(
+ JewelrycraftUtil.gem
+ .size())));
else if (rand.nextBoolean()) {
- ItemStack result =
- new ItemStack(jewelry[rand.nextInt(4)], 1, 0);
+ ItemStack result = new ItemStack(
+ jewelry[rand.nextInt(4)],
+ 1, 0);
if (JewelrycraftUtil.metal.size() > 0)
- JewelryNBT.addMetal(result, JewelrycraftUtil.metal.get(
- rand.nextInt(JewelrycraftUtil.metal.size())));
+ JewelryNBT.addMetal(result,
+ JewelrycraftUtil.metal
+ .get(rand.nextInt(
+ JewelrycraftUtil.metal
+ .size())));
((TileEntityJewelrsCraftingTable) jewelersTable)
- .setJewelryItemStack(result);
+ .setJewelryItemStack(
+ result);
}
}
- world.setBlock(x - 1, y, z + 1, BlockList.handPedestal, 0, 2);
+ world.setBlock(x - 1, y, z + 1, BlockList.handPedestal, 0,
+ 2);
TileEntity pedestal = world.getTileEntity(x - 1, y, z + 1);
- if (pedestal != null && pedestal instanceof TileEntityHandPedestal)
+ if (pedestal != null
+ && pedestal instanceof TileEntityHandPedestal)
((TileEntityHandPedestal) pedestal)
- .setHeldItemStack(((WeightedRandomItem) WeightedRandom
- .getRandomItem(rand, WorldGenStructure1.items))
- .getItem(rand));
- world.setBlock(x - 1, y + 1, z + 1, BlockList.shadowEye, 0, 2);
+ .setHeldItemStack(
+ ((WeightedRandomItem) WeightedRandom
+ .getRandomItem(rand,
+ WorldGenStructure1.items))
+ .getItem(rand));
+ world.setBlock(x - 1, y + 1, z + 1, BlockList.shadowEye, 0,
+ 2);
return true;
}
diff --git a/src/main/java/darkknight/jewelrycraft/worldGen/village/ComponentJewelry.java b/src/main/java/darkknight/jewelrycraft/worldGen/village/ComponentJewelry.java index 00e074c..c5d0cc2 100755 --- a/src/main/java/darkknight/jewelrycraft/worldGen/village/ComponentJewelry.java +++ b/src/main/java/darkknight/jewelrycraft/worldGen/village/ComponentJewelry.java @@ -33,9 +33,10 @@ public class ComponentJewelry extends StructureVillagePieces.House1 { public ComponentJewelry() {
}
- public ComponentJewelry(Start par1ComponentVillageStartPiece, int par2,
- Random par3Random,
- StructureBoundingBox par4StructureBoundingBox, int par5) {
+ public ComponentJewelry(Start par1ComponentVillageStartPiece,
+ int par2, Random par3Random,
+ StructureBoundingBox par4StructureBoundingBox,
+ int par5) {
super();
coordBaseMode = par5;
boundingBox = par4StructureBoundingBox;
@@ -43,16 +44,21 @@ public class ComponentJewelry extends StructureVillagePieces.House1 { @SuppressWarnings("rawtypes")
public static ComponentJewelry buildComponent(Start villagePiece,
- List pieces, Random random, int p1, int p2, int p3, int p4,
- int p5) {
- StructureBoundingBox structureboundingbox =
- StructureBoundingBox.getComponentToAddBoundingBox(p1, p2,
- p3, 0, 0, 0, 11, 5, 12, p4);
+ List pieces, Random random, int p1, int p2, int p3,
+ int p4, int p5) {
+ StructureBoundingBox structureboundingbox = StructureBoundingBox
+ .getComponentToAddBoundingBox(p1, p2, p3,
+ 0, 0, 0, 11, 5, 12, p4);
return canVillageGoDeeper(structureboundingbox)
- && StructureComponent.findIntersecting(pieces,
+ && StructureComponent.findIntersecting(
+ pieces,
structureboundingbox) == null
- ? new ComponentJewelry(villagePiece, p5,
- random, structureboundingbox, p4)
+ ? new ComponentJewelry(
+ villagePiece,
+ p5,
+ random,
+ structureboundingbox,
+ p4)
: null;
}
@@ -60,15 +66,18 @@ public class ComponentJewelry extends StructureVillagePieces.House1 { public boolean addComponentParts(World world, Random random,
StructureBoundingBox sbb) {
if (averageGroundLevel < 0) {
- averageGroundLevel = getAverageGroundLevel(world, sbb);
+ averageGroundLevel = getAverageGroundLevel(world,
+ sbb);
if (averageGroundLevel < 0)
return true;
- boundingBox.offset(0,
- averageGroundLevel - boundingBox.maxY + 3, 0);
+ boundingBox.offset(0, averageGroundLevel
+ - boundingBox.maxY + 3, 0);
}
fillWithBlocks(world, sbb, 0, 0, 6, 10, 5, 11,
- Block.getBlockById(0), Block.getBlockById(0), false);
- fillWithBlocks(world, sbb, 2, 0, 0, 8, 5, 5, Block.getBlockById(0),
+ Block.getBlockById(0),
+ Block.getBlockById(0), false);
+ fillWithBlocks(world, sbb, 2, 0, 0, 8, 5, 5,
+ Block.getBlockById(0),
Block.getBlockById(0), false);
// Pillars
fillWithBlocks(world, sbb, 2, 0, 0, 2, 3, 0, Blocks.log,
@@ -90,120 +99,163 @@ public class ComponentJewelry extends StructureVillagePieces.House1 { Blocks.planks, false);
fillWithBlocks(world, sbb, 3, 0, 0, 7, 3, 0, Blocks.planks,
Blocks.planks, false);
- fillWithBlocks(world, sbb, 0, 0, 6, 10, 3, 6, Blocks.cobblestone,
- Blocks.cobblestone, false);
- fillWithBlocks(world, sbb, 0, 0, 11, 10, 3, 11, Blocks.cobblestone,
- Blocks.cobblestone, false);
- fillWithBlocks(world, sbb, 0, 0, 6, 0, 3, 11, Blocks.cobblestone,
- Blocks.cobblestone, false);
- fillWithBlocks(world, sbb, 10, 0, 6, 10, 3, 11, Blocks.cobblestone,
- Blocks.cobblestone, false);
+ fillWithBlocks(world, sbb, 0, 0, 6, 10, 3, 6,
+ Blocks.cobblestone, Blocks.cobblestone,
+ false);
+ fillWithBlocks(world, sbb, 0, 0, 11, 10, 3, 11,
+ Blocks.cobblestone, Blocks.cobblestone,
+ false);
+ fillWithBlocks(world, sbb, 0, 0, 6, 0, 3, 11,
+ Blocks.cobblestone, Blocks.cobblestone,
+ false);
+ fillWithBlocks(world, sbb, 10, 0, 6, 10, 3, 11,
+ Blocks.cobblestone, Blocks.cobblestone,
+ false);
// Roof
for (int i = 3; i <= 7; i++)
for (int j = 1; j <= 5; j++)
- placeBlockAtCurrentPosition(world, Blocks.wooden_slab, 2,
- i, 4, j, sbb);
+ placeBlockAtCurrentPosition(world,
+ Blocks.wooden_slab, 2, i,
+ 4, j, sbb);
for (int i = 3; i <= 7; i++)
for (int j = 6; j <= 6; j++)
- placeBlockAtCurrentPosition(world, Blocks.stone_slab, 0, i,
- 4, j, sbb);
+ placeBlockAtCurrentPosition(world,
+ Blocks.stone_slab, 0, i, 4,
+ j, sbb);
for (int i = 1; i <= 9; i++)
for (int j = 7; j <= 10; j++)
- placeBlockAtCurrentPosition(world, Blocks.stone_slab, 3, i,
- 4, j, sbb);
+ placeBlockAtCurrentPosition(world,
+ Blocks.stone_slab, 3, i, 4,
+ j, sbb);
for (int i = 2; i <= 8; i++)
- placeBlockAtCurrentPosition(world, Blocks.double_wooden_slab,
- 2, i, 4, 0, sbb);
+ placeBlockAtCurrentPosition(world,
+ Blocks.double_wooden_slab, 2, i, 4,
+ 0, sbb);
for (int i = 1; i <= 5; i++) {
- placeBlockAtCurrentPosition(world, Blocks.double_wooden_slab,
- 2, 2, 4, i, sbb);
- placeBlockAtCurrentPosition(world, Blocks.double_wooden_slab,
- 2, 8, 4, i, sbb);
+ placeBlockAtCurrentPosition(world,
+ Blocks.double_wooden_slab, 2, 2, 4,
+ i, sbb);
+ placeBlockAtCurrentPosition(world,
+ Blocks.double_wooden_slab, 2, 8, 4,
+ i, sbb);
}
for (int i = 0; i <= 2; i++) {
- placeBlockAtCurrentPosition(world, Blocks.double_stone_slab, 0,
- i, 4, 6, sbb);
- placeBlockAtCurrentPosition(world, Blocks.double_stone_slab, 0,
- i + 8, 4, 6, sbb);
+ placeBlockAtCurrentPosition(world,
+ Blocks.double_stone_slab, 0, i, 4,
+ 6, sbb);
+ placeBlockAtCurrentPosition(world,
+ Blocks.double_stone_slab, 0, i + 8,
+ 4, 6, sbb);
}
for (int i = 7; i <= 11; i++) {
- placeBlockAtCurrentPosition(world, Blocks.double_stone_slab, 0,
- 0, 4, i, sbb);
- placeBlockAtCurrentPosition(world, Blocks.double_stone_slab, 0,
- 10, 4, i, sbb);
+ placeBlockAtCurrentPosition(world,
+ Blocks.double_stone_slab, 0, 0, 4,
+ i, sbb);
+ placeBlockAtCurrentPosition(world,
+ Blocks.double_stone_slab, 0, 10, 4,
+ i, sbb);
}
for (int i = 0; i <= 10; i++)
- placeBlockAtCurrentPosition(world, Blocks.double_stone_slab, 0,
- i, 4, 11, sbb);
+ placeBlockAtCurrentPosition(world,
+ Blocks.double_stone_slab, 0, i, 4,
+ 11, sbb);
// Base
for (int i = 2; i <= 8; i++)
for (int j = 0; j <= 5; j++)
- placeBlockAtCurrentPosition(world, Blocks.planks, 1, i, 0,
- j, sbb);
- fillWithBlocks(world, sbb, 0, 0, 6, 10, 0, 11, Blocks.stonebrick,
- Blocks.stonebrick, false);
+ placeBlockAtCurrentPosition(world,
+ Blocks.planks, 1, i, 0, j,
+ sbb);
+ fillWithBlocks(world, sbb, 0, 0, 6, 10, 0, 11,
+ Blocks.stonebrick, Blocks.stonebrick,
+ false);
for (int i = 6; i <= 10; i++)
- placeBlockAtCurrentPosition(world, Blocks.double_stone_slab, 0,
- 5, 0, i, sbb);
- for (int i = 7; i <= 10; i++) {
- placeBlockAtCurrentPosition(world, Blocks.stonebrick, 3, 1, 0,
- i, sbb);
- placeBlockAtCurrentPosition(world, Blocks.stonebrick, 3, 9, 0,
+ placeBlockAtCurrentPosition(world,
+ Blocks.double_stone_slab, 0, 5, 0,
i, sbb);
+ for (int i = 7; i <= 10; i++) {
+ placeBlockAtCurrentPosition(world,
+ Blocks.stonebrick, 3, 1, 0, i,
+ sbb);
+ placeBlockAtCurrentPosition(world,
+ Blocks.stonebrick, 3, 9, 0, i,
+ sbb);
}
// Decorations
placeDoorAtCurrentPosition(world, sbb, random, 6, 1, 0,
- getMetadataWithOffset(Blocks.wooden_door, 1));
+ getMetadataWithOffset(Blocks.wooden_door,
+ 1));
placeDoorAtCurrentPosition(world, sbb, random, 5, 1, 6,
- getMetadataWithOffset(Blocks.wooden_door, 1));
- placeBlockAtCurrentPosition(world, Blocks.glass_pane, 0, 3, 2, 0,
- sbb);
- placeBlockAtCurrentPosition(world, Blocks.glass_pane, 0, 4, 2, 0,
- sbb);
- placeBlockAtCurrentPosition(world, Blocks.glass_pane, 0, 2, 2, 1,
- sbb);
- placeBlockAtCurrentPosition(world, Blocks.glass_pane, 0, 2, 2, 2,
- sbb);
- placeBlockAtCurrentPosition(world, Blocks.glass_pane, 0, 2, 2, 4,
- sbb);
- placeBlockAtCurrentPosition(world, Blocks.glass_pane, 0, 2, 2, 5,
- sbb);
- placeBlockAtCurrentPosition(world, Blocks.glass_pane, 0, 8, 2, 1,
- sbb);
- placeBlockAtCurrentPosition(world, Blocks.glass_pane, 0, 8, 2, 2,
- sbb);
- placeBlockAtCurrentPosition(world, Blocks.glass_pane, 0, 8, 2, 4,
- sbb);
- placeBlockAtCurrentPosition(world, Blocks.glass_pane, 0, 8, 2, 5,
- sbb);
- placeBlockAtCurrentPosition(world, Blocks.torch, 0, 6, 3, 1, sbb);
- placeBlockAtCurrentPosition(world, Blocks.torch, 0, 3, 3, 3, sbb);
- placeBlockAtCurrentPosition(world, Blocks.torch, 0, 7, 3, 3, sbb);
- placeBlockAtCurrentPosition(world, Blocks.torch, 0, 5, 3, 5, sbb);
- placeBlockAtCurrentPosition(world, Blocks.torch, 0, 5, 3, 7, sbb);
- placeBlockAtCurrentPosition(world, Blocks.torch, 0, 5, 3, 10, sbb);
- placeBlockAtCurrentPosition(world, Blocks.torch, 0, 1, 3, 8, sbb);
- placeBlockAtCurrentPosition(world, Blocks.torch, 0, 1, 3, 9, sbb);
- placeBlockAtCurrentPosition(world, Blocks.torch, 0, 9, 3, 8, sbb);
- placeBlockAtCurrentPosition(world, Blocks.torch, 0, 9, 3, 9, sbb);
+ getMetadataWithOffset(Blocks.wooden_door,
+ 1));
+ placeBlockAtCurrentPosition(world, Blocks.glass_pane, 0, 3,
+ 2, 0, sbb);
+ placeBlockAtCurrentPosition(world, Blocks.glass_pane, 0, 4,
+ 2, 0, sbb);
+ placeBlockAtCurrentPosition(world, Blocks.glass_pane, 0, 2,
+ 2, 1, sbb);
+ placeBlockAtCurrentPosition(world, Blocks.glass_pane, 0, 2,
+ 2, 2, sbb);
+ placeBlockAtCurrentPosition(world, Blocks.glass_pane, 0, 2,
+ 2, 4, sbb);
+ placeBlockAtCurrentPosition(world, Blocks.glass_pane, 0, 2,
+ 2, 5, sbb);
+ placeBlockAtCurrentPosition(world, Blocks.glass_pane, 0, 8,
+ 2, 1, sbb);
+ placeBlockAtCurrentPosition(world, Blocks.glass_pane, 0, 8,
+ 2, 2, sbb);
+ placeBlockAtCurrentPosition(world, Blocks.glass_pane, 0, 8,
+ 2, 4, sbb);
+ placeBlockAtCurrentPosition(world, Blocks.glass_pane, 0, 8,
+ 2, 5, sbb);
+ placeBlockAtCurrentPosition(world, Blocks.torch, 0, 6, 3,
+ 1, sbb);
+ placeBlockAtCurrentPosition(world, Blocks.torch, 0, 3, 3,
+ 3, sbb);
+ placeBlockAtCurrentPosition(world, Blocks.torch, 0, 7, 3,
+ 3, sbb);
+ placeBlockAtCurrentPosition(world, Blocks.torch, 0, 5, 3,
+ 5, sbb);
+ placeBlockAtCurrentPosition(world, Blocks.torch, 0, 5, 3,
+ 7, sbb);
+ placeBlockAtCurrentPosition(world, Blocks.torch, 0, 5, 3,
+ 10, sbb);
+ placeBlockAtCurrentPosition(world, Blocks.torch, 0, 1, 3,
+ 8, sbb);
+ placeBlockAtCurrentPosition(world, Blocks.torch, 0, 1, 3,
+ 9, sbb);
+ placeBlockAtCurrentPosition(world, Blocks.torch, 0, 9, 3,
+ 8, sbb);
+ placeBlockAtCurrentPosition(world, Blocks.torch, 0, 9, 3,
+ 9, sbb);
int bgCarpetColor = random.nextInt(16);
for (int i = 4; i <= 7; i++)
for (int j = 1; j <= 5; j++)
- placeBlockAtCurrentPosition(world, Blocks.carpet,
- bgCarpetColor, i, 1, j, sbb);
+ placeBlockAtCurrentPosition(world,
+ Blocks.carpet,
+ bgCarpetColor, i, 1, j,
+ sbb);
generateChest(world, 3, 1, 1, 0, random, sbb,
- ConfigHandler.GEM_CHEST_MIN, ConfigHandler.GEM_CHEST_MAX);
+ ConfigHandler.GEM_CHEST_MIN,
+ ConfigHandler.GEM_CHEST_MAX);
generateDisplayer(world, 3, 1, 2,
- coordBaseMode == 0 || coordBaseMode == 2 ? 1 : 2, random,
- sbb);
- placeBlockAtCurrentPosition(world, BlockList.jewelCraftingTable,
- coordBaseMode == 0 || coordBaseMode == 2 ? 1 : 2, 3, 1, 3,
- sbb);
+ coordBaseMode == 0 || coordBaseMode == 2
+ ? 1
+ : 2,
+ random, sbb);
+ placeBlockAtCurrentPosition(world,
+ BlockList.jewelCraftingTable,
+ coordBaseMode == 0 || coordBaseMode == 2
+ ? 1
+ : 2,
+ 3, 1, 3, sbb);
generateDisplayer(world, 3, 1, 4,
- coordBaseMode == 0 || coordBaseMode == 2 ? 1 : 2, random,
- sbb);
+ coordBaseMode == 0 || coordBaseMode == 2
+ ? 1
+ : 2,
+ random, sbb);
generateChest(world, 3, 1, 5, 0, random, sbb,
- ConfigHandler.GEM_CHEST_MIN, ConfigHandler.GEM_CHEST_MAX);
+ ConfigHandler.GEM_CHEST_MIN,
+ ConfigHandler.GEM_CHEST_MAX);
generateFurnace(world, 1, 1, 7, 0, random, sbb,
ConfigHandler.FURNACE_MIN_INGOT_STACK,
ConfigHandler.FURNACE_MAX_INGOT_STACK,
@@ -229,102 +281,128 @@ public class ComponentJewelry extends StructureVillagePieces.House1 { ConfigHandler.FURNACE_MAX_INGOT_STACK,
ConfigHandler.CAN_FURNACE_GENERATE_INGOTS);
generateSmelter(world, 1, 1, 8,
- coordBaseMode == 0 || coordBaseMode == 2 ? 1 : 2, random,
- sbb, random.nextBoolean());
+ coordBaseMode == 0 || coordBaseMode == 2
+ ? 1
+ : 2,
+ random, sbb, random.nextBoolean());
generateSmelter(world, 1, 1, 9,
- coordBaseMode == 0 || coordBaseMode == 2 ? 1 : 2, random,
- sbb, random.nextBoolean());
+ coordBaseMode == 0 || coordBaseMode == 2
+ ? 1
+ : 2,
+ random, sbb, random.nextBoolean());
generateMolder(world, 2, 1, 8,
- coordBaseMode == 0 || coordBaseMode == 2 ? 1 : 2, random,
- sbb, random.nextBoolean(), random.nextBoolean());
+ coordBaseMode == 0 || coordBaseMode == 2
+ ? 1
+ : 2,
+ random, sbb, random.nextBoolean(),
+ random.nextBoolean());
generateMolder(world, 2, 1, 9,
- coordBaseMode == 0 || coordBaseMode == 2 ? 1 : 2, random,
- sbb, random.nextBoolean(), random.nextBoolean());
+ coordBaseMode == 0 || coordBaseMode == 2
+ ? 1
+ : 2,
+ random, sbb, random.nextBoolean(),
+ random.nextBoolean());
if (random.nextBoolean())
generateIngotChest(world, 9, 1, 7, 0, random, sbb,
ConfigHandler.INGOT_CHEST_MIN,
- ConfigHandler.INGOT_CHEST_MAX, Blocks.chest,
+ ConfigHandler.INGOT_CHEST_MAX,
+ Blocks.chest,
ConfigHandler.INGOT_CHEST_MAX_STACK);
else
generateOresChest(world, 9, 1, 7, 0, random, sbb,
ConfigHandler.INGOT_CHEST_MIN,
- ConfigHandler.INGOT_CHEST_MAX, Blocks.chest,
+ ConfigHandler.INGOT_CHEST_MAX,
+ Blocks.chest,
ConfigHandler.INGOT_CHEST_MAX_STACK);
if (random.nextBoolean())
generateIngotChest(world, 9, 1, 8, 0, random, sbb,
ConfigHandler.INGOT_CHEST_MIN,
- ConfigHandler.INGOT_CHEST_MAX, Blocks.chest,
+ ConfigHandler.INGOT_CHEST_MAX,
+ Blocks.chest,
ConfigHandler.INGOT_CHEST_MAX_STACK);
else
generateOresChest(world, 9, 1, 8, 0, random, sbb,
ConfigHandler.INGOT_CHEST_MIN,
- ConfigHandler.INGOT_CHEST_MAX, Blocks.chest,
+ ConfigHandler.INGOT_CHEST_MAX,
+ Blocks.chest,
ConfigHandler.INGOT_CHEST_MAX_STACK);
if (random.nextBoolean())
generateIngotChest(world, 9, 1, 9, 0, random, sbb,
ConfigHandler.INGOT_CHEST_MIN,
- ConfigHandler.INGOT_CHEST_MAX, Blocks.trapped_chest,
+ ConfigHandler.INGOT_CHEST_MAX,
+ Blocks.trapped_chest,
ConfigHandler.INGOT_CHEST_MAX_STACK);
else
generateOresChest(world, 9, 1, 9, 0, random, sbb,
ConfigHandler.INGOT_CHEST_MIN,
- ConfigHandler.INGOT_CHEST_MAX, Blocks.trapped_chest,
+ ConfigHandler.INGOT_CHEST_MAX,
+ Blocks.trapped_chest,
ConfigHandler.INGOT_CHEST_MAX_STACK);
if (random.nextBoolean())
generateIngotChest(world, 9, 1, 10, 0, random, sbb,
ConfigHandler.INGOT_CHEST_MIN,
- ConfigHandler.INGOT_CHEST_MAX, Blocks.trapped_chest,
+ ConfigHandler.INGOT_CHEST_MAX,
+ Blocks.trapped_chest,
ConfigHandler.INGOT_CHEST_MAX_STACK);
else
generateOresChest(world, 9, 1, 10, 0, random, sbb,
ConfigHandler.INGOT_CHEST_MIN,
- ConfigHandler.INGOT_CHEST_MAX, Blocks.trapped_chest,
+ ConfigHandler.INGOT_CHEST_MAX,
+ Blocks.trapped_chest,
ConfigHandler.INGOT_CHEST_MAX_STACK);
for (int l = 0; l < 6; ++l)
for (int i1 = 2; i1 < 9; ++i1) {
- clearCurrentPositionBlocksUpwards(world, i1, 9, l, sbb);
- func_151554_b(world, Blocks.cobblestone, 0, i1, -1, l,
- sbb);
+ clearCurrentPositionBlocksUpwards(world,
+ i1, 9, l, sbb);
+ func_151554_b(world, Blocks.cobblestone, 0,
+ i1, -1, l, sbb);
}
for (int l = 6; l < 12; ++l)
for (int i1 = 0; i1 < 11; ++i1) {
- clearCurrentPositionBlocksUpwards(world, i1, 9, l, sbb);
- func_151554_b(world, Blocks.cobblestone, 0, i1, -1, l,
- sbb);
+ clearCurrentPositionBlocksUpwards(world,
+ i1, 9, l, sbb);
+ func_151554_b(world, Blocks.cobblestone, 0,
+ i1, -1, l, sbb);
}
spawnVillagers(world, sbb, 3, 1, 3, 1);
return true;
}
public void generateChest(World world, int i, int j, int k,
- int metadata, Random random, StructureBoundingBox sbb, int min,
- int max) {
+ int metadata, Random random,
+ StructureBoundingBox sbb, int min, int max) {
int i1 = getXWithOffset(i, k);
int j1 = getYWithOffset(j);
int k1 = getZWithOffset(i, k);
if (max >= min) {
int t = random.nextInt(max - min + 1) + min;
- placeBlockAtCurrentPosition(world, Blocks.chest, metadata, i,
- j, k, sbb);
+ placeBlockAtCurrentPosition(world, Blocks.chest,
+ metadata, i, j, k, sbb);
if (world.getTileEntity(i1, j1, k1) != null) {
- TileEntityChest chest =
- (TileEntityChest) world.getTileEntity(i1, j1, k1);
+ TileEntityChest chest = (TileEntityChest) world
+ .getTileEntity(i1, j1, k1);
while (chest != null && t > 0
- && JewelrycraftUtil.gem.size() > 0) {
- ItemStack jewels = JewelrycraftUtil.gem.get(
- random.nextInt(JewelrycraftUtil.gem.size()));
- chest.func_145976_a(
- StatCollector.translateToLocal("jeweler."
- + Variables.MODID + ".jewelerchest"));
+ && JewelrycraftUtil.gem
+ .size() > 0) {
+ ItemStack jewels = JewelrycraftUtil.gem
+ .get(random.nextInt(
+ JewelrycraftUtil.gem
+ .size()));
+ chest.func_145976_a(StatCollector
+ .translateToLocal(
+ "jeweler." + Variables.MODID
+ + ".jewelerchest"));
if (jewels.getItem() == Items.nether_star
&& ConfigHandler.GENERATE_VILLAGE_NETHERSTAR)
chest.setInventorySlotContents(
- random.nextInt(chest.getSizeInventory()),
+ random.nextInt(chest
+ .getSizeInventory()),
jewels);
else if (random.nextBoolean()
&& jewels.getItem() != Items.nether_star)
chest.setInventorySlotContents(
- random.nextInt(chest.getSizeInventory()),
+ random.nextInt(chest
+ .getSizeInventory()),
jewels);
t--;
}
@@ -333,30 +411,38 @@ public class ComponentJewelry extends StructureVillagePieces.House1 { }
public void generateIngotChest(World world, int i, int j, int k,
- int metadata, Random random, StructureBoundingBox sbb, int min,
- int max, Block chestB, int randomAmount) {
+ int metadata, Random random,
+ StructureBoundingBox sbb, int min, int max,
+ Block chestB, int randomAmount) {
int i1 = getXWithOffset(i, k);
int j1 = getYWithOffset(j);
int k1 = getZWithOffset(i, k);
if (max >= min) {
int t = random.nextInt(max - min + 1) + min;
- placeBlockAtCurrentPosition(world, chestB, metadata, i, j, k,
- sbb);
+ placeBlockAtCurrentPosition(world, chestB,
+ metadata, i, j, k, sbb);
if (world.getTileEntity(i1, j1, k1) != null) {
- TileEntityChest chest =
- (TileEntityChest) world.getTileEntity(i1, j1, k1);
+ TileEntityChest chest = (TileEntityChest) world
+ .getTileEntity(i1, j1, k1);
while (chest != null && t > 0
- && JewelrycraftUtil.metal.size() > 0) {
- chest.func_145976_a(StatCollector.translateToLocal(
- "jeweler." + Variables.MODID + ".ingotchest"));
- int metalID =
- random.nextInt(JewelrycraftUtil.metal.size());
- ItemStack metal =
- JewelrycraftUtil.metal.get(metalID).copy();
- metal.stackSize = 2 + random.nextInt(randomAmount);
+ && JewelrycraftUtil.metal
+ .size() > 0) {
+ chest.func_145976_a(StatCollector
+ .translateToLocal(
+ "jeweler." + Variables.MODID
+ + ".ingotchest"));
+ int metalID = random.nextInt(
+ JewelrycraftUtil.metal
+ .size());
+ ItemStack metal = JewelrycraftUtil.metal
+ .get(metalID)
+ .copy();
+ metal.stackSize = 2 + random
+ .nextInt(randomAmount);
if (random.nextBoolean())
chest.setInventorySlotContents(
- random.nextInt(chest.getSizeInventory()),
+ random.nextInt(chest
+ .getSizeInventory()),
metal);
t--;
}
@@ -365,30 +451,37 @@ public class ComponentJewelry extends StructureVillagePieces.House1 { }
public void generateOresChest(World world, int i, int j, int k,
- int metadata, Random random, StructureBoundingBox sbb, int min,
- int max, Block chestB, int randomAmount) {
+ int metadata, Random random,
+ StructureBoundingBox sbb, int min, int max,
+ Block chestB, int randomAmount) {
int i1 = getXWithOffset(i, k);
int j1 = getYWithOffset(j);
int k1 = getZWithOffset(i, k);
if (max >= min) {
int t = random.nextInt(max - min + 1) + min;
- placeBlockAtCurrentPosition(world, chestB, metadata, i, j, k,
- sbb);
+ placeBlockAtCurrentPosition(world, chestB,
+ metadata, i, j, k, sbb);
if (world.getTileEntity(i1, j1, k1) != null) {
- TileEntityChest chest =
- (TileEntityChest) world.getTileEntity(i1, j1, k1);
+ TileEntityChest chest = (TileEntityChest) world
+ .getTileEntity(i1, j1, k1);
while (chest != null && t > 0
- && JewelrycraftUtil.ores.size() > 0) {
- chest.func_145976_a(StatCollector.translateToLocal(
- "jeweler." + Variables.MODID + ".orechest"));
- int oreID =
- random.nextInt(JewelrycraftUtil.ores.size());
- ItemStack ores =
- JewelrycraftUtil.ores.get(oreID).copy();
- ores.stackSize = 2 + random.nextInt(randomAmount);
+ && JewelrycraftUtil.ores
+ .size() > 0) {
+ chest.func_145976_a(StatCollector
+ .translateToLocal(
+ "jeweler." + Variables.MODID
+ + ".orechest"));
+ int oreID = random.nextInt(
+ JewelrycraftUtil.ores
+ .size());
+ ItemStack ores = JewelrycraftUtil.ores
+ .get(oreID).copy();
+ ores.stackSize = 2 + random
+ .nextInt(randomAmount);
if (random.nextBoolean())
chest.setInventorySlotContents(
- random.nextInt(chest.getSizeInventory()),
+ random.nextInt(chest
+ .getSizeInventory()),
ores);
t--;
}
@@ -397,29 +490,40 @@ public class ComponentJewelry extends StructureVillagePieces.House1 { }
public void generateDisplayer(World world, int i, int j, int k,
- int metadata, Random random, StructureBoundingBox sbb) {
+ int metadata, Random random,
+ StructureBoundingBox sbb) {
int i1 = getXWithOffset(i, k);
int j1 = getYWithOffset(j);
int k1 = getZWithOffset(i, k);
- placeBlockAtCurrentPosition(world, BlockList.displayer, metadata,
- i, j, k, sbb);
+ placeBlockAtCurrentPosition(world, BlockList.displayer,
+ metadata, i, j, k, sbb);
if (world.getTileEntity(i1, j1, k1) != null) {
- TileEntityDisplayer displayer =
- (TileEntityDisplayer) world.getTileEntity(i1, j1, k1);
+ TileEntityDisplayer displayer = (TileEntityDisplayer) world
+ .getTileEntity(i1, j1, k1);
if (displayer != null) {
- Item[] jewels = { ItemList.ring, ItemList.necklace };
+ Item[] jewels = {
+ ItemList.ring,
+ ItemList.necklace
+ };
ItemStack jewel = new ItemStack(
- jewels[random.nextInt(jewels.length)]);
+ jewels[random.nextInt(
+ jewels.length)]);
if (JewelrycraftUtil.metal.size() > 0)
JewelryNBT.addMetal(jewel,
- JewelrycraftUtil.metal.get(random.nextInt(
- JewelrycraftUtil.metal.size())));
+ JewelrycraftUtil.metal
+ .get(random.nextInt(
+ JewelrycraftUtil.metal
+ .size())));
if (JewelrycraftUtil.objects.size() > 0)
- JewelryNBT.addModifiers(jewel, JewelrycraftUtil
- .addRandomModifiers(random.nextInt(4)));
+ JewelryNBT.addModifiers(jewel,
+ JewelrycraftUtil.addRandomModifiers(
+ random.nextInt(4)));
if (JewelrycraftUtil.gem.size() > 0)
- JewelryNBT.addGem(jewel, JewelrycraftUtil.gem.get(
- random.nextInt(JewelrycraftUtil.gem.size())));
+ JewelryNBT.addGem(jewel,
+ JewelrycraftUtil.gem
+ .get(random.nextInt(
+ JewelrycraftUtil.gem
+ .size())));
displayer.object = jewel;
displayer.quantity = 1;
displayer.hasObject = true;
@@ -428,76 +532,102 @@ public class ComponentJewelry extends StructureVillagePieces.House1 { }
public void generateSmelter(World world, int i, int j, int k,
- int metadata, Random random, StructureBoundingBox sbb,
- boolean isEmpty) {
+ int metadata, Random random,
+ StructureBoundingBox sbb, boolean isEmpty) {
int i1 = getXWithOffset(i, k);
int j1 = getYWithOffset(j);
int k1 = getZWithOffset(i, k);
- placeBlockAtCurrentPosition(world, BlockList.smelter, metadata, i,
- j, k, sbb);
+ placeBlockAtCurrentPosition(world, BlockList.smelter,
+ metadata, i, j, k, sbb);
if (world.getTileEntity(i1, j1, k1) != null) {
- TileEntitySmelter smelter =
- (TileEntitySmelter) world.getTileEntity(i1, j1, k1);
+ TileEntitySmelter smelter = (TileEntitySmelter) world
+ .getTileEntity(i1, j1, k1);
if (smelter != null && !isEmpty
- && JewelrycraftUtil.metal.size() > 0) {
- int metal = random.nextInt(JewelrycraftUtil.metal.size());
- smelter.moltenMetal =
- JewelrycraftUtil.metal.get(metal).copy();
- smelter.hasMoltenMetal = random.nextBoolean();
+ && JewelrycraftUtil.metal
+ .size() > 0) {
+ int metal = random.nextInt(
+ JewelrycraftUtil.metal
+ .size());
+ smelter.moltenMetal = JewelrycraftUtil.metal
+ .get(metal).copy();
+ smelter.hasMoltenMetal = random
+ .nextBoolean();
float quantity = random.nextFloat();
if (smelter.hasMoltenMetal)
smelter.quantity = quantity < 0.9F
- ? 0.1F + Math.round(quantity * 10) / 10
- : Math.round(quantity * 10) / 10;
+ ? 0.1F + Math.round(
+ quantity * 10)
+ / 10
+ : Math.round(quantity
+ * 10)
+ / 10;
}
}
}
public void generateMolder(World world, int i, int j, int k,
- int metadata, Random random, StructureBoundingBox sbb,
- boolean hasMold, boolean hasStuff) {
+ int metadata, Random random,
+ StructureBoundingBox sbb, boolean hasMold,
+ boolean hasStuff) {
int i1 = getXWithOffset(i, k);
int j1 = getYWithOffset(j);
int k1 = getZWithOffset(i, k);
- placeBlockAtCurrentPosition(world, BlockList.molder, metadata, i,
- j, k, sbb);
+ placeBlockAtCurrentPosition(world, BlockList.molder,
+ metadata, i, j, k, sbb);
if (world.getTileEntity(i1, j1, k1) != null) {
- TileEntityMolder molder =
- (TileEntityMolder) world.getTileEntity(i1, j1, k1);
+ TileEntityMolder molder = (TileEntityMolder) world
+ .getTileEntity(i1, j1, k1);
if (molder != null && !molder.hasMold)
if (hasMold) {
- int meta = random
- .nextInt(ItemMolds.moldsItemNames.length - 1);
- molder.mold = new ItemStack(ItemList.molds, 1, meta + 1);
+ int meta = random.nextInt(
+ ItemMolds.moldsItemNames.length
+ - 1);
+ molder.mold = new ItemStack(
+ ItemList.molds, 1,
+ meta + 1);
molder.hasMold = true;
- if (hasStuff && JewelrycraftUtil.metal.size() > 0) {
- ItemStack ring = new ItemStack(ItemList.ring);
+ if (hasStuff && JewelrycraftUtil.metal
+ .size() > 0) {
+ ItemStack ring = new ItemStack(
+ ItemList.ring);
JewelryNBT.addMetal(ring,
- JewelrycraftUtil.metal.get(random.nextInt(
- JewelrycraftUtil.metal.size()))
+ JewelrycraftUtil.metal
+ .get(random.nextInt(
+ JewelrycraftUtil.metal
+ .size()))
.copy());
- ItemStack necklace =
- new ItemStack(ItemList.necklace);
- JewelryNBT.addMetal(necklace,
- JewelrycraftUtil.metal.get(random.nextInt(
- JewelrycraftUtil.metal.size()))
+ ItemStack necklace = new ItemStack(
+ ItemList.necklace);
+ JewelryNBT.addMetal(
+ necklace,
+ JewelrycraftUtil.metal
+ .get(random.nextInt(
+ JewelrycraftUtil.metal
+ .size()))
.copy());
- ItemStack bracelet =
- new ItemStack(ItemList.bracelet);
- JewelryNBT.addMetal(bracelet,
- JewelrycraftUtil.metal.get(random.nextInt(
- JewelrycraftUtil.metal.size()))
+ ItemStack bracelet = new ItemStack(
+ ItemList.bracelet);
+ JewelryNBT.addMetal(
+ bracelet,
+ JewelrycraftUtil.metal
+ .get(random.nextInt(
+ JewelrycraftUtil.metal
+ .size()))
.copy());
- ItemStack earrings =
- new ItemStack(ItemList.earrings);
- JewelryNBT.addMetal(earrings,
- JewelrycraftUtil.metal.get(random.nextInt(
- JewelrycraftUtil.metal.size()))
+ ItemStack earrings = new ItemStack(
+ ItemList.earrings);
+ JewelryNBT.addMetal(
+ earrings,
+ JewelrycraftUtil.metal
+ .get(random.nextInt(
+ JewelrycraftUtil.metal
+ .size()))
.copy());
if (meta == 0)
- molder.jewelBase = JewelrycraftUtil.metal.get(
- random.nextInt(JewelrycraftUtil.metal
- .size()));
+ molder.jewelBase = JewelrycraftUtil.metal
+ .get(random.nextInt(
+ JewelrycraftUtil.metal
+ .size()));
else if (meta == 1)
molder.jewelBase = ring;
else if (meta == 2)
@@ -513,27 +643,36 @@ public class ComponentJewelry extends StructureVillagePieces.House1 { }
public void generateFurnace(World world, int i, int j, int k,
- int metadata, Random random, StructureBoundingBox sbb, int min,
- int max, boolean hasMetal) {
+ int metadata, Random random,
+ StructureBoundingBox sbb, int min, int max,
+ boolean hasMetal) {
int i1 = getXWithOffset(i, k);
int j1 = getYWithOffset(j);
int k1 = getZWithOffset(i, k);
- placeBlockAtCurrentPosition(world, Blocks.furnace, metadata, i, j,
- k, sbb);
+ placeBlockAtCurrentPosition(world, Blocks.furnace,
+ metadata, i, j, k, sbb);
if (world.getTileEntity(i1, j1, k1) != null) {
- TileEntityFurnace furnace =
- (TileEntityFurnace) world.getTileEntity(i1, j1, k1);
+ TileEntityFurnace furnace = (TileEntityFurnace) world
+ .getTileEntity(i1, j1, k1);
if (furnace != null) {
if (random.nextBoolean())
- furnace.setInventorySlotContents(1, new ItemStack(
- Items.coal, 1 + random.nextInt(16)));
- if (hasMetal && JewelrycraftUtil.metal.size() > 0) {
- int metalID =
- random.nextInt(JewelrycraftUtil.metal.size());
- ItemStack metal =
- JewelrycraftUtil.metal.get(metalID).copy();
- metal.stackSize = random.nextInt(max - min + 1) + min;
- furnace.setInventorySlotContents(2, metal);
+ furnace.setInventorySlotContents(1,
+ new ItemStack(Items.coal,
+ 1 + random.nextInt(
+ 16)));
+ if (hasMetal && JewelrycraftUtil.metal
+ .size() > 0) {
+ int metalID = random.nextInt(
+ JewelrycraftUtil.metal
+ .size());
+ ItemStack metal = JewelrycraftUtil.metal
+ .get(metalID)
+ .copy();
+ metal.stackSize = random.nextInt(
+ max - min + 1)
+ + min;
+ furnace.setInventorySlotContents(2,
+ metal);
}
}
}
diff --git a/src/main/java/darkknight/jewelrycraft/worldGen/village/JCTrades.java b/src/main/java/darkknight/jewelrycraft/worldGen/village/JCTrades.java index 68e0651..d905948 100755 --- a/src/main/java/darkknight/jewelrycraft/worldGen/village/JCTrades.java +++ b/src/main/java/darkknight/jewelrycraft/worldGen/village/JCTrades.java @@ -17,8 +17,10 @@ import net.minecraft.village.MerchantRecipe; import net.minecraft.village.MerchantRecipeList;
public class JCTrades implements IVillageTradeHandler {
- Item[] jewelry = new Item[] { ItemList.ring, ItemList.necklace,
- ItemList.bracelet, ItemList.earrings };
+ Item[] jewelry = new Item[] {
+ ItemList.ring, ItemList.necklace,
+ ItemList.bracelet, ItemList.earrings
+ };
public JCTrades() {
super();
@@ -39,139 +41,218 @@ public class JCTrades implements IVillageTradeHandler { int type = random.nextInt(12);
switch (type) {
case 0:
- if (JewelrycraftUtil.metal.size() > 0) {
- result = JewelrycraftUtil.metal.get(random
- .nextInt(JewelrycraftUtil.metal.size()));
- result.stackSize = 5 + random.nextInt(5);
- ingredient = new ItemStack(Items.emerald,
- 2 + random.nextInt(7));
+ if (JewelrycraftUtil.metal
+ .size() > 0) {
+ result = JewelrycraftUtil.metal
+ .get(random.nextInt(
+ JewelrycraftUtil.metal
+ .size()));
+ result.stackSize = 5
+ + random.nextInt(
+ 5);
+ ingredient = new ItemStack(
+ Items.emerald,
+ 2 + random.nextInt(
+ 7));
if (random.nextBoolean())
- ingredient2 = new ItemStack(Items.emerald,
- 2 + random.nextInt(2));
+ ingredient2 = new ItemStack(
+ Items.emerald,
+ 2 + random.nextInt(
+ 2));
break;
}
case 1: {
- result = new ItemStack(ItemList.molds,
- 5 + random.nextInt(7), random.nextInt(
- ItemMolds.moldsItemNames.length));
- ingredient = new ItemStack(Items.emerald, 1);
+ result = new ItemStack(
+ ItemList.molds,
+ 5 + random.nextInt(
+ 7),
+ random.nextInt(ItemMolds.moldsItemNames.length));
+ ingredient = new ItemStack(
+ Items.emerald, 1);
if (random.nextBoolean())
- ingredient2 = new ItemStack(Items.emerald,
- 1 + random.nextInt(2));
+ ingredient2 = new ItemStack(
+ Items.emerald,
+ 1 + random.nextInt(
+ 2));
break;
}
case 2: {
int number = random.nextInt(3);
- result = new ItemStack(BlockList.displayer,
+ result = new ItemStack(
+ BlockList.displayer,
1 + number);
- ingredient = new ItemStack(Blocks.emerald_block,
- 2 + number * 3 + random.nextInt(2));
- ingredient2 = new ItemStack(Items.emerald,
- 3 + number + random.nextInt(8));
+ ingredient = new ItemStack(
+ Blocks.emerald_block,
+ 2 + number * 3 + random
+ .nextInt(2));
+ ingredient2 = new ItemStack(
+ Items.emerald,
+ 3 + number + random
+ .nextInt(8));
break;
}
case 3: {
- result = new ItemStack(BlockList.jewelCraftingTable);
- ingredient = new ItemStack(Items.emerald,
- 1 + random.nextInt(2));
+ result = new ItemStack(
+ BlockList.jewelCraftingTable);
+ ingredient = new ItemStack(
+ Items.emerald,
+ 1 + random.nextInt(
+ 2));
if (random.nextBoolean())
- ingredient2 = new ItemStack(Items.emerald,
- 1 + random.nextInt(2));
+ ingredient2 = new ItemStack(
+ Items.emerald,
+ 1 + random.nextInt(
+ 2));
break;
}
case 4: {
- result = new ItemStack(BlockList.shadowOre,
- 1 + random.nextInt(6));
- ingredient = new ItemStack(Items.emerald,
- 3 + random.nextInt(4));
+ result = new ItemStack(
+ BlockList.shadowOre,
+ 1 + random.nextInt(
+ 6));
+ ingredient = new ItemStack(
+ Items.emerald,
+ 3 + random.nextInt(
+ 4));
if (random.nextBoolean())
- ingredient2 = new ItemStack(Items.emerald,
- 3 + random.nextInt(4));
+ ingredient2 = new ItemStack(
+ Items.emerald,
+ 3 + random.nextInt(
+ 4));
break;
}
case 5: {
- result = new ItemStack(BlockList.molder,
- 5 + random.nextInt(5));
- ingredient = new ItemStack(Items.emerald, 1);
+ result = new ItemStack(
+ BlockList.molder,
+ 5 + random.nextInt(
+ 5));
+ ingredient = new ItemStack(
+ Items.emerald, 1);
if (random.nextBoolean())
- ingredient2 = new ItemStack(Items.emerald, 1);
+ ingredient2 = new ItemStack(
+ Items.emerald,
+ 1);
break;
}
case 6: {
- result = new ItemStack(BlockList.smelter);
- ingredient = new ItemStack(Items.emerald,
- 1 + random.nextInt(2));
+ result = new ItemStack(
+ BlockList.smelter);
+ ingredient = new ItemStack(
+ Items.emerald,
+ 1 + random.nextInt(
+ 2));
if (random.nextBoolean())
- ingredient2 = new ItemStack(Items.emerald,
- 1 + random.nextInt(2));
+ ingredient2 = new ItemStack(
+ Items.emerald,
+ 1 + random.nextInt(
+ 2));
break;
}
case 7:
- if (JewelrycraftUtil.gem.size() > 0) {
- int end = random
- .nextInt(JewelrycraftUtil.gem.size());
- result = JewelrycraftUtil.gem.get(end);
- result.stackSize = 1 + random.nextInt(
- JewelrycraftUtil.gem.size() - end);
- if (JewelrycraftUtil.gem.size() - 1 - end >= 1) {
+ if (JewelrycraftUtil.gem
+ .size() > 0) {
+ int end = random.nextInt(
+ JewelrycraftUtil.gem
+ .size());
+ result = JewelrycraftUtil.gem
+ .get(end);
+ result.stackSize = 1
+ + random.nextInt(
+ JewelrycraftUtil.gem
+ .size()
+ - end);
+ if (JewelrycraftUtil.gem
+ .size() - 1
+ - end >= 1) {
int value = 1 + end;
if (value > 64)
value = 64;
- ingredient = new ItemStack(Items.emerald,
- 2 + random.nextInt(value));
+ ingredient = new ItemStack(
+ Items.emerald,
+ 2 + random.nextInt(
+ value));
if (random.nextBoolean())
- ingredient2 = new ItemStack(Items.emerald,
- 2 + random.nextInt(value));
+ ingredient2 = new ItemStack(
+ Items.emerald,
+ 2 + random.nextInt(
+ value));
} else {
- ingredient =
- new ItemStack(Blocks.emerald_block,
- 16 + random.nextInt(32));
- ingredient2 =
- new ItemStack(Blocks.emerald_block,
- 8 + random.nextInt(48));
+ ingredient = new ItemStack(
+ Blocks.emerald_block,
+ 16 + random.nextInt(
+ 32));
+ ingredient2 = new ItemStack(
+ Blocks.emerald_block,
+ 8 + random.nextInt(
+ 48));
}
break;
}
case 8:
- if (JewelrycraftUtil.ores.size() > 0) {
- result = JewelrycraftUtil.ores.get(random
- .nextInt(JewelrycraftUtil.ores.size()));
- result.stackSize = 3 + random.nextInt(3);
- ingredient = new ItemStack(Items.emerald,
- 2 + random.nextInt(5));
+ if (JewelrycraftUtil.ores
+ .size() > 0) {
+ result = JewelrycraftUtil.ores
+ .get(random.nextInt(
+ JewelrycraftUtil.ores
+ .size()));
+ result.stackSize = 3
+ + random.nextInt(
+ 3);
+ ingredient = new ItemStack(
+ Items.emerald,
+ 2 + random.nextInt(
+ 5));
if (random.nextBoolean())
- ingredient2 = new ItemStack(Items.emerald,
- 2 + random.nextInt(6));
+ ingredient2 = new ItemStack(
+ Items.emerald,
+ 2 + random.nextInt(
+ 6));
break;
}
case 9: {
- result = new ItemStack(ItemList.guide, 1);
- ingredient = new ItemStack(Items.emerald, 1);
+ result = new ItemStack(
+ ItemList.guide, 1);
+ ingredient = new ItemStack(
+ Items.emerald, 1);
break;
}
default: {
- result = new ItemStack(jewelry[random.nextInt(4)], 1,
- 0);
+ result = new ItemStack(
+ jewelry[random.nextInt(
+ 4)],
+ 1, 0);
int randValue = random.nextInt(4);
- if (JewelrycraftUtil.metal.size() > 0)
+ if (JewelrycraftUtil.metal
+ .size() > 0)
JewelryNBT.addMetal(result,
- JewelrycraftUtil.metal.get(random.nextInt(
- JewelrycraftUtil.metal.size())));
- if (JewelrycraftUtil.objects.size() > 0)
- JewelryNBT.addModifiers(result, JewelrycraftUtil
- .addRandomModifiers(randValue));
- if (JewelrycraftUtil.gem.size() > 0)
+ JewelrycraftUtil.metal
+ .get(random.nextInt(
+ JewelrycraftUtil.metal
+ .size())));
+ if (JewelrycraftUtil.objects
+ .size() > 0)
+ JewelryNBT.addModifiers(
+ result,
+ JewelrycraftUtil.addRandomModifiers(
+ randValue));
+ if (JewelrycraftUtil.gem
+ .size() > 0)
JewelryNBT.addGem(result,
- JewelrycraftUtil.gem.get(random.nextInt(
- JewelrycraftUtil.gem.size())));
- ingredient = new ItemStack(Items.emerald,
- 16 + random.nextInt(20));
- ingredient2 = new ItemStack(Blocks.emerald_block,
+ JewelrycraftUtil.gem
+ .get(random.nextInt(
+ JewelrycraftUtil.gem
+ .size())));
+ ingredient = new ItemStack(
+ Items.emerald,
+ 16 + random.nextInt(
+ 20));
+ ingredient2 = new ItemStack(
+ Blocks.emerald_block,
2 + randValue);
}
}
- recipeList.addToListWithCheck(
- new MerchantRecipe(ingredient, ingredient2, result));
+ recipeList.addToListWithCheck(new MerchantRecipe(
+ ingredient, ingredient2, result));
}
}
}
\ No newline at end of file diff --git a/src/main/java/darkknight/jewelrycraft/worldGen/village/VillageHandler.java b/src/main/java/darkknight/jewelrycraft/worldGen/village/VillageHandler.java index 757f9e3..0a4b832 100755 --- a/src/main/java/darkknight/jewelrycraft/worldGen/village/VillageHandler.java +++ b/src/main/java/darkknight/jewelrycraft/worldGen/village/VillageHandler.java @@ -12,12 +12,13 @@ import net.minecraft.world.gen.structure.MapGenStructureIO; public class VillageHandler {
public static void preInit(FMLPreInitializationEvent e) {
VillagerRegistry.instance().registerVillagerId(3000);
- VillagerRegistry.instance().registerVillageTradeHandler(3000,
- new JCTrades());
+ VillagerRegistry.instance().registerVillageTradeHandler(
+ 3000, new JCTrades());
VillagerRegistry.instance().registerVillageCreationHandler(
new VillageJewelryHandler());
try {
- MapGenStructureIO.func_143031_a(ComponentJewelry.class,
+ MapGenStructureIO.func_143031_a(
+ ComponentJewelry.class,
Variables.MODID + ":Jewelry");
} catch (Throwable thrw) {
JewelrycraftMod.logger.error(
diff --git a/src/main/java/darkknight/jewelrycraft/worldGen/village/VillageJewelryHandler.java b/src/main/java/darkknight/jewelrycraft/worldGen/village/VillageJewelryHandler.java index 3bd72a0..3b9c274 100755 --- a/src/main/java/darkknight/jewelrycraft/worldGen/village/VillageJewelryHandler.java +++ b/src/main/java/darkknight/jewelrycraft/worldGen/village/VillageJewelryHandler.java @@ -44,9 +44,9 @@ public class VillageJewelryHandler implements IVillageCreationHandler { */
@Override
public Object buildComponent(PieceWeight villagePiece,
- Start startPiece, List pieces, Random random, int p1, int p2,
- int p3, int p4, int p5) {
- return ComponentJewelry.buildComponent(startPiece, pieces, random,
- p1, p2, p3, p4, p5);
+ Start startPiece, List pieces, Random random,
+ int p1, int p2, int p3, int p4, int p5) {
+ return ComponentJewelry.buildComponent(startPiece, pieces,
+ random, p1, p2, p3, p4, p5);
}
}
\ No newline at end of file |
