Skip to content

Commit

Permalink
Fix null pointer exception and bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
Sollace committed Jun 6, 2015
1 parent bd8a3da commit 7c06ea9
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ public boolean hasOption(String option) {
return option.equals("delay_min") || option.equals("delay_max");
}

@SuppressWarnings("null")
@Override
public Object getOption(String option) {
return option.equals("delay_min") ? delayMin : option.equals("delay_max") ? delayMax : null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ public class EventSelectorAcoustics implements NamedAcoustic {

private Map<EventType, Acoustic> pairs;

public EventSelectorAcoustics(String name) {
this.name = name;
public EventSelectorAcoustics(String acousticName) {
name = acousticName;
pairs = new HashMap<EventType, Acoustic>();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
import eu.ha3.mc.presencefootsteps.log.PFLog;

public class ProbabilityWeightsAcoustic implements Acoustic {
protected List<Acoustic> acoustics;
protected List<Acoustic> theAcoustics;
protected float probabilityThresholds[];
protected boolean isUseable;

public ProbabilityWeightsAcoustic(List<Acoustic> acoustics, List<Integer> weights) {
acoustics = new ArrayList<Acoustic>(acoustics);
theAcoustics = new ArrayList<Acoustic>(acoustics);
probabilityThresholds = new float[acoustics.size() - 1];

float total = 0;
Expand All @@ -42,7 +42,7 @@ public void playSound(SoundPlayer player, Object location, EventType event, Opti
while (marker < probabilityThresholds.length && probabilityThresholds[marker] < rand) {
marker++;
}
acoustics.get(marker).playSound(player, location, event, inputOptions);
theAcoustics.get(marker).playSound(player, location, event, inputOptions);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
public class PFHaddon extends HaddonImpl implements SupportsFrameEvents, SupportsTickEvents, IResourceManagerReloadListener, NotifiableHaddon, Ha3HoldActions, SupportsKeyEvents {
// Identity
protected final String NAME = "Presence Footsteps";
protected final int VERSION = 6;
protected final int VERSION = 7;
protected final String MCVERSION = "1.8";
protected final String ADDRESS = "http://presencefootsteps.ha3.eu";
protected final Identity identity = (new HaddonIdentity(NAME, VERSION, MCVERSION, ADDRESS)).setPrefix("u");
Expand Down
2 changes: 1 addition & 1 deletion pf-src/litemod.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "eu.ha3.mc.presencefootsteps",
"mcversion": "1.8",
"version": "r6",
"version": "u7",
"revision": "1",
"author": "Hurricaaane (Ha3)",
"url": "http://presencefootsteps.ha3.eu",
Expand Down

0 comments on commit 7c06ea9

Please sign in to comment.