
I redone where the items/blocsks are stored and how the configs are handled to clean up it and give space. You can change the config line to AWWayofTime if you want to keep the compatibility with old configs. Now you reference the blocks from the ModBlocks and Items from the ModItems.
48 lines
1.4 KiB
Java
48 lines
1.4 KiB
Java
package WayofTime.alchemicalWizardry.common;
|
|
|
|
import cpw.mods.fml.common.ITickHandler;
|
|
import cpw.mods.fml.common.ObfuscationReflectionHelper;
|
|
import cpw.mods.fml.common.TickType;
|
|
import net.minecraft.entity.player.EntityPlayer;
|
|
import net.minecraft.entity.player.PlayerCapabilities;
|
|
import net.minecraft.server.MinecraftServer;
|
|
|
|
import java.util.EnumSet;
|
|
|
|
public class AlchemicalWizardryTickHandler implements ITickHandler {
|
|
public void tickStart(EnumSet<TickType> type, Object... tickData)
|
|
{
|
|
}
|
|
|
|
public EnumSet<TickType> ticks()
|
|
{
|
|
return EnumSet.of(TickType.PLAYER);
|
|
}
|
|
|
|
public String getLabel()
|
|
{
|
|
return "BloodMagic";
|
|
}
|
|
|
|
public void tickEnd(EnumSet<TickType> type, Object... tickData)
|
|
{
|
|
String[] usernames = MinecraftServer.getServer().getAllUsernames();
|
|
|
|
if (usernames == null)
|
|
{
|
|
return;
|
|
}
|
|
|
|
for (String userName : usernames)
|
|
{
|
|
EntityPlayer entityPlayer = MinecraftServer.getServer().getConfigurationManager().getPlayerForUsername(userName);
|
|
|
|
if (entityPlayer != null)
|
|
{
|
|
ObfuscationReflectionHelper.setPrivateValue(PlayerCapabilities.class, entityPlayer.capabilities, Float.valueOf(0.1f), new String[]{"walkSpeed", "g", "field_75097_g"});
|
|
//entityPlayer.sendPlayerAbilities();
|
|
}
|
|
}
|
|
}
|
|
}
|