本文整理匯總了Java中net.minecraftforge.fml.relauncher.SideOnly類的典型用法代碼示例。如果您正苦於以下問題:Java SideOnly類的具體用法?Java SideOnly怎麽用?Java SideOnly使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
SideOnly類屬於net.minecraftforge.fml.relauncher包,在下文中一共展示了SideOnly類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: addInformation
import net.minecraftforge.fml.relauncher.SideOnly; //導入依賴的package包/類
@SideOnly(Side.CLIENT)
@Override
public void addInformation(ItemStack is, @Nullable World worldIn, List<String> list, ITooltipFlag flag)
{
NBTTagCompound tag = is.getTagCompound();
if(tag != null)
{
Instrument instrument = InstrumentLibrary.getInstrumentByName(tag.getString("itemName"));
if(instrument != null)
{
list.add(I18n.translateToLocal("item.clef.instrument." + instrument.info.itemName + ".desc"));
list.add(I18n.translateToLocal(instrument.info.twoHanded && Clef.config.allowOneHandedTwoHandedInstrumentUse == 0 ? "clef.item.twoHanded" : "clef.item.oneHanded"));
if(GuiScreen.isShiftKeyDown())
{
list.add("");
list.add(I18n.translateToLocal("clef.item.packName") + ": " + instrument.packInfo.packName);
list.add(I18n.translateToLocal("clef.item.itemName") + ": " + instrument.info.itemName);
}
}
}
}
示例2: pressUnicode
import net.minecraftforge.fml.relauncher.SideOnly; //導入依賴的package包/類
@SideOnly(Side.CLIENT)
public static void pressUnicode(Robot r, int key_code) {
r.keyPress(KeyEvent.VK_ALT);
for(int i = 3; i >= 0; --i) {
int numpad_kc = key_code / (int) (Math.pow(10, i)) % 10 + KeyEvent.VK_NUMPAD0;
r.keyPress(numpad_kc);
r.keyRelease(numpad_kc);
}
r.keyRelease(KeyEvent.VK_ALT);
}
示例3: randomDisplayTick
import net.minecraftforge.fml.relauncher.SideOnly; //導入依賴的package包/類
@SideOnly(Side.CLIENT)
public void randomDisplayTick(IBlockState stateIn, World worldIn, BlockPos pos, Random rand)
{
if (rand.nextInt(16) == 0)
{
BlockPos blockpos = pos.down();
if (canFallThrough(worldIn.getBlockState(blockpos)))
{
double d0 = (double)((float)pos.getX() + rand.nextFloat());
double d1 = (double)pos.getY() - 0.05D;
double d2 = (double)((float)pos.getZ() + rand.nextFloat());
worldIn.spawnParticle(EnumParticleTypes.FALLING_DUST, d0, d1, d2, 0.0D, 0.0D, 0.0D, new int[] {Block.getStateId(stateIn)});
}
}
}
示例4: setVelocity
import net.minecraftforge.fml.relauncher.SideOnly; //導入依賴的package包/類
/**
* Updates the velocity of the entity to a new value.
*/
@SideOnly(Side.CLIENT)
public void setVelocity(double x, double y, double z)
{
this.motionX = x;
this.motionY = y;
this.motionZ = z;
if (this.prevRotationPitch == 0.0F && this.prevRotationYaw == 0.0F)
{
float f = MathHelper.sqrt_double(x * x + z * z);
this.rotationPitch = (float)(MathHelper.atan2(y, (double)f) * (180D / Math.PI));
this.rotationYaw = (float)(MathHelper.atan2(x, z) * (180D / Math.PI));
this.prevRotationPitch = this.rotationPitch;
this.prevRotationYaw = this.rotationYaw;
this.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, this.rotationPitch);
this.ticksInGround = 0;
}
}
示例5: shouldRenderSides
import net.minecraftforge.fml.relauncher.SideOnly; //導入依賴的package包/類
@SideOnly(Side.CLIENT)
public boolean shouldRenderSides(IBlockAccess blockAccess, BlockPos pos)
{
for (int i = -1; i <= 1; ++i)
{
for (int j = -1; j <= 1; ++j)
{
IBlockState iblockstate = blockAccess.getBlockState(pos.add(i, 0, j));
if (iblockstate.getMaterial() != this.blockMaterial && !iblockstate.isFullBlock())
{
return true;
}
}
}
return false;
}
示例6: InjectDedicated
import net.minecraftforge.fml.relauncher.SideOnly; //導入依賴的package包/類
@SideOnly(Side.SERVER)
public static void InjectDedicated(MinecraftServer server)
{
PlayerList playerList = server.getPlayerList();
try {
if (playerList instanceof DedicatedPlayerList)
{
server.setPlayerList(new HookedDedicatedPlayerList((DedicatedPlayerList)playerList));
}
else
{
// uh ho...
Util.logger.error("Unable to inject custom PlayerList into server due to unknown type! PlayerList was of type {}.", playerList.getClass().toString());
}
} catch (IllegalAccessException | NoSuchFieldException | SecurityException e) {
Util.logger.logException("Exception trying to inject custom PlayerList into server!", e);
}
}
示例7: updateProgressBar
import net.minecraftforge.fml.relauncher.SideOnly; //導入依賴的package包/類
@SideOnly(Side.CLIENT)
public void updateProgressBar(int barId, int newValue)
{
if (barId == 0)
{
tileEntity.cookTime = newValue;
}
if (barId == 1)
{
tileEntity.burnTime = newValue;
}
if (barId == 2)
{
tileEntity.currentItemBurnTime = newValue;
}
if (barId == 3)
{
tileEntity.decayTime = newValue;
}
}
示例8: render
import net.minecraftforge.fml.relauncher.SideOnly; //導入依賴的package包/類
@Override
@SideOnly(Side.CLIENT)
public void render(float width) {
//Render ties using current texture but with dynamic width.
//This will cause stretching of the texture, but it ensures uniformity for all sizes.
GL11.glBegin(GL11.GL_QUADS);
renderTieBottom(width);
renderTieTop(width);
renderTieFront(width);
renderTieRear(width);
renderTieLeft(width);
renderTieRight(width);
GL11.glEnd();
}
示例9: getSubBlocks
import net.minecraftforge.fml.relauncher.SideOnly; //導入依賴的package包/類
@Override
@SideOnly(Side.CLIENT)
public void getSubBlocks(CreativeTabs tab, NonNullList<ItemStack> list) {
if (tab!=this.getCreativeTabToDisplayOn()) return;
for (int i=0; i<16; i++) {
list.add(new ItemStack(ItemBlock.getItemFromBlock(this), 1, i));
}
}
示例10: init
import net.minecraftforge.fml.relauncher.SideOnly; //導入依賴的package包/類
@SideOnly(Side.CLIENT)
@EventHandler
public void init(FMLInitializationEvent event) {
overlayRenderer = new LithiumOverlay();
MinecraftForge.EVENT_BUS.register(NetworkEventHandler.INSTANCE);
MinecraftForge.EVENT_BUS.register(overlayRenderer);
network = NetworkRegistry.INSTANCE.newSimpleChannel(LithiumMod.CHANNELNAME);
Handle.setPacketHandler(new PacketHandlerImpl());
getSimpleNetworkWrapper().registerMessage(Handle.class, LithiumMessage.class, 0, Side.CLIENT);
}
示例11: getSubBlocks
import net.minecraftforge.fml.relauncher.SideOnly; //導入依賴的package包/類
/**
* returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks)
*/
@SideOnly(Side.CLIENT)
public void getSubBlocks(Item itemIn, CreativeTabs tab, List<ItemStack> list)
{
if (itemIn != Item.getItemFromBlock(Blocks.DOUBLE_STONE_SLAB))
{
for (BlockStoneSlab.EnumType blockstoneslab$enumtype : BlockStoneSlab.EnumType.values())
{
if (blockstoneslab$enumtype != BlockStoneSlab.EnumType.WOOD)
{
list.add(new ItemStack(itemIn, 1, blockstoneslab$enumtype.getMetadata()));
}
}
}
}
示例12: addClientHandlers
import net.minecraftforge.fml.relauncher.SideOnly; //導入依賴的package包/類
@SideOnly(Side.CLIENT)
private static void addClientHandlers()
{
FMLEmbeddedChannel clientChannel = channelPair.get(Side.CLIENT);
String handlerName = clientChannel.findChannelHandlerNameForType(ForgeRuntimeCodec.class);
clientChannel.pipeline().addAfter(handlerName, "DimensionHandler", new DimensionMessageHandler());
clientChannel.pipeline().addAfter(handlerName, "FluidIdRegistryHandler", new FluidIdRegistryMessageHandler());
}
示例13: onModelLoad
import net.minecraftforge.fml.relauncher.SideOnly; //導入依賴的package包/類
@SubscribeEvent
@SideOnly(Side.CLIENT)
public void onModelLoad(ModelRegistryEvent ev) {
RandoresBlocks.registerModels();
RandoresItems.registerModels();
CraftingBlocks.registerModels();
CraftingItems.registerModels();
}
示例14: getLightFor
import net.minecraftforge.fml.relauncher.SideOnly; //導入依賴的package包/類
@SideOnly(Side.CLIENT)
public int getLightFor(EnumSkyBlock p_175628_1_, BlockPos pos)
{
if (pos.getY() >= 0 && pos.getY() < 256)
{
int i = (pos.getX() >> 4) - this.chunkX;
int j = (pos.getZ() >> 4) - this.chunkZ;
if (i < 0 || i >= chunkArray.length || j < 0 || j >= chunkArray[i].length) return p_175628_1_.defaultLightValue;
return this.chunkArray[i][j].getLightFor(p_175628_1_, pos);
}
else
{
return p_175628_1_.defaultLightValue;
}
}
示例15: getTabIconItem
import net.minecraftforge.fml.relauncher.SideOnly; //導入依賴的package包/類
@Override
@SideOnly(Side.CLIENT)
public ItemStack getTabIconItem() {
ItemStack stack = new ItemStack(ModItems.pickaxe);
NBTTagCompound tag = new NBTTagCompound();
tag.setString(IHeadTool.HEAD_TAG, "iron");
tag.setString(IHaftTool.HAFT_TAG, "wood");
tag.setString(IHandleTool.HANDLE_TAG, "leather");
tag.setString(IAdornedTool.ADORNMENT_TAG, "diamond");
stack.setTagCompound(tag);
return stack;
}