Change PowerMixin to newer setup
This commit is contained in:
		@@ -1,12 +1,46 @@
 | 
			
		||||
package com.massivecraft.factions.mixin;
 | 
			
		||||
 | 
			
		||||
import com.massivecraft.factions.entity.MConf;
 | 
			
		||||
import com.massivecraft.factions.entity.MPlayer;
 | 
			
		||||
import com.massivecraft.massivecore.mixin.Mixin;
 | 
			
		||||
 | 
			
		||||
public interface PowerMixin
 | 
			
		||||
public class PowerMixin extends Mixin
 | 
			
		||||
{
 | 
			
		||||
	public double getMaxUniversal(MPlayer mplayer);
 | 
			
		||||
	public double getMax(MPlayer mplayer);
 | 
			
		||||
	public double getMin(MPlayer mplayer);
 | 
			
		||||
	public double getPerHour(MPlayer mplayer);
 | 
			
		||||
	public double getPerDeath(MPlayer mplayer);
 | 
			
		||||
	// -------------------------------------------- //
 | 
			
		||||
	// INSTANCE & CONSTRUCT
 | 
			
		||||
	// -------------------------------------------- //
 | 
			
		||||
 | 
			
		||||
	private static PowerMixin d = new PowerMixin();
 | 
			
		||||
	private static PowerMixin i = d;
 | 
			
		||||
	public static PowerMixin get() { return i; }
 | 
			
		||||
 | 
			
		||||
	// -------------------------------------------- //
 | 
			
		||||
	// METHODS
 | 
			
		||||
	// -------------------------------------------- //
 | 
			
		||||
 | 
			
		||||
	public double getMaxUniversal(MPlayer mplayer)
 | 
			
		||||
	{
 | 
			
		||||
		return this.getMax(mplayer);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	public double getMax(MPlayer mplayer)
 | 
			
		||||
	{
 | 
			
		||||
		return MConf.get().powerMax + mplayer.getPowerBoost();
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	public double getMin(MPlayer mplayer)
 | 
			
		||||
	{
 | 
			
		||||
		return MConf.get().powerMin;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	public double getPerHour(MPlayer mplayer)
 | 
			
		||||
	{
 | 
			
		||||
		return MConf.get().powerPerHour;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	public double getPerDeath(MPlayer mplayer)
 | 
			
		||||
	{
 | 
			
		||||
		return MConf.get().powerPerDeath;
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -1,49 +0,0 @@
 | 
			
		||||
package com.massivecraft.factions.mixin;
 | 
			
		||||
 | 
			
		||||
import com.massivecraft.factions.entity.MConf;
 | 
			
		||||
import com.massivecraft.factions.entity.MPlayer;
 | 
			
		||||
 | 
			
		||||
public class PowerMixinDefault implements PowerMixin
 | 
			
		||||
{
 | 
			
		||||
	// -------------------------------------------- //
 | 
			
		||||
	// INSTANCE & CONSTRUCT
 | 
			
		||||
	// -------------------------------------------- //
 | 
			
		||||
	
 | 
			
		||||
	private static PowerMixinDefault i = new PowerMixinDefault();
 | 
			
		||||
	public static PowerMixinDefault get() { return i; }
 | 
			
		||||
	
 | 
			
		||||
	// -------------------------------------------- //
 | 
			
		||||
	// OVERRIDE: PowerMixin
 | 
			
		||||
	// -------------------------------------------- //
 | 
			
		||||
 | 
			
		||||
	@Override
 | 
			
		||||
	public double getMaxUniversal(MPlayer mplayer)
 | 
			
		||||
	{
 | 
			
		||||
		return this.getMax(mplayer);
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	@Override
 | 
			
		||||
	public double getMax(MPlayer mplayer)
 | 
			
		||||
	{
 | 
			
		||||
		return MConf.get().powerMax + mplayer.getPowerBoost();
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	@Override
 | 
			
		||||
	public double getMin(MPlayer mplayer)
 | 
			
		||||
	{
 | 
			
		||||
		return MConf.get().powerMin;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	@Override
 | 
			
		||||
	public double getPerHour(MPlayer mplayer)
 | 
			
		||||
	{
 | 
			
		||||
		return MConf.get().powerPerHour;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	@Override
 | 
			
		||||
	public double getPerDeath(MPlayer mplayer)
 | 
			
		||||
	{
 | 
			
		||||
		return MConf.get().powerPerDeath;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user