Skip to content

Commit

Permalink
Can get permissions of original casing with .getExactPermission() in …
Browse files Browse the repository at this point in the history
…PermissionAttachmentInfo
  • Loading branch information
NodiusC committed Apr 21, 2012
1 parent a75cbbf commit 3379cca
Show file tree
Hide file tree
Showing 18 changed files with 337 additions and 344 deletions.
Expand Up @@ -3,7 +3,6 @@
import java.util.Arrays;
import org.bukkit.ChatColor;
import org.bukkit.Bukkit;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.plugin.Plugin;

Expand Down
Expand Up @@ -3,7 +3,6 @@
import java.util.Arrays;
import org.bukkit.ChatColor;
import org.bukkit.Bukkit;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;

public class ReloadCommand extends BukkitCommand {
Expand Down
Expand Up @@ -6,7 +6,6 @@

import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
Expand Down
Expand Up @@ -5,7 +5,6 @@

import org.bukkit.ChatColor;
import org.bukkit.Bukkit;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.PluginDescriptionFile;
Expand Down
2 changes: 0 additions & 2 deletions src/main/java/org/bukkit/conversations/Conversable.java
@@ -1,7 +1,5 @@
package org.bukkit.conversations;

import org.bukkit.command.CommandSender;

/**
* The Conversable interface is used to indicate objects that can have conversations.
*/
Expand Down
@@ -1,7 +1,5 @@
package org.bukkit.conversations;

import org.bukkit.command.CommandSender;

/**
* A ConversationPrefix implementation prepends all output from the conversation to the player.
* The ConversationPrefix can be used to display the plugin name or conversation status as the conversation evolves.
Expand Down
@@ -1,6 +1,5 @@
package org.bukkit.conversations;

import org.bukkit.Server;
import org.bukkit.plugin.Plugin;

/**
Expand Down
@@ -1,7 +1,5 @@
package org.bukkit.conversations;

import org.bukkit.command.CommandSender;

/**
* NullConversationPrefix is a {@link ConversationPrefix} implementation that displays nothing in front of
* conversation output.
Expand Down
@@ -1,7 +1,6 @@
package org.bukkit.conversations;

import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender;
import org.bukkit.plugin.Plugin;

/**
Expand Down
138 changes: 69 additions & 69 deletions src/main/java/org/bukkit/event/entity/ExpBottleEvent.java
@@ -1,69 +1,69 @@
package org.bukkit.event.entity;

import org.bukkit.entity.ThrownExpBottle;
import org.bukkit.event.HandlerList;

/**
* Called when a ThrownExpBottle hits and releases experience.
*/
public class ExpBottleEvent extends ProjectileHitEvent {
private static final HandlerList handlers = new HandlerList();
private int exp;
private boolean showEffect = true;

public ExpBottleEvent(final ThrownExpBottle bottle, final int exp) {
super(bottle);
this.exp = exp;
}

@Override
public ThrownExpBottle getEntity() {
return (ThrownExpBottle) entity;
}

/**
* This method indicates if the particle effect should be shown.
* @return true if the effect will be shown, false otherwise
*/
public boolean getShowEffect() {
return this.showEffect;
}

/**
* This method sets if the particle effect will be shown.
* This does not change the experience created.
* @param showEffect
* true indicates the effect will be shown,
* false indicates no effect will be shown
*/
public void setShowEffect(final boolean showEffect) {
this.showEffect = showEffect;
}

/**
* This method retrieves the amount of experience to be created.
* The number indicates a total amount to be divided into orbs.
* @return the total amount of experience to be created
*/
public int getExperience() {
return exp;
}

/**
* This method sets the amount of experience to be created.
* The number indicates a total amount to be divided into orbs.
* @param exp the total amount of experience to be created
*/
public void setExperience(final int exp) {
this.exp = exp;
}

@Override
public HandlerList getHandlers() {
return handlers;
}

public static HandlerList getHandlerList() {
return handlers;
}
}
package org.bukkit.event.entity;

import org.bukkit.entity.ThrownExpBottle;
import org.bukkit.event.HandlerList;

/**
* Called when a ThrownExpBottle hits and releases experience.
*/
public class ExpBottleEvent extends ProjectileHitEvent {
private static final HandlerList handlers = new HandlerList();
private int exp;
private boolean showEffect = true;

public ExpBottleEvent(final ThrownExpBottle bottle, final int exp) {
super(bottle);
this.exp = exp;
}

@Override
public ThrownExpBottle getEntity() {
return (ThrownExpBottle) entity;
}

/**
* This method indicates if the particle effect should be shown.
* @return true if the effect will be shown, false otherwise
*/
public boolean getShowEffect() {
return this.showEffect;
}

/**
* This method sets if the particle effect will be shown.
* This does not change the experience created.
* @param showEffect
* true indicates the effect will be shown,
* false indicates no effect will be shown
*/
public void setShowEffect(final boolean showEffect) {
this.showEffect = showEffect;
}

/**
* This method retrieves the amount of experience to be created.
* The number indicates a total amount to be divided into orbs.
* @return the total amount of experience to be created
*/
public int getExperience() {
return exp;
}

/**
* This method sets the amount of experience to be created.
* The number indicates a total amount to be divided into orbs.
* @param exp the total amount of experience to be created
*/
public void setExperience(final int exp) {
this.exp = exp;
}

@Override
public HandlerList getHandlers() {
return handlers;
}

public static HandlerList getHandlerList() {
return handlers;
}
}
186 changes: 93 additions & 93 deletions src/main/java/org/bukkit/event/entity/PotionSplashEvent.java
@@ -1,93 +1,93 @@
package org.bukkit.event.entity;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Map;

import org.apache.commons.lang.Validate;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.ThrownPotion;
import org.bukkit.event.Cancellable;
import org.bukkit.event.HandlerList;

/**
* Called when a splash potion hits an area
*/
public class PotionSplashEvent extends ProjectileHitEvent implements Cancellable {
private static final HandlerList handlers = new HandlerList();
private boolean cancelled;
private final Map<LivingEntity, Double> affectedEntities;

public PotionSplashEvent(final ThrownPotion potion, final Map<LivingEntity, Double> affectedEntities) {
super(potion);

this.affectedEntities = affectedEntities;
}

@Override
public ThrownPotion getEntity() {
return (ThrownPotion) entity;
}

/**
* Gets the potion which caused this event
*
* @return The thrown potion entity
*/
public ThrownPotion getPotion() {
return (ThrownPotion) getEntity();
}

/**
* Retrieves a list of all effected entities
*
* @return A fresh copy of the affected entity list
*/
public Collection<LivingEntity> getAffectedEntities() {
return new ArrayList<LivingEntity>(affectedEntities.keySet());
}

/**
* Gets the intensity of the potion's effects for given entity;
* This depends on the distance to the impact center
*
* @param entity Which entity to get intensity for
* @return intensity relative to maximum effect; 0.0: not affected; 1.0: fully hit by potion effects
*/
public double getIntensity(LivingEntity entity) {
Double intensity = affectedEntities.get(entity);
return intensity != null ? intensity : 0.0;
}

/**
* Overwrites the intensity for a given entity
*
* @param entity For which entity to define a new intensity
* @param intensity relative to maximum effect
*/
public void setIntensity(LivingEntity entity, double intensity) {
Validate.notNull(entity, "You must specify a valid entity.");
if (intensity <= 0.0) {
affectedEntities.remove(entity);
} else {
affectedEntities.put(entity, Math.min(intensity, 1.0));
}
}

public boolean isCancelled() {
return cancelled;
}

public void setCancelled(boolean cancel) {
cancelled = cancel;
}

@Override
public HandlerList getHandlers() {
return handlers;
}

public static HandlerList getHandlerList() {
return handlers;
}
}
package org.bukkit.event.entity;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Map;

import org.apache.commons.lang.Validate;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.ThrownPotion;
import org.bukkit.event.Cancellable;
import org.bukkit.event.HandlerList;

/**
* Called when a splash potion hits an area
*/
public class PotionSplashEvent extends ProjectileHitEvent implements Cancellable {
private static final HandlerList handlers = new HandlerList();
private boolean cancelled;
private final Map<LivingEntity, Double> affectedEntities;

public PotionSplashEvent(final ThrownPotion potion, final Map<LivingEntity, Double> affectedEntities) {
super(potion);

this.affectedEntities = affectedEntities;
}

@Override
public ThrownPotion getEntity() {
return (ThrownPotion) entity;
}

/**
* Gets the potion which caused this event
*
* @return The thrown potion entity
*/
public ThrownPotion getPotion() {
return (ThrownPotion) getEntity();
}

/**
* Retrieves a list of all effected entities
*
* @return A fresh copy of the affected entity list
*/
public Collection<LivingEntity> getAffectedEntities() {
return new ArrayList<LivingEntity>(affectedEntities.keySet());
}

/**
* Gets the intensity of the potion's effects for given entity;
* This depends on the distance to the impact center
*
* @param entity Which entity to get intensity for
* @return intensity relative to maximum effect; 0.0: not affected; 1.0: fully hit by potion effects
*/
public double getIntensity(LivingEntity entity) {
Double intensity = affectedEntities.get(entity);
return intensity != null ? intensity : 0.0;
}

/**
* Overwrites the intensity for a given entity
*
* @param entity For which entity to define a new intensity
* @param intensity relative to maximum effect
*/
public void setIntensity(LivingEntity entity, double intensity) {
Validate.notNull(entity, "You must specify a valid entity.");
if (intensity <= 0.0) {
affectedEntities.remove(entity);
} else {
affectedEntities.put(entity, Math.min(intensity, 1.0));
}
}

public boolean isCancelled() {
return cancelled;
}

public void setCancelled(boolean cancel) {
cancelled = cancel;
}

@Override
public HandlerList getHandlers() {
return handlers;
}

public static HandlerList getHandlerList() {
return handlers;
}
}

0 comments on commit 3379cca

Please sign in to comment.