本文整理汇总了Java中cpw.mods.fml.common.TickType类的典型用法代码示例。如果您正苦于以下问题:Java TickType类的具体用法?Java TickType怎么用?Java TickType使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
TickType类属于cpw.mods.fml.common包,在下文中一共展示了TickType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: keyDown
import cpw.mods.fml.common.TickType; //导入依赖的package包/类
public void keyDown( EnumSet< TickType > types, KeyBinding kb, boolean tickEnd, boolean isRepeat )
{
if ( tickEnd )
{
return;
}
if ( kb.keyDescription.equals( ToggleSpawners.toggleKey.keyDescription ) )
{
ToggleSpawners.spawnersActive = !ToggleSpawners.spawnersActive;
}
else if ( kb.keyDescription.equals( ToggleSpawners.renderKey.keyDescription ) )
{
ToggleSpawners.shouldRender = !ToggleSpawners.shouldRender;
}
}
示例2: keyDown
import cpw.mods.fml.common.TickType; //导入依赖的package包/类
@Override
public void keyDown(EnumSet<TickType> type, KeyBinding kb, boolean end, boolean repeats)
{
if (!end)
{
return;
}
int idx = helper.indexOf(kb);
if (type.contains(TickType.CLIENT))
{
armed[idx] = true;
}
if (armed[idx] && type.contains(TickType.RENDER) && (!active[idx] || mlRepeats[idx]))
{
fireKeyEvent(kb);
active[idx] = true;
armed[idx] = false;
}
}
示例3: keyTick
import cpw.mods.fml.common.TickType; //导入依赖的package包/类
private void keyTick(EnumSet<TickType> type, boolean tickEnd)
{
for (int i = 0; i < keyBindings.length; i++)
{
KeyBinding keyBinding = keyBindings[i];
int keyCode = keyBinding.field_74512_d;
boolean state = (keyCode < 0 ? Mouse.isButtonDown(keyCode + 100) : Keyboard.isKeyDown(keyCode));
if (state != keyDown[i] || (state && repeatings[i]))
{
if (state)
{
keyDown(type, keyBinding, tickEnd, state!=keyDown[i]);
}
else
{
keyUp(type, keyBinding, tickEnd);
}
if (tickEnd)
{
keyDown[i] = state;
}
}
}
}
示例4: tickEnd
import cpw.mods.fml.common.TickType; //导入依赖的package包/类
@Override
public void tickEnd(EnumSet<TickType> type, Object... tickData) {
if (!type.contains(TickType.PLAYER)) return;
EntityLivingBase user = (EntityLivingBase) tickData[0];
if (cfg.burnPlayer && user != null && user.ticksExisted % 20 == 0)
{
if(user instanceof EntityPlayer)
{
burnInv((EntityPlayer)user);
}
else if(isHotItem(user.getHeldItem()))
{
user.attackEntityFrom(DamageSource.inFire, 1);
user.playSound("random.fizz", 1.0F, 1.0F);
}
}
}
示例5: tickStart
import cpw.mods.fml.common.TickType; //导入依赖的package包/类
@Override
public void tickStart(EnumSet<TickType> type, Object... tickData) {
if(type.equals(EnumSet.of(TickType.RENDER))){
ShoulderRenderBin.skipPlayerRender = false;
//attempt to ray trace
RayTracer.traceFromEyes(1.0F);
if(ShoulderRenderBin.rayTraceHit != null){
if(ShoulderSurfing.mc.thePlayer != null){
//calculate the difference
ShoulderRenderBin.rayTraceHit.xCoord -= ShoulderSurfing.mc.thePlayer.posX;
ShoulderRenderBin.rayTraceHit.yCoord -= ShoulderSurfing.mc.thePlayer.posY;
ShoulderRenderBin.rayTraceHit.zCoord -= ShoulderSurfing.mc.thePlayer.posZ;
}
}
}
}
示例6: keyDown
import cpw.mods.fml.common.TickType; //导入依赖的package包/类
@Override
public void keyDown(EnumSet<TickType> types, KeyBinding kb, boolean tickEnd, boolean isRepeat) {
/* minecraft ought to be running and with no gui up */
if(ShoulderSurfing.mc != null && ShoulderSurfing.mc.currentScreen == null){
if (ShoulderSurfing.mc.gameSettings.thirdPersonView == 1){
if(kb == ShoulderKeybindings.KEYBIND_ROTATE_CAMERA_LEFT){
ShoulderCamera.adjustCameraLeft();
}
else if(kb == ShoulderKeybindings.KEYBIND_ROTATE_CAMERA_RIGHT){
ShoulderCamera.adjustCameraRight();
}
else if(kb == ShoulderKeybindings.KEYBIND_ZOOM_CAMERA_IN){
ShoulderCamera.adjustCameraIn();
}
else if(kb == ShoulderKeybindings.KEYBIND_ZOOM_CAMERA_OUT){
ShoulderCamera.adjustCameraOut();
}
ShoulderSurfing.writeConfig();
}
}
}
示例7: tickStart
import cpw.mods.fml.common.TickType; //导入依赖的package包/类
@Override
public void tickStart(EnumSet<TickType> type, Object... tickData) {
if(type.equals(EnumSet.of(TickType.RENDER))){
//attempt to ray trace
RayTraceHelper.traceFromEyes(1.0F);
if(ShoulderHelper.rayTraceHit != null){
if(ShoulderSurfing.mc.thePlayer != null){
ShoulderHelper.rayTraceHit.xCoord -= ShoulderSurfing.mc.thePlayer.posX;
ShoulderHelper.rayTraceHit.yCoord -= ShoulderSurfing.mc.thePlayer.posY;
ShoulderHelper.rayTraceHit.zCoord -= ShoulderSurfing.mc.thePlayer.posZ;
}
}
}
}
示例8: sendTick
import cpw.mods.fml.common.TickType; //导入依赖的package包/类
private void sendTick(EnumSet<TickType> types, boolean end, Object... tickData)
{
for (TickType type : types)
{
if (!ticks.contains(type))
{
continue;
}
boolean keepTicking=true;
if (sendGuiTicks)
{
keepTicking = mod.doTickInGUI(type, end, tickData);
}
else
{
keepTicking = mod.doTickInGame(type, end, tickData);
}
if (!keepTicking) {
ticks.remove(type);
ticks.removeAll(type.partnerTicks());
}
}
}
示例9: tickStart
import cpw.mods.fml.common.TickType; //导入依赖的package包/类
@Override
public void tickStart(EnumSet<TickType> type, Object... tickData) {
if(type.equals(EnumSet.of(TickType.RENDER))){
ShoulderRenderBin.skipPlayerRender = false;
//attempt to ray trace
RayTracer.traceFromEyes(1.0F);
if(ShoulderRenderBin.rayTraceHit != null){
if(ShoulderLoader.mc.thePlayer != null){
//calculate the difference
ShoulderRenderBin.rayTraceHit.xCoord -= ShoulderLoader.mc.thePlayer.posX;
ShoulderRenderBin.rayTraceHit.yCoord -= ShoulderLoader.mc.thePlayer.posY;
ShoulderRenderBin.rayTraceHit.zCoord -= ShoulderLoader.mc.thePlayer.posZ;
}
}
}
}
示例10: keyDown
import cpw.mods.fml.common.TickType; //导入依赖的package包/类
@Override
public void keyDown(EnumSet<TickType> types, KeyBinding kb, boolean tickEnd, boolean isRepeat) {
/* minecraft ought to be running and with no gui up */
if(ShoulderLoader.mc != null && ShoulderLoader.mc.currentScreen == null){
if (ShoulderLoader.mc.gameSettings.thirdPersonView == 1){
if(kb == ShoulderKeybindings.KEYBIND_ROTATE_CAMERA_LEFT){
ShoulderCamera.adjustCameraLeft();
}
else if(kb == ShoulderKeybindings.KEYBIND_ROTATE_CAMERA_RIGHT){
ShoulderCamera.adjustCameraRight();
}
else if(kb == ShoulderKeybindings.KEYBIND_ZOOM_CAMERA_IN){
ShoulderCamera.adjustCameraIn();
}
else if(kb == ShoulderKeybindings.KEYBIND_ZOOM_CAMERA_OUT){
ShoulderCamera.adjustCameraOut();
}
ShoulderSurfing.writeConfig();
}
}
}
示例11: keyDown
import cpw.mods.fml.common.TickType; //导入依赖的package包/类
@Override
public void keyDown(EnumSet<TickType> types, KeyBinding kb, boolean tickEnd, boolean isRepeat) {
if (ShoulderSurfing.mc.gameSettings.thirdPersonView == 1 ){
if(kb == ShoulderKeybindings.KEYBIND_ROTATE_CAMERA_LEFT){
ShoulderHelper.adjustCameraLeft();
}
else if(kb == ShoulderKeybindings.KEYBIND_ROTATE_CAMERA_RIGHT){
ShoulderHelper.adjustCameraRight();
}
else if(kb == ShoulderKeybindings.KEYBIND_ZOOM_CAMERA_IN){
ShoulderHelper.adjustCameraIn();
}
else if(kb == ShoulderKeybindings.KEYBIND_ZOOM_CAMERA_OUT){
ShoulderHelper.adjustCameraOut();
}
ShoulderSurfing.writeConfig();
}
}
示例12: tickStart
import cpw.mods.fml.common.TickType; //导入依赖的package包/类
@Override
public void tickStart(EnumSet<TickType> type, Object... tickData) {
long tick = System.nanoTime();
//If one second has passed
if (tick - lastTick > 1000000000) {
lastTick = lastTick + 1000000000;
secondsRemaining--;
if (secondsRemaining == 0) {
event.countdownOver();
tickType = EnumSet.noneOf(TickType.class);
}
if (notifications.containsKey(secondsRemaining)) {
Chat.sendToAllPlayers(notifications.get(secondsRemaining));
}
}
}
示例13: keyTick
import cpw.mods.fml.common.TickType; //导入依赖的package包/类
private void keyTick(EnumSet<TickType> type, boolean tickEnd)
{
for (int i = 0; i < keyBindings.length; i++)
{
KeyBinding keyBinding = keyBindings[i];
int keyCode = keyBinding.keyCode;
boolean state = (keyCode < 0 ? Mouse.isButtonDown(keyCode + 100) : Keyboard.isKeyDown(keyCode));
if (state != keyDown[i] || (state && repeatings[i]))
{
if (state)
{
keyDown(type, keyBinding, tickEnd, state!=keyDown[i]);
}
else
{
keyUp(type, keyBinding, tickEnd);
}
if (tickEnd)
{
keyDown[i] = state;
}
}
}
}
示例14: tickEnd
import cpw.mods.fml.common.TickType; //导入依赖的package包/类
@Override
public void tickEnd( EnumSet< TickType > type, Object... tickData )
{
Minecraft mc = FMLClientHandler.instance().getClient();
if ( mc.currentScreen == null && ToggleSpawners.shouldRenderText() )
{
GL11.glColor3f( 1.f, 1.f, 1.f );
String str = "Spawners " + ( ToggleSpawners.areSpawnersActive() ? "Active" : "Inactive" );
mc.fontRenderer.drawStringWithShadow( str, 5, 5, 0xFFFFFFFF );
}
}
示例15: tickEnd
import cpw.mods.fml.common.TickType; //导入依赖的package包/类
@Override
public void tickEnd( EnumSet< TickType > type, Object... tickData )
{
EntityPlayer player = ( EntityPlayer ) tickData[ 0 ];
if ( player.worldObj.isRemote )
{
return;
}
Long time = lastTickTimes.get( player );
if ( time == null )
{
lastTickTimes.put( player, new Long( System.currentTimeMillis() ) );
time = lastTickTimes.get( player );
}
Long curr = System.currentTimeMillis();
if ( Math.abs( time - curr ) >= 1000 )
{
lastTickTimes.put( player, curr );
int resist = 1;
InventoryPlayer inv = player.inventory;
for ( ItemStack stack : inv.armorInventory )
{
resist += checkItem( stack ) * 5;
}
if ( resist == 1 || rand.nextInt( resist ) == 0 )
{
doToxicRain( player );
}
}
}