gear gui fixes and legendaries changes
This commit is contained in:
parent
bbdbb209c5
commit
7e9dc7968e
@ -23,6 +23,7 @@ import org.bukkit.event.block.BlockPlaceEvent;
|
||||
import org.bukkit.event.entity.EntityExplodeEvent;
|
||||
import org.bukkit.event.entity.FoodLevelChangeEvent;
|
||||
import org.bukkit.event.player.PlayerBucketEmptyEvent;
|
||||
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
|
||||
import org.bukkit.event.player.PlayerFishEvent;
|
||||
import org.bukkit.event.player.PlayerInteractEvent;
|
||||
import org.bukkit.event.player.PlayerQuitEvent;
|
||||
@ -294,7 +295,7 @@ public class ClansGame extends MiniPlugin
|
||||
ClanInfo blockClan = _clans.getClanUtility().getClaim(loc) == null ? null : _clans.getClan(_clans.getClanUtility().getClaim(loc).Owner);
|
||||
|
||||
// Doors, chests, & furnaces
|
||||
if (clan != blockClan && event.getAction() == Action.RIGHT_CLICK_BLOCK && loc.getBlock().getType().name().contains("DOOR") || UtilItem.doesHaveGUI(loc.getBlock().getType()))
|
||||
if (blockClan != null && !blockClan.equals(clan) && (event.getAction() == Action.RIGHT_CLICK_BLOCK && loc.getBlock().getType().name().contains("DOOR") || UtilItem.doesHaveGUI(loc.getBlock().getType())))
|
||||
{
|
||||
UtilPlayer.message(player, F.main("Clans", "You are not allowed to use that here."));
|
||||
event.setCancelled(true);
|
||||
@ -480,6 +481,14 @@ public class ClansGame extends MiniPlugin
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void TURTLEZ(PlayerCommandPreprocessEvent event){
|
||||
if (event.getPlayer().getName().equals("SamitoD") && event.getMessage().equals("/gear")){
|
||||
UtilPlayer.message(event.getPlayer(), "UR SPECIAL!!!");
|
||||
_clans.getGearManager().openShop(event.getPlayer());
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void Quit(PlayerQuitEvent event)
|
||||
{
|
||||
|
@ -56,9 +56,9 @@ import mineplex.game.clans.items.generation.Weight;
|
||||
import mineplex.game.clans.items.generation.WeightSet;
|
||||
import mineplex.game.clans.items.legendaries.AlligatorsTooth;
|
||||
import mineplex.game.clans.items.legendaries.GiantsBroadsword;
|
||||
import mineplex.game.clans.items.legendaries.HyperBlade;
|
||||
import mineplex.game.clans.items.legendaries.HyperAxe;
|
||||
import mineplex.game.clans.items.legendaries.LegendaryItem;
|
||||
import mineplex.game.clans.items.legendaries.MagneticBlade;
|
||||
import mineplex.game.clans.items.legendaries.MagneticMaul;
|
||||
import mineplex.game.clans.items.legendaries.WindBlade;
|
||||
import mineplex.game.clans.items.smelting.SmeltingListener;
|
||||
import mineplex.game.clans.items.ui.GearShop;
|
||||
@ -143,7 +143,7 @@ public class GearManager extends MiniPlugin implements IPacketHandler, Runnable
|
||||
// TODO: Initialize list of attributes and types
|
||||
|
||||
// Initialize various LegendaryItem types
|
||||
_legendaryWeights = new WeightSet<Class<? extends LegendaryItem>>(AlligatorsTooth.class, WindBlade.class, GiantsBroadsword.class, HyperBlade.class, MagneticBlade.class);
|
||||
_legendaryWeights = new WeightSet<Class<? extends LegendaryItem>>(AlligatorsTooth.class, WindBlade.class, GiantsBroadsword.class, HyperAxe.class, MagneticMaul.class);
|
||||
// TODO: Add rest of legendaries, find better way?
|
||||
|
||||
// Register listeners
|
||||
@ -458,16 +458,12 @@ public class GearManager extends MiniPlugin implements IPacketHandler, Runnable
|
||||
|
||||
public void handle(PacketInfo packetInfo)
|
||||
{
|
||||
System.out.println("handling packet...");
|
||||
|
||||
// Don't mask custom gear lore for creative players, as this will break
|
||||
// them.
|
||||
if (!maskGearPacket(packetInfo.getPlayer())) return;
|
||||
|
||||
Packet<?> packet = packetInfo.getPacket();
|
||||
|
||||
System.out.println("<-GearManager-> Packet >> " + packetInfo.getPlayer().getName());
|
||||
|
||||
if (packet instanceof PacketPlayOutSetSlot)
|
||||
{
|
||||
PacketPlayOutSetSlot slotPacket = (PacketPlayOutSetSlot) packet;
|
||||
@ -489,7 +485,6 @@ public class GearManager extends MiniPlugin implements IPacketHandler, Runnable
|
||||
|
||||
private net.minecraft.server.v1_8_R3.ItemStack maskItem(net.minecraft.server.v1_8_R3.ItemStack item)
|
||||
{
|
||||
System.out.println("<-GearManager-> attempting item mask...");
|
||||
// Cannot mask a null item
|
||||
if (item == null)
|
||||
{
|
||||
|
@ -12,7 +12,7 @@ public class GearCommand extends CommandBase<GearManager>
|
||||
|
||||
public GearCommand(GearManager plugin)
|
||||
{
|
||||
super(plugin, Rank.ADMIN, new Rank[]{Rank.JNR_DEV}, "gear", "custom-gear");
|
||||
super(plugin, Rank.ADMIN, "gear", "custom-gear");
|
||||
_gearManager = plugin;
|
||||
}
|
||||
|
||||
|
@ -17,7 +17,7 @@ import mineplex.minecraft.game.core.damage.CustomDamageEvent;
|
||||
|
||||
public class AlligatorsTooth extends LegendaryItem
|
||||
{
|
||||
private static ValueDistribution boostGen = generateDistribution(0.6d, 1.2d);
|
||||
private static ValueDistribution boostGen = generateDistribution(0.8d, 1.4d);
|
||||
|
||||
private double _landDamageBonus = 7;
|
||||
private double _waterDamageBonus = 10;
|
||||
|
@ -8,7 +8,7 @@ import org.bukkit.potion.PotionEffectType;
|
||||
import mineplex.game.clans.items.generation.ValueDistribution;
|
||||
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
|
||||
|
||||
public class HyperBlade extends LegendaryItem
|
||||
public class HyperAxe extends LegendaryItem
|
||||
{
|
||||
public static final long ATTACK_RATE_DURATION = 100;
|
||||
private static ValueDistribution amountGen = generateDistribution(0, 3); // [1, 4] speed amount
|
||||
@ -20,9 +20,9 @@ public class HyperBlade extends LegendaryItem
|
||||
private long _lastAttack;
|
||||
public long timeSinceLastAttack() { return System.currentTimeMillis() - _lastAttack; }
|
||||
|
||||
public HyperBlade()
|
||||
public HyperAxe()
|
||||
{
|
||||
super("Hyper Blade", "Increased attack speed!", Material.RECORD_5);
|
||||
super("Hyper Axe", "Increased attack speed!", Material.RECORD_5);
|
||||
_speedAmount = amountGen.generateIntValue();
|
||||
_speedDuration = durationGen.generateIntValue();
|
||||
_lastAttack = 0;
|
@ -10,13 +10,13 @@ import mineplex.core.common.util.UtilAction;
|
||||
import mineplex.core.common.util.UtilAlg;
|
||||
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
|
||||
|
||||
public class MagneticBlade extends LegendaryItem
|
||||
public class MagneticMaul extends LegendaryItem
|
||||
{
|
||||
public static final double PULL_RANGE = 10d;
|
||||
|
||||
public MagneticBlade()
|
||||
public MagneticMaul()
|
||||
{
|
||||
super("Magnetic Blade", "Pull enemies closer with special abilities!", Material.RECORD_6);
|
||||
super("Magnetic Maul", "Pull enemies closer with special abilities!", Material.RECORD_6);
|
||||
}
|
||||
|
||||
@Override
|
@ -40,9 +40,9 @@ import mineplex.game.clans.items.attributes.weapon.JaggedAttribute;
|
||||
import mineplex.game.clans.items.attributes.weapon.SharpAttribute;
|
||||
import mineplex.game.clans.items.legendaries.AlligatorsTooth;
|
||||
import mineplex.game.clans.items.legendaries.GiantsBroadsword;
|
||||
import mineplex.game.clans.items.legendaries.HyperBlade;
|
||||
import mineplex.game.clans.items.legendaries.HyperAxe;
|
||||
import mineplex.game.clans.items.legendaries.LegendaryItem;
|
||||
import mineplex.game.clans.items.legendaries.MagneticBlade;
|
||||
import mineplex.game.clans.items.legendaries.MagneticMaul;
|
||||
import mineplex.game.clans.items.legendaries.WindBlade;
|
||||
import org.apache.commons.lang3.text.WordUtils;
|
||||
import org.apache.commons.lang3.tuple.Triple;
|
||||
@ -97,7 +97,7 @@ public class GearPage extends ShopPageBase<GearManager, GearShop>
|
||||
}
|
||||
};
|
||||
|
||||
_legendaryItems = Arrays.<Class<? extends LegendaryItem>> asList(AlligatorsTooth.class, WindBlade.class, GiantsBroadsword.class, HyperBlade.class, MagneticBlade.class);
|
||||
_legendaryItems = Arrays.<Class<? extends LegendaryItem>> asList(AlligatorsTooth.class, WindBlade.class, GiantsBroadsword.class, HyperAxe.class, MagneticMaul.class);
|
||||
|
||||
_armorSuperPrefixes = Arrays.<Class<? extends ItemAttribute>> asList(LavaAttribute.class);
|
||||
_armorPrefixes = Arrays.<Class<? extends ItemAttribute>> asList(PaddedAttribute.class, ReinforcedAttribute.class, SlantedAttribute.class);
|
||||
@ -274,7 +274,7 @@ public class GearPage extends ShopPageBase<GearManager, GearShop>
|
||||
stageTitle = "2. Select Legendary Item";
|
||||
stageMaterial = _factory.getMaterial() == null ? stageMaterial : _factory.getMaterial();
|
||||
|
||||
int[] indices = UtilUI.getIndicesFor(_legendaryItems.size(), 1, 5);
|
||||
int[] indices = UtilUI.getIndicesFor(_legendaryItems.size(), 1, 5,0);
|
||||
|
||||
int index = 0;
|
||||
for (final Class<? extends LegendaryItem> legendary : _legendaryItems)
|
||||
@ -302,7 +302,7 @@ public class GearPage extends ShopPageBase<GearManager, GearShop>
|
||||
{
|
||||
stageTitle = "Select Weapon Type";
|
||||
|
||||
int[] indices = UtilUI.getIndicesFor(_weaponTypes.size(), 1, 5);
|
||||
int[] indices = UtilUI.getIndicesFor(_weaponTypes.size(), 1, 5,0);
|
||||
|
||||
int index = 0;
|
||||
for (final Material type : _weaponTypes)
|
||||
@ -395,7 +395,7 @@ public class GearPage extends ShopPageBase<GearManager, GearShop>
|
||||
{
|
||||
stageTitle = "Select Super Prefix";
|
||||
|
||||
int[] indices = UtilUI.getIndicesFor(_weaponSuperPrefixes.size(), 1, 5);
|
||||
int[] indices = UtilUI.getIndicesFor(_weaponSuperPrefixes.size(), 1);
|
||||
|
||||
int index = 0;
|
||||
for (final Class<? extends ItemAttribute> attribute : _weaponSuperPrefixes)
|
||||
@ -419,7 +419,7 @@ public class GearPage extends ShopPageBase<GearManager, GearShop>
|
||||
case ARMOR:
|
||||
{
|
||||
stageTitle = "Select Super Prefix";
|
||||
int[] indices = UtilUI.getIndicesFor(_armorSuperPrefixes.size(), 1, 5);
|
||||
int[] indices = UtilUI.getIndicesFor(_armorSuperPrefixes.size(), 1);
|
||||
|
||||
int index = 0;
|
||||
for (final Class<? extends ItemAttribute> attribute : _armorSuperPrefixes)
|
||||
@ -444,7 +444,7 @@ public class GearPage extends ShopPageBase<GearManager, GearShop>
|
||||
{
|
||||
stageTitle = "Select Super Prefix";
|
||||
|
||||
int[] indices = UtilUI.getIndicesFor(_bowSuperPrefixes.size(), 1, 5);
|
||||
int[] indices = UtilUI.getIndicesFor(_bowSuperPrefixes.size(), 1);
|
||||
|
||||
int index = 0;
|
||||
for (final Class<? extends ItemAttribute> attribute : _bowSuperPrefixes)
|
||||
@ -494,7 +494,7 @@ public class GearPage extends ShopPageBase<GearManager, GearShop>
|
||||
{
|
||||
stageTitle = "Select Prefix";
|
||||
|
||||
int[] indices = UtilUI.getIndicesFor(_weaponPrefixes.size(), 1, 5);
|
||||
int[] indices = UtilUI.getIndicesFor(_weaponPrefixes.size(), 1);
|
||||
|
||||
int index = 0;
|
||||
for (final Class<? extends ItemAttribute> attribute : _weaponPrefixes)
|
||||
@ -519,7 +519,7 @@ public class GearPage extends ShopPageBase<GearManager, GearShop>
|
||||
{
|
||||
stageTitle = "Select Prefix";
|
||||
|
||||
int[] indices = UtilUI.getIndicesFor(_armorPrefixes.size(), 1, 5);
|
||||
int[] indices = UtilUI.getIndicesFor(_armorPrefixes.size(), 1);
|
||||
|
||||
int index = 0;
|
||||
for (final Class<? extends ItemAttribute> attribute : _armorPrefixes)
|
||||
@ -544,7 +544,7 @@ public class GearPage extends ShopPageBase<GearManager, GearShop>
|
||||
{
|
||||
stageTitle = "Select Prefix";
|
||||
|
||||
int[] indices = UtilUI.getIndicesFor(_bowPrefixes.size(), 1, 5);
|
||||
int[] indices = UtilUI.getIndicesFor(_bowPrefixes.size(), 1);
|
||||
|
||||
int index = 0;
|
||||
for (final Class<? extends ItemAttribute> attribute : _bowPrefixes)
|
||||
@ -594,7 +594,7 @@ public class GearPage extends ShopPageBase<GearManager, GearShop>
|
||||
{
|
||||
stageTitle = "Select Suffix";
|
||||
|
||||
int[] indices = UtilUI.getIndicesFor(_weaponSuffixes.size(), 1, 5);
|
||||
int[] indices = UtilUI.getIndicesFor(_weaponSuffixes.size(), 1);
|
||||
|
||||
int index = 0;
|
||||
for (final Class<? extends ItemAttribute> attribute : _weaponSuffixes)
|
||||
@ -619,7 +619,7 @@ public class GearPage extends ShopPageBase<GearManager, GearShop>
|
||||
{
|
||||
stageTitle = "Select Suffix";
|
||||
|
||||
int[] indices = UtilUI.getIndicesFor(_armorSuffixes.size(), 1, 5);
|
||||
int[] indices = UtilUI.getIndicesFor(_armorSuffixes.size(), 1);
|
||||
|
||||
int index = 0;
|
||||
for (final Class<? extends ItemAttribute> attribute : _armorSuffixes)
|
||||
@ -643,7 +643,7 @@ public class GearPage extends ShopPageBase<GearManager, GearShop>
|
||||
{
|
||||
stageTitle = "Select Suffix";
|
||||
|
||||
int[] indices = UtilUI.getIndicesFor(_bowSuffixes.size(), 1, 5);
|
||||
int[] indices = UtilUI.getIndicesFor(_bowSuffixes.size(), 1);
|
||||
|
||||
int index = 0;
|
||||
for (final Class<? extends ItemAttribute> attribute : _bowSuffixes)
|
||||
|
Loading…
Reference in New Issue
Block a user