Added "Only Skyroot Bucket Activation" config

This commit is contained in:
Kino 2017-03-04 18:21:36 -05:00
parent c1b76ad699
commit b643f656e8
3 changed files with 43 additions and 29 deletions

View file

@ -12,6 +12,8 @@ public class AetherConfig
private static int aether_biome_id, aether_dimension_id;
private static boolean skyrootBucketOnly;
public static void init(File location)
{
File newFile = new File(location + "/aether" + "/Aether_Legacy.cfg");
@ -34,6 +36,8 @@ public class AetherConfig
aether_dimension_id = config.get("World Identification", "Aether Dimension ID", 4).getInt(4);
aether_biome_id = config.get("World Identification", "Aether Biome ID", 127).getInt(127);
skyrootBucketOnly = config.get("Misc", "Activate portal with only Skyroot bucket", false).getBoolean(false);
config.save();
}
@ -52,4 +56,9 @@ public class AetherConfig
return AetherConfig.christmas_content;
}
public static boolean activateOnlyWithSkyroot()
{
return AetherConfig.skyrootBucketOnly;
}
}

View file

@ -76,7 +76,7 @@ public class AetherEventHandler
RayTraceResult target = event.getTarget();
EntityPlayer player = event.getEntityPlayer();
boolean isWater = stack.getItem() == Items.WATER_BUCKET || stack.getItem() == ItemsAether.skyroot_bucket && stack.getMetadata() == 1;
boolean isWater = (!AetherConfig.activateOnlyWithSkyroot() && stack.getItem() == Items.WATER_BUCKET) || stack.getItem() == ItemsAether.skyroot_bucket && stack.getMetadata() == 1;
boolean isLava = stack.getItem() == Items.LAVA_BUCKET;
boolean validDimension = (player.dimension == 0 || player.dimension == AetherConfig.getAetherDimensionID());

View file

@ -156,34 +156,7 @@ public class PlayerAether
if (this.thePlayer.motionY < -2F)
{
EntityParachute parachute = null;
if(this.thePlayer.inventory.hasItemStack(new ItemStack(ItemsAether.cloud_parachute)))
{
parachute = new EntityParachute(this.thePlayer.worldObj, this.thePlayer, false);
parachute.setPosition(this.thePlayer.posX, this.thePlayer.posY, this.thePlayer.posZ);
this.thePlayer.worldObj.spawnEntityInWorld(parachute);
this.thePlayer.inventory.deleteStack(new ItemStack(ItemsAether.cloud_parachute));
}
else
{
if (this.thePlayer.inventory.hasItemStack(new ItemStack(ItemsAether.golden_parachute)))
{
for(int i = 0; i < this.thePlayer.inventory.getSizeInventory(); i++)
{
ItemStack itemstack = this.thePlayer.inventory.getStackInSlot(i);
if(itemstack != null && itemstack.getItem() == ItemsAether.golden_parachute)
{
itemstack.damageItem(1, this.thePlayer);
parachute = new EntityParachute(this.thePlayer.worldObj, this.thePlayer, true);
parachute.setPosition(this.thePlayer.posX, this.thePlayer.posY, this.thePlayer.posZ);
this.thePlayer.inventory.setInventorySlotContents(i, itemstack);
this.thePlayer.worldObj.spawnEntityInWorld(parachute);
}
}
}
}
this.activateParachute();
}
if (this.thePlayer.dimension == AetherConfig.getAetherDimensionID())
@ -474,6 +447,38 @@ public class PlayerAether
}
}
private void activateParachute()
{
EntityParachute parachute = null;
if(this.thePlayer.inventory.hasItemStack(new ItemStack(ItemsAether.cloud_parachute)))
{
parachute = new EntityParachute(this.thePlayer.worldObj, this.thePlayer, false);
parachute.setPosition(this.thePlayer.posX, this.thePlayer.posY, this.thePlayer.posZ);
this.thePlayer.worldObj.spawnEntityInWorld(parachute);
this.thePlayer.inventory.deleteStack(new ItemStack(ItemsAether.cloud_parachute));
}
else
{
if (this.thePlayer.inventory.hasItemStack(new ItemStack(ItemsAether.golden_parachute)))
{
for(int i = 0; i < this.thePlayer.inventory.getSizeInventory(); i++)
{
ItemStack itemstack = this.thePlayer.inventory.getStackInSlot(i);
if(itemstack != null && itemstack.getItem() == ItemsAether.golden_parachute)
{
itemstack.damageItem(1, this.thePlayer);
parachute = new EntityParachute(this.thePlayer.worldObj, this.thePlayer, true);
parachute.setPosition(this.thePlayer.posX, this.thePlayer.posY, this.thePlayer.posZ);
this.thePlayer.inventory.setInventorySlotContents(i, itemstack);
this.thePlayer.worldObj.spawnEntityInWorld(parachute);
}
}
}
}
}
/*
* A checker to see if a player is inside a block or not
*/