本文整理匯總了Java中net.minecraftforge.fml.relauncher.Side類的典型用法代碼示例。如果您正苦於以下問題:Java Side類的具體用法?Java Side怎麽用?Java Side使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
Side類屬於net.minecraftforge.fml.relauncher包,在下文中一共展示了Side類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: doRenderLayer
import net.minecraftforge.fml.relauncher.Side; //導入依賴的package包/類
@SideOnly(Side.CLIENT)
@Override
public void doRenderLayer(AbstractClientPlayer entitylivingbaseIn, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale) {
if (!Arrays.asList(contributors.uuid).contains(entitylivingbaseIn.getUniqueID().toString())) return;
if (!entitylivingbaseIn.isWearing(EnumPlayerModelParts.CAPE)) return;
GlStateManager.pushMatrix();
GlStateManager.enableBlend();
GlStateManager.disableCull();
RenderHelper.disableStandardItemLighting();
if (Minecraft.isAmbientOcclusionEnabled()) {
GlStateManager.shadeModel(GL11.GL_SMOOTH);
} else {
GlStateManager.shadeModel(GL11.GL_FLAT);
}
GlStateManager.translate(0, -0.015f, 0);
if (!entitylivingbaseIn.inventory.armorInventory.get(3).isEmpty()) GlStateManager.translate(0, -0.02f, 0);
if (entitylivingbaseIn.isSneaking()) GlStateManager.translate(0, 0.27, 0);
GlStateManager.rotate(90, 0, 1, 0);
GlStateManager.rotate(180, 1, 0, 0);
GlStateManager.rotate(netHeadYaw, 0, -1, 0);
GlStateManager.rotate(headPitch, 0, 0, -1);
Minecraft.getMinecraft().getTextureManager().bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
Calendar calendar = Calendar.getInstance();
if (calendar.get(Calendar.MONTH) == Calendar.OCTOBER) {
spookyScarySkeletons();
} else if (calendar.get(Calendar.MONTH) == Calendar.DECEMBER) {
itsSnowyHere();
} else {
Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelRenderer().renderModelBrightnessColor(ClientProxy.ears_baked, 0.5f, 255, 255, 255);
}
RenderHelper.enableStandardItemLighting();
GlStateManager.depthMask(true);
GlStateManager.popMatrix();
}
示例2: randomDisplayTick
import net.minecraftforge.fml.relauncher.Side; //導入依賴的package包/類
@SideOnly(Side.CLIENT)
public void randomDisplayTick(IBlockState stateIn, World worldIn, BlockPos pos, Random rand)
{
for (int i = 0; i < 3; ++i)
{
int j = rand.nextInt(2) * 2 - 1;
int k = rand.nextInt(2) * 2 - 1;
double d0 = (double)pos.getX() + 0.5D + 0.25D * (double)j;
double d1 = (double)((float)pos.getY() + rand.nextFloat());
double d2 = (double)pos.getZ() + 0.5D + 0.25D * (double)k;
double d3 = (double)(rand.nextFloat() * (float)j);
double d4 = ((double)rand.nextFloat() - 0.5D) * 0.125D;
double d5 = (double)(rand.nextFloat() * (float)k);
worldIn.spawnParticle(EnumParticleTypes.PORTAL, d0, d1, d2, d3, d4, d5, new int[0]);
}
}
示例3: init
import net.minecraftforge.fml.relauncher.Side; //導入依賴的package包/類
@Mod.EventHandler
public void init(FMLInitializationEvent event) {
CapabilityExtendedHealthSystem.register();
int i = 0;
NETWORKING = NetworkRegistry.INSTANCE.newSimpleChannel(MODID);
NETWORKING.registerMessage(MessageReceiveDamage.Handler.class, MessageReceiveDamage.class, ++i, Side.CLIENT);
NETWORKING.registerMessage(MessageApplyHealingItem.Handler.class, MessageApplyHealingItem.class, ++i , Side.SERVER);
NETWORKING.registerMessage(MessageReceiveConfiguration.Handler.class, MessageReceiveConfiguration.class, ++i, Side.CLIENT);
NETWORKING.registerMessage(MessageApplyAbsorption.Handler.class, MessageApplyAbsorption.class, ++i, Side.CLIENT);
NETWORKING.registerMessage(MessageAddHealth.Handler.class, MessageAddHealth.class, ++i, Side.CLIENT);
NETWORKING.registerMessage(MessagePlayHurtSound.Handler.class, MessagePlayHurtSound.class, ++i, Side.CLIENT);
NETWORKING.registerMessage(MessageClientUpdate.Handler.class, MessageClientUpdate.class, ++i, Side.SERVER);
NETWORKING.registerMessage(MessageResync.Handler.class, MessageResync.class, ++i, Side.CLIENT);
MessageReceiveConfiguration.validate();
if (Loader.isModLoaded("morpheus")) {
enableMorpheusCompat = true;
logger.info("Morpheus present - enabling compatibility module");
MorpheusHelper.register();
}
RegistryManager.registerDefaults();
checkEarlyExit();
}
示例4: handleStatusUpdate
import net.minecraftforge.fml.relauncher.Side; //導入依賴的package包/類
@SideOnly(Side.CLIENT)
public void handleStatusUpdate(byte id)
{
if (id == 12)
{
this.spawnParticles(EnumParticleTypes.HEART);
}
else if (id == 13)
{
this.spawnParticles(EnumParticleTypes.VILLAGER_ANGRY);
}
else if (id == 14)
{
this.spawnParticles(EnumParticleTypes.VILLAGER_HAPPY);
}
else
{
super.handleStatusUpdate(id);
}
}
示例5: randomDisplayTick
import net.minecraftforge.fml.relauncher.Side; //導入依賴的package包/類
@SideOnly(Side.CLIENT)
public void randomDisplayTick(IBlockState stateIn, World worldIn, BlockPos pos, Random rand)
{
double d0 = (double)pos.getX() + 0.5D;
double d1 = (double)pos.getY() + 0.75D;
double d2 = (double)pos.getZ() + 0.5D;
double d3 = 0.22D;
double d4 = 0.27D;
if(worldIn.getTileEntity(pos) instanceof TileEntitySmelter)
{
if(((TileEntitySmelter)worldIn.getTileEntity(pos)).isCooking() && !((TileEntitySmelter)worldIn.getTileEntity(pos)).getInventory().getStackInSlot(0).isEmpty())
{
for(int i = 0; i < 25; i++)
{
worldIn.spawnParticle(EnumParticleTypes.FLAME, d0+(RANDOM.nextDouble()/5 - 0.1), d1, d2+(RANDOM.nextDouble()/5 - 0.1), 0.0D, 0.0D, 0.0D, new int[0]);
worldIn.spawnParticle(EnumParticleTypes.FLAME, d0+(RANDOM.nextDouble()/5 - 0.1), d1, d2+(RANDOM.nextDouble()/5 - 0.1), 0.0D, 0.02D, 0.0D, new int[0]);
worldIn.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d0+(RANDOM.nextDouble()/5 - 0.1), d1, d2+(RANDOM.nextDouble()/5 - 0.1), 0.0D, 0.0D, 0.0D, new int[0]);
}
worldIn.spawnParticle(EnumParticleTypes.FLAME, d0+(RANDOM.nextDouble()/5 - 0.1), d1, d2+(RANDOM.nextDouble()/5 - 0.1), 0.0D, 0.05D, 0.0D, new int[0]);
}
}
}
示例6: getModelClipNode
import net.minecraftforge.fml.relauncher.Side; //導入依賴的package包/類
/**
* Retrieves the clip from the model.
*/
@SideOnly(Side.CLIENT)
public static IClip getModelClipNode(ResourceLocation modelLocation, String clipName)
{
IModel model = ModelLoaderRegistry.getModelOrMissing(modelLocation);
if(model instanceof IAnimatedModel)
{
Optional<? extends IClip> clip = ((IAnimatedModel)model).getClip(clipName);
if(clip.isPresent())
{
return new ModelClip(clip.get(), modelLocation, clipName);
}
FMLLog.getLogger().error("Unable to find clip " + clipName + " in the model " + modelLocation);
}
// FIXME: missing clip?
return new ModelClip(IdentityClip.INSTANCE, modelLocation, clipName);
}
示例7: paintBackground
import net.minecraftforge.fml.relauncher.Side; //導入依賴的package包/類
@SideOnly(Side.CLIENT)
@Override
public void paintBackground(int x, int y) {
for (int xi = 0; xi < slotsWide; xi++) {
for (int yi = 0; yi < slotsHigh; yi++) {
int lo = multiplyColor(color, 0.7f);
int bg = GuiDrawing.colorAtOpacity(0x000000, 0.29f);
int hi = multiplyColor(color, 1.7f);
if (big) {
GuiDrawing.drawBeveledPanel((xi * 18) + x - 4, (yi * 18) + y - 4, 24, 24,
lo, bg, hi);
} else {
GuiDrawing.drawBeveledPanel((xi * 18) + x - 1, (yi * 18) + y - 1, 18, 18,
lo, bg, hi);
}
}
}
}
示例8: update
import net.minecraftforge.fml.relauncher.Side; //導入依賴的package包/類
@Override
@SideOnly(Side.CLIENT)
public void update(EntityPlayer player, int rangeUpgrades) {
if (coordTracker != null) {
coordTracker.ticksExisted++;
} else {
coordTracker = ItemPneumaticArmor.getCoordTrackLocation(player.getItemStackFromSlot(EntityEquipmentSlot.HEAD));
if (coordTracker != null) navigator = new RenderNavigator(coordTracker.world, coordTracker.pos);
}
if (noPathCooldown > 0) {
noPathCooldown--;
}
if (navigator != null && pathEnabled && noPathCooldown == 0 && --pathCalculateCooldown <= 0) {
navigator.updatePath();
if (!navigator.tracedToDestination()) {
noPathCooldown = 100; // wait 5 seconds before recalculating a path.
}
pathCalculateCooldown = pathUpdateSetting == 2 ? 1 : pathUpdateSetting == 1 ? 20 : 100;
}
}
示例9: handleModels
import net.minecraftforge.fml.relauncher.Side; //導入依賴的package包/類
@SubscribeEvent
@SideOnly(Side.CLIENT)
public void handleModels(ModelRegistryEvent event)
{
for (Map.Entry<ItemStack, ModelResourceLocation> entry : LOCATIONS.entrySet())
{
ModelLoader.setCustomModelResourceLocation(entry.getKey().getItem(), entry.getKey().getItemDamage(), entry.getValue());
}
}
示例10: isInRangeToRenderDist
import net.minecraftforge.fml.relauncher.Side; //導入依賴的package包/類
/**
* Checks if the entity is in range to render.
*/
@SideOnly(Side.CLIENT)
public boolean isInRangeToRenderDist(double distance)
{
double d0 = this.getEntityBoundingBox().getAverageEdgeLength() * 4.0D;
if (Double.isNaN(d0))
{
d0 = 4.0D;
}
d0 = d0 * 64.0D;
return distance < d0 * d0;
}
示例11: updateAnimation
import net.minecraftforge.fml.relauncher.Side; //導入依賴的package包/類
@Override
@SideOnly(Side.CLIENT)
public void updateAnimation() {
World world = Minecraft.getMinecraft().theWorld;
if (world != null) {
long time = world.getWorldTime() % 24000L;
this.frameCounter = (int)(time / 1500);
}
TextureUtil.uploadTextureMipmap((int[][])this.framesTextureData.get(this.frameCounter), this.width, this.height, this.originX, this.originY, false, false);
}
示例12: construct
import net.minecraftforge.fml.relauncher.Side; //導入依賴的package包/類
@SideOnly(Side.CLIENT)
public void construct(FMLConstructionEvent event) {
super.construct(event);
getLoaderManager().invoke(event, LoaderState.CONSTRUCTING, Side.CLIENT);
}
示例13: initModels
import net.minecraftforge.fml.relauncher.Side; //導入依賴的package包/類
@SideOnly(Side.CLIENT)
public static void initModels()
{
Item item = Item.getItemFromBlock(ModBlocks.liquid_butter);
ModelBakery.registerItemVariants(item);
ModelResourceLocation location = new ModelResourceLocation("btweagles:fluid", "liquid_butter");
ModelLoader.setCustomMeshDefinition(item, stack -> location);
ModelLoader.setCustomStateMapper(ModBlocks.liquid_butter, new StateMapperBase() {
@Override
protected ModelResourceLocation getModelResourceLocation(IBlockState state) {
return location;
}
});
}
示例14: getSubItems
import net.minecraftforge.fml.relauncher.Side; //導入依賴的package包/類
@Override
@SideOnly(Side.CLIENT)
public void getSubItems(CreativeTabs tab, NonNullList<ItemStack> subItems) {
if (isInCreativeTab(tab)) {
for (int i = 0; i < COMPONENT_AMOUNT; i++) {
subItems.add(new ItemStack(this, 1, i));
}
}
}
示例15: getRenderBoundingBox
import net.minecraftforge.fml.relauncher.Side; //導入依賴的package包/類
@Override
@SideOnly(Side.CLIENT)
public AxisAlignedBB getRenderBoundingBox() {
if (rangeLineRenderer == null || !rangeLineRenderer.isCurrentlyRendering()) return super.getRenderBoundingBox();
int range = getSecurityRange();
return new AxisAlignedBB(getPos().getX() - range, getPos().getY() - range, getPos().getZ() - range, getPos().getX() + 1 + range, getPos().getY() + 1 + range, getPos().getZ() + 1 + range);
}