Prep for Filter Cube development.

testdev
sigonasr2 8 years ago
parent 5507546ac5
commit 71c1d51d76
  1. BIN
      TwosideKeeper.jar
  2. 36
      src/sig/plugin/TwosideKeeper/HelperStructures/Common/GenericFunctions.java
  3. 6
      src/sig/plugin/TwosideKeeper/HelperStructures/Common/RecipeLinker.java
  4. 2
      src/sig/plugin/TwosideKeeper/HelperStructures/CustomItem.java
  5. 2
      src/sig/plugin/TwosideKeeper/HelperStructures/WorldShop.java
  6. 2
      src/sig/plugin/TwosideKeeper/Recipes.java
  7. 16
      src/sig/plugin/TwosideKeeper/TwosideKeeper.java
  8. 4
      src/sig/plugin/TwosideKeeper/runServerHeartbeat.java

Binary file not shown.

@ -80,6 +80,7 @@ import sig.plugin.TwosideKeeper.HelperStructures.EliteMonsterLocationFinder;
import sig.plugin.TwosideKeeper.HelperStructures.ItemSet; import sig.plugin.TwosideKeeper.HelperStructures.ItemSet;
import sig.plugin.TwosideKeeper.HelperStructures.PlayerMode; import sig.plugin.TwosideKeeper.HelperStructures.PlayerMode;
import sig.plugin.TwosideKeeper.HelperStructures.WorldShop; import sig.plugin.TwosideKeeper.HelperStructures.WorldShop;
import sig.plugin.TwosideKeeper.HelperStructures.Utils.ItemUtils;
import sig.plugin.TwosideKeeper.HelperStructures.Utils.SoundUtils; import sig.plugin.TwosideKeeper.HelperStructures.Utils.SoundUtils;
public class GenericFunctions { public class GenericFunctions {
@ -755,40 +756,40 @@ public class GenericFunctions {
return "Rabbit's Foot"; return "Rabbit's Foot";
} }
case GOLD_RECORD:{ case GOLD_RECORD:{
return "Music Disc"; return "Music Disc - 13";
} }
case GREEN_RECORD:{ case GREEN_RECORD:{
return "Music Disc"; return "Music Disc - cat";
} }
case RECORD_10:{ case RECORD_10:{
return "Music Disc"; return "Music Disc - ward";
} }
case RECORD_11:{ case RECORD_11:{
return "Music Disc"; return "Music Disc - 11";
} }
case RECORD_12:{ case RECORD_12:{
return "Music Disc"; return "Music Disc - wait";
} }
case RECORD_3:{ case RECORD_3:{
return "Music Disc"; return "Music Disc - blocks";
} }
case RECORD_4:{ case RECORD_4:{
return "Music Disc"; return "Music Disc - chirp";
} }
case RECORD_5:{ case RECORD_5:{
return "Music Disc"; return "Music Disc - far";
} }
case RECORD_6:{ case RECORD_6:{
return "Music Disc"; return "Music Disc - mall";
} }
case RECORD_7:{ case RECORD_7:{
return "Music Disc"; return "Music Disc - mellohi";
} }
case RECORD_8:{ case RECORD_8:{
return "Music Disc"; return "Music Disc - stal";
} }
case RECORD_9:{ case RECORD_9:{
return "Music Disc"; return "Music Disc - strad";
} }
case REDSTONE_COMPARATOR:{ case REDSTONE_COMPARATOR:{
return "Comparator"; return "Comparator";
@ -4715,5 +4716,16 @@ public class GenericFunctions {
PopulatePlayerBlockList(p,15,15,2,5,false); PopulatePlayerBlockList(p,15,15,2,5,false);
return PlayerStructure.GetPlayerStructure(p).blockscanlist; return PlayerStructure.GetPlayerStructure(p).blockscanlist;
} }
public static boolean itemCanBeSuckedUp(Item ent) {
ItemStack item = ent.getItemStack();
//TwosideKeeper.log(item.toString()+": "+ent.getTicksLived()+".."+ent.getPickupDelay()+".."+((Item)ent).getName()+".."+((Item)ent).isCustomNameVisible()+".."+((Item)ent).getCustomName(), 0);
if (ItemUtils.isValidLoreItem(item) ||
ent.isGlowing() ||
ent.getPickupDelay()>=6000) {
return false;
}
return true;
}
} }

@ -31,6 +31,12 @@ public enum RecipeLinker {
new ItemStack(Material.EMERALD),new ItemStack(Material.CHEST),new ItemStack(Material.EMERALD), new ItemStack(Material.EMERALD),new ItemStack(Material.CHEST),new ItemStack(Material.EMERALD),
new ItemStack(Material.OBSIDIAN),new ItemStack(Material.OBSIDIAN),new ItemStack(Material.OBSIDIAN), new ItemStack(Material.OBSIDIAN),new ItemStack(Material.OBSIDIAN),new ItemStack(Material.OBSIDIAN),
}), }),
vacuumcube(RecipeCategory.CONTAINERS,ChatColor.YELLOW,"Vacuum Cube",new ItemStack[]{
CustomItem.VacuumCube(),
new ItemStack(Material.DIAMOND_BLOCK),new ItemStack(Material.ELYTRA),new ItemStack(Material.DIAMOND_BLOCK),
new ItemStack(Material.DIAMOND_BLOCK),new ItemStack(Material.ENDER_CHEST),new ItemStack(Material.DIAMOND_BLOCK),
new ItemStack(Material.ENDER_PEARL),new ItemStack(Material.REDSTONE_BLOCK),new ItemStack(Material.ENDER_PEARL)
}),
dc(RecipeCategory.CONTAINERS,ChatColor.YELLOW,"Duplicate Ender Item Cube",new ItemStack[]{ dc(RecipeCategory.CONTAINERS,ChatColor.YELLOW,"Duplicate Ender Item Cube",new ItemStack[]{
CustomItem.EnderItemCube(2), CustomItem.EnderItemCube(2),
CustomItem.EnderItemCube(),new ItemStack(Material.NETHER_STAR) CustomItem.EnderItemCube(),new ItemStack(Material.NETHER_STAR)

@ -117,7 +117,7 @@ public class CustomItem {
TwosideKeeper.WORLD_SHOP2_RECIPE = WorldShop2Recipe(); TwosideKeeper.WORLD_SHOP2_RECIPE = WorldShop2Recipe();
} }
private static ItemStack VacuumCube() { public static ItemStack VacuumCube() {
ItemStack item_VacuumCube = new ItemStack(Material.ENDER_CHEST); ItemStack item_VacuumCube = new ItemStack(Material.ENDER_CHEST);
List<String> item_VacuumCube_lore = new ArrayList<String>(); List<String> item_VacuumCube_lore = new ArrayList<String>();
item_VacuumCube_lore.add("A storage container that sucks"); item_VacuumCube_lore.add("A storage container that sucks");

@ -140,7 +140,7 @@ public class WorldShop {
price = pricelist.get(item.getType().name()); price = pricelist.get(item.getType().name());
} }
if (TwosideKeeper.DEAL_OF_THE_DAY_ITEM.isSimilar(item)) { if (TwosideKeeper.DEAL_OF_THE_DAY_ITEM.isSimilar(item)) {
return price; return price*0.8;
} }
return ModifyPriceBasedOnLocation(price); return ModifyPriceBasedOnLocation(price);
} }

@ -35,6 +35,8 @@ public class Recipes {
Bukkit.addRecipe(TwosideKeeper.DUPLICATE_ENDER_ITEM_CUBE_RECIPE); Bukkit.addRecipe(TwosideKeeper.DUPLICATE_ENDER_ITEM_CUBE_RECIPE);
Bukkit.addRecipe(TwosideKeeper.VACUUM_CUBE_RECIPE); Bukkit.addRecipe(TwosideKeeper.VACUUM_CUBE_RECIPE);
Bukkit.addRecipe(TwosideKeeper.FILTER_CUBE_RECIPE);
} }
public static void Initialize_ArrowQuiver_Recipe() { public static void Initialize_ArrowQuiver_Recipe() {
Bukkit.addRecipe(TwosideKeeper.ARROW_QUIVER_RECIPE); Bukkit.addRecipe(TwosideKeeper.ARROW_QUIVER_RECIPE);

@ -298,6 +298,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
public static ShapedRecipe ENDER_ITEM_CUBE_RECIPE; public static ShapedRecipe ENDER_ITEM_CUBE_RECIPE;
public static ShapelessRecipe DUPLICATE_ENDER_ITEM_CUBE_RECIPE; public static ShapelessRecipe DUPLICATE_ENDER_ITEM_CUBE_RECIPE;
public static ShapelessRecipe VACUUM_CUBE_RECIPE; public static ShapelessRecipe VACUUM_CUBE_RECIPE;
public static ShapelessRecipe FILTER_CUBE_RECIPE;
public static ShapedRecipe ARROW_QUIVER_RECIPE; public static ShapedRecipe ARROW_QUIVER_RECIPE;
public static ShapedRecipe HARDENED_IRON_HELMET_RECIPE; public static ShapedRecipe HARDENED_IRON_HELMET_RECIPE;
public static ShapedRecipe HARDENED_IRON_CHESTPLATE_RECIPE; public static ShapedRecipe HARDENED_IRON_CHESTPLATE_RECIPE;
@ -7338,6 +7339,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
int color1=0,color2=1; int color1=0,color2=1;
double health=pd2.target.getHealth(); double health=pd2.target.getHealth();
double maxhealth=pd2.target.getMaxHealth(); double maxhealth=pd2.target.getMaxHealth();
final double orghealth = health;
if (health>20) { if (health>20) {
while (health>20) { while (health>20) {
color1++; color1++;
@ -7346,15 +7348,21 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
} }
} }
for (int i=0;i<health/2;i++) { for (int i=0;i<health/2;i++) {
remainingheartdisplay+=Character.toString((char)0x2665); remainingheartdisplay+=Character.toString('♥');
} }
if (maxhealth>20) { if (maxhealth>20) {
for (int i=0;i<10;i++) { if (orghealth>20) {
heartdisplay+=Character.toString((char)0x2665); for (int i=0;i<10;i++) {
heartdisplay+=Character.toString('♥');
}
} else {
for (int i=0;i<10;i++) {
heartdisplay+=Character.toString('♡');
}
} }
} else { } else {
for (int i=0;i<maxhealth/2;i++) { for (int i=0;i<maxhealth/2;i++) {
heartdisplay+=Character.toString((char)0x2665); heartdisplay+=Character.toString('♡');
} }
} }

@ -353,9 +353,9 @@ final class runServerHeartbeat implements Runnable {
public static void runVacuumCubeSuckup(Player p) { public static void runVacuumCubeSuckup(Player p) {
if (InventoryUtils.isCarryingVacuumCube(p)) { if (InventoryUtils.isCarryingVacuumCube(p)) {
//Suck up nearby item entities. //Suck up nearby item entities.
List<Entity> ents = p.getNearbyEntities(8, 8, 8); List<Entity> ents = p.getNearbyEntities(6, 6, 6);
for (Entity ent : ents) { for (Entity ent : ents) {
if (ent instanceof Item) { if (ent instanceof Item && GenericFunctions.itemCanBeSuckedUp((Item)ent)) {
//Pull towards the player. //Pull towards the player.
double SPD = 0.2; double SPD = 0.2;
double deltax = ent.getLocation().getX()-p.getLocation().getX(); double deltax = ent.getLocation().getX()-p.getLocation().getX();

Loading…
Cancel
Save