本文整理汇总了Java中net.minecraft.entity.passive.EntitySheep.getDyeRgb方法的典型用法代码示例。如果您正苦于以下问题:Java EntitySheep.getDyeRgb方法的具体用法?Java EntitySheep.getDyeRgb怎么用?Java EntitySheep.getDyeRgb使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.entity.passive.EntitySheep
的用法示例。
在下文中一共展示了EntitySheep.getDyeRgb方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: doRenderLayer
import net.minecraft.entity.passive.EntitySheep; //导入方法依赖的package包/类
public void doRenderLayer(EntityWolf entitylivingbaseIn, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
if (entitylivingbaseIn.isTamed() && !entitylivingbaseIn.isInvisible())
{
this.wolfRenderer.bindTexture(WOLF_COLLAR);
float[] afloat = EntitySheep.getDyeRgb(entitylivingbaseIn.getCollarColor());
if (Config.isCustomColors())
{
afloat = CustomColors.getWolfCollarColors(entitylivingbaseIn.getCollarColor(), afloat);
}
GlStateManager.color(afloat[0], afloat[1], afloat[2]);
this.wolfRenderer.getMainModel().render(entitylivingbaseIn, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale);
}
}
示例2: renderTileEntityAt
import net.minecraft.entity.passive.EntitySheep; //导入方法依赖的package包/类
public void renderTileEntityAt(TileEntityEndPortal te, double x, double y, double z, float partialTicks, int destroyStage)
{
GlStateManager.disableFog();
TileEntityEndGateway tileentityendgateway = (TileEntityEndGateway)te;
if (tileentityendgateway.isSpawning() || tileentityendgateway.isCoolingDown())
{
GlStateManager.alphaFunc(516, 0.1F);
this.bindTexture(END_GATEWAY_BEAM_TEXTURE);
float f = tileentityendgateway.isSpawning() ? tileentityendgateway.getSpawnPercent(partialTicks) : tileentityendgateway.getCooldownPercent(partialTicks);
double d0 = tileentityendgateway.isSpawning() ? 256.0D - y : 50.0D;
f = MathHelper.sin(f * (float)Math.PI);
int i = MathHelper.floor((double)f * d0);
float[] afloat = EntitySheep.getDyeRgb(tileentityendgateway.isSpawning() ? EnumDyeColor.MAGENTA : EnumDyeColor.PURPLE);
TileEntityBeaconRenderer.renderBeamSegment(x, y, z, (double)partialTicks, (double)f, (double)tileentityendgateway.getWorld().getTotalWorldTime(), 0, i, afloat, 0.15D, 0.175D);
TileEntityBeaconRenderer.renderBeamSegment(x, y, z, (double)partialTicks, (double)f, (double)tileentityendgateway.getWorld().getTotalWorldTime(), 0, -i, afloat, 0.15D, 0.175D);
}
super.renderTileEntityAt(te, x, y, z, partialTicks, destroyStage);
GlStateManager.enableFog();
}
示例3: doRenderLayer
import net.minecraft.entity.passive.EntitySheep; //导入方法依赖的package包/类
@Override
public void doRenderLayer(EntityDemonSheep entitylivingbaseIn, float p_177141_2_, float p_177141_3_, float partialTicks, float p_177141_5_, float p_177141_6_, float p_177141_7_, float scale)
{
if (!entitylivingbaseIn.isInvisible())
{
sheepRenderer.bindTexture(TEXTURE);
if (entitylivingbaseIn.hasCustomName() && "jeb_".equals(entitylivingbaseIn.getCustomNameTag()))
{
int i = entitylivingbaseIn.ticksExisted / 25 + entitylivingbaseIn.getEntityId();
int j = EnumDyeColor.values().length;
int k = i % j;
int l = (i + 1) % j;
float f = (entitylivingbaseIn.ticksExisted % 25 + partialTicks) / 25.0F;
float[] afloat1 = EntitySheep.getDyeRgb(EnumDyeColor.byMetadata(k));
float[] afloat2 = EntitySheep.getDyeRgb(EnumDyeColor.byMetadata(l));
GlStateManager.color(afloat1[0] * (1.0F - f) + afloat2[0] * f, afloat1[1] * (1.0F - f) + afloat2[1] * f, afloat1[2] * (1.0F - f) + afloat2[2] * f);
}
sheepModel.setModelAttributes(sheepRenderer.getMainModel());
sheepModel.setLivingAnimations(entitylivingbaseIn, p_177141_2_, p_177141_3_, partialTicks);
sheepModel.render(entitylivingbaseIn, p_177141_2_, p_177141_3_, p_177141_5_, p_177141_6_, p_177141_7_, scale);
}
}
示例4: doRenderLayer
import net.minecraft.entity.passive.EntitySheep; //导入方法依赖的package包/类
public void doRenderLayer(EntityWolf entitylivingbaseIn, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
if (entitylivingbaseIn.isTamed() && !entitylivingbaseIn.isInvisible())
{
this.wolfRenderer.bindTexture(WOLF_COLLAR);
EnumDyeColor enumdyecolor = EnumDyeColor.byMetadata(entitylivingbaseIn.getCollarColor().getMetadata());
float[] afloat = EntitySheep.getDyeRgb(enumdyecolor);
GlStateManager.color(afloat[0], afloat[1], afloat[2]);
this.wolfRenderer.getMainModel().render(entitylivingbaseIn, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale);
}
}
示例5: doRenderLayer
import net.minecraft.entity.passive.EntitySheep; //导入方法依赖的package包/类
public void doRenderLayer(EntitySheep entitylivingbaseIn, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
if (!entitylivingbaseIn.getSheared() && !entitylivingbaseIn.isInvisible())
{
this.sheepRenderer.bindTexture(TEXTURE);
if (entitylivingbaseIn.hasCustomName() && "jeb_".equals(entitylivingbaseIn.getCustomNameTag()))
{
int i1 = 25;
int i = entitylivingbaseIn.ticksExisted / 25 + entitylivingbaseIn.getEntityId();
int j = EnumDyeColor.values().length;
int k = i % j;
int l = (i + 1) % j;
float f = ((float)(entitylivingbaseIn.ticksExisted % 25) + partialTicks) / 25.0F;
float[] afloat1 = EntitySheep.getDyeRgb(EnumDyeColor.byMetadata(k));
float[] afloat2 = EntitySheep.getDyeRgb(EnumDyeColor.byMetadata(l));
GlStateManager.color(afloat1[0] * (1.0F - f) + afloat2[0] * f, afloat1[1] * (1.0F - f) + afloat2[1] * f, afloat1[2] * (1.0F - f) + afloat2[2] * f);
}
else
{
float[] afloat = EntitySheep.getDyeRgb(entitylivingbaseIn.getFleeceColor());
GlStateManager.color(afloat[0], afloat[1], afloat[2]);
}
this.sheepModel.setModelAttributes(this.sheepRenderer.getMainModel());
this.sheepModel.setLivingAnimations(entitylivingbaseIn, limbSwing, limbSwingAmount, partialTicks);
this.sheepModel.render(entitylivingbaseIn, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale);
}
}
示例6: doRenderLayer
import net.minecraft.entity.passive.EntitySheep; //导入方法依赖的package包/类
@Override
public void doRenderLayer(EntityBombomb entitylivingbaseIn, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
if (!entitylivingbaseIn.isInvisible())
{
bombombRenderer.bindTexture(COLLAR);
EnumDyeColor enumdyecolor = EnumDyeColor.byMetadata(entitylivingbaseIn.getColor().getMetadata());
float[] afloat = EntitySheep.getDyeRgb(enumdyecolor);
GlStateManager.color(afloat[0], afloat[1], afloat[2]);
this.bombombRenderer.getMainModel().render(entitylivingbaseIn, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale);
GlStateManager.color(1.0f, 1.0f, 1.0f);
}
}
示例7: doRenderLayer
import net.minecraft.entity.passive.EntitySheep; //导入方法依赖的package包/类
@Override
public void doRenderLayer(EntitySheepuff sheepuff, float p_177141_2_, float p_177141_3_, float partialTicks, float p_177141_5_, float p_177141_6_, float p_177141_7_, float scale)
{
if (!sheepuff.getSheared() && !sheepuff.isInvisible())
{
GlStateManager.pushMatrix();
this.renderManager.renderEngine.bindTexture(TEXTURE_FUR);
int j = sheepuff.getFleeceColor();
float[] dye = EntitySheep.getDyeRgb(EnumDyeColor.byMetadata(j));
GlStateManager.color(dye[0], dye[1], dye[2]);
if (sheepuff.hasCustomName() && "jeb_".equals(sheepuff.getCustomNameTag()))
{
int i = sheepuff.ticksExisted / 25 + sheepuff.getEntityId();
int j1 = EnumDyeColor.values().length;
int k = i % j1;
int l = (i + 1) % j1;
float f = ((float)(sheepuff.ticksExisted % 25) + partialTicks) / 25.0F;
float[] afloat1 = EntitySheep.getDyeRgb(EnumDyeColor.byMetadata(k));
float[] afloat2 = EntitySheep.getDyeRgb(EnumDyeColor.byMetadata(l));
GlStateManager.color(afloat1[0] * (1.0F - f) + afloat2[0] * f, afloat1[1] * (1.0F - f) + afloat2[1] * f, afloat1[2] * (1.0F - f) + afloat2[2] * f);
}
if (sheepuff.getPuffed())
{
this.puffedModel.setModelAttributes(this.render.getMainModel());
this.puffedModel.setLivingAnimations(sheepuff, p_177141_2_, p_177141_3_, partialTicks);
this.puffedModel.render(sheepuff, p_177141_2_, p_177141_3_, p_177141_5_, p_177141_6_, p_177141_7_, scale);
}
else
{
this.woolModel.setModelAttributes(this.render.getMainModel());
this.woolModel.setLivingAnimations(sheepuff, p_177141_2_, p_177141_3_, partialTicks);
this.woolModel.render(sheepuff, p_177141_2_, p_177141_3_, p_177141_5_, p_177141_6_, p_177141_7_, scale);
}
GlStateManager.popMatrix();
}
}
示例8: rainbowColor
import net.minecraft.entity.passive.EntitySheep; //导入方法依赖的package包/类
/**
* Applies a color to GL state based on the current tick. This is similar to the code used
* by jeb sheeps.
*
* @param previousTicks The previous tick value.
* @param offset An offset value.
* @param partialTicks The partial ticks.
*/
public static void rainbowColor (int previousTicks, int offset, float partialTicks) {
final int ticks = previousTicks / 25 + offset;
final int colorCount = EnumDyeColor.values().length;
final int colorMeta1 = ticks % colorCount;
final int colorMeta2 = (ticks + 1) % colorCount;
final float f = (previousTicks % 25 + partialTicks) / 25.0F;
final float[] color1 = EntitySheep.getDyeRgb(EnumDyeColor.byMetadata(colorMeta1));
final float[] color2 = EntitySheep.getDyeRgb(EnumDyeColor.byMetadata(colorMeta2));
GlStateManager.color(color1[0] * (1.0F - f) + color2[0] * f, color1[1] * (1.0F - f) + color2[1] * f, color1[2] * (1.0F - f) + color2[2] * f);
}
示例9: rainbowColor
import net.minecraft.entity.passive.EntitySheep; //导入方法依赖的package包/类
/**
* Applies a color to GL state based on the current tick. This is similar to the code used
* by jeb sheeps.
*
* @param previousTicks The previous tick value.
* @param offset An offset value.
* @param partialTicks The partial ticks.
*/
public static void rainbowColor (int previousTicks, int offset, float partialTicks) {
final int ticks = previousTicks / 25 + offset;
final int colorCount = EnumDyeColor.values().length;
final int colorMeta1 = ticks % colorCount;
final int colorMeta2 = (ticks + 1) % colorCount;
final float f = (previousTicks % 25 + partialTicks) / 25.0F;
final float[] color1 = EntitySheep.getDyeRgb(EnumDyeColor.byMetadata(colorMeta1));
final float[] color2 = EntitySheep.getDyeRgb(EnumDyeColor.byMetadata(colorMeta2));
GlStateManager.color(color1[0] * (1.0F - f) + color2[0] * f, color1[1] * (1.0F - f) + color2[1] * f, color1[2] * (1.0F - f) + color2[2] * f);
}
示例10: doRenderLayer
import net.minecraft.entity.passive.EntitySheep; //导入方法依赖的package包/类
public void doRenderLayer(EntityPig pig, float f, float f1, float renderTick, float f2, float f3, float f4, float f5)
{
if(Blocksteps.config.easterEgg == 1 && Blocksteps.eventHandler.renderingMinimap && !pig.isInvisible())
{
Minecraft.getMinecraft().getTextureManager().bindTexture(texSheepPig);
if (pig.hasCustomName() && "iChun".equals(pig.getCustomNameTag()))
{
int i = Minecraft.getMinecraft().thePlayer.ticksExisted / 25 + pig.getEntityId();
int j = EnumDyeColor.values().length;
int k = i % j;
int l = (i + 1) % j;
float f7 = ((float)(Minecraft.getMinecraft().thePlayer.ticksExisted % 25) + renderTick) / 25.0F;
float[] afloat1 = EntitySheep.getDyeRgb(EnumDyeColor.byMetadata(k));
float[] afloat2 = EntitySheep.getDyeRgb(EnumDyeColor.byMetadata(l));
GlStateManager.color(afloat1[0] * (1.0F - f7) + afloat2[0] * f7, afloat1[1] * (1.0F - f7) + afloat2[1] * f7, afloat1[2] * (1.0F - f7) + afloat2[2] * f7);
}
else
{
float[] afloat = EntitySheep.getDyeRgb(EnumDyeColor.byMetadata(pig.getEntityId() & 15));
GlStateManager.color(afloat[0], afloat[1], afloat[2]);
}
modelSheepPig.setModelAttributes(renderPig.getMainModel());
modelSheepPig.setLivingAnimations(pig, f, f1, renderTick);
modelSheepPig.render(pig, f, f1, f2, f3, f4, f5);
}
}
示例11: doRenderLayer
import net.minecraft.entity.passive.EntitySheep; //导入方法依赖的package包/类
public void doRenderLayer(EntitySheep entitylivingbaseIn, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
if (!entitylivingbaseIn.getSheared() && !entitylivingbaseIn.isInvisible())
{
this.sheepRenderer.bindTexture(TEXTURE);
if (entitylivingbaseIn.hasCustomName() && "jeb_".equals(entitylivingbaseIn.getCustomNameTag()))
{
int i1 = 25;
int i = entitylivingbaseIn.ticksExisted / 25 + entitylivingbaseIn.getEntityId();
int j = EnumDyeColor.values().length;
int k = i % j;
int l = (i + 1) % j;
float f = ((float)(entitylivingbaseIn.ticksExisted % 25) + partialTicks) / 25.0F;
float[] afloat1 = EntitySheep.getDyeRgb(EnumDyeColor.byMetadata(k));
float[] afloat2 = EntitySheep.getDyeRgb(EnumDyeColor.byMetadata(l));
if (Config.isCustomColors())
{
afloat1 = CustomColors.getSheepColors(EnumDyeColor.byMetadata(k), afloat1);
afloat2 = CustomColors.getSheepColors(EnumDyeColor.byMetadata(l), afloat2);
}
GlStateManager.color(afloat1[0] * (1.0F - f) + afloat2[0] * f, afloat1[1] * (1.0F - f) + afloat2[1] * f, afloat1[2] * (1.0F - f) + afloat2[2] * f);
}
else
{
float[] afloat = EntitySheep.getDyeRgb(entitylivingbaseIn.getFleeceColor());
if (Config.isCustomColors())
{
afloat = CustomColors.getSheepColors(entitylivingbaseIn.getFleeceColor(), afloat);
}
GlStateManager.color(afloat[0], afloat[1], afloat[2]);
}
this.sheepModel.setModelAttributes(this.sheepRenderer.getMainModel());
this.sheepModel.setLivingAnimations(entitylivingbaseIn, limbSwing, limbSwingAmount, partialTicks);
this.sheepModel.render(entitylivingbaseIn, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale);
}
}
示例12: doRender
import net.minecraft.entity.passive.EntitySheep; //导入方法依赖的package包/类
@Override
public void doRender(EntityTeleporter living, double x, double y, double z, float rot, float partial) {
if (living.isConstructing())
this.mainModel = this.box;
else
this.mainModel = this.main;
if (living.getSoundState() == 1)
living.spinRender = living.spin
+ ((float) Math.PI * (living.getLevel() == 1 ? 0.25f : (living.getLevel() == 2 ? 0.325f : 0.4f)))
* partial;
else
living.spinRender = 0;
super.doRender(living, x, y, z, rot, partial);
if (living.getSoundState() == 1) {
Tessellator tessellator = Tessellator.getInstance();
BufferBuilder renderer = tessellator.getBuffer();
GlStateManager.pushMatrix();
GlStateManager.translate((float) x, (float) y + 0.23D, (float) z);
// GL11.glRotatef((living.prevRotationYawHead +
// (living.rotationYawHead - living.prevRotationYawHead) *
// p_76986_9_)*-1, 0.0F, 1.0F, 0.0F);
// GL11.glRotatef((living.prevRotationPitch + (living.rotationPitch
// - living.prevRotationPitch) * p_76986_9_), 1.0F, 0.0F, 0.0F);
// GlStateManager.disableTexture2D();
GlStateManager.disableLighting();
GL11.glEnable(GL11.GL_BLEND);
OpenGlHelper.glBlendFunc(770, 771, 1, 0);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 0.7F);
/*
* if(TF2weapons.getTeamForDisplay(living)==0){ GL11.glColor4f(1.0F,
* 0.0F, 0.0F, 0.28F); } else{ GL11.glColor4f(0.0F, 0.0F, 1.0F,
* 0.28F); }
*/
renderer.begin(7, DefaultVertexFormats.POSITION_TEX);
renderer.pos(-0.5, 0.0D, 0.5).tex(0.75D, 0.5D).endVertex();
renderer.pos(0.5, 0.0D, 0.5).tex(1D, 0.5D).endVertex();
renderer.pos(0.5, 0.0D, -0.5).tex(1D, 0.0D).endVertex();
renderer.pos(-0.5, 0.0D, -0.5).tex(0.75D, 0.0D).endVertex();
tessellator.draw();
if(living.getColor() != -1) {
float[] color=EntitySheep.getDyeRgb(EnumDyeColor.byDyeDamage(living.getColor()));
GL11.glColor4f(color[0], color[1], color[2], 0.85F);
renderer.begin(7, DefaultVertexFormats.POSITION_TEX);
renderer.pos(-0.5, 0.0D, 0.5).tex(0.75D, 1D).endVertex();
renderer.pos(0.5, 0.0D, 0.5).tex(1D, 1D).endVertex();
renderer.pos(0.5, 0.0D, -0.5).tex(1D, 0.5D).endVertex();
renderer.pos(-0.5, 0.0D, -0.5).tex(0.75D, 0.5D).endVertex();
tessellator.draw();
}
GL11.glColor4f(1F, 1F, 1F, 1.0F);
GL11.glDisable(GL11.GL_BLEND);
// GlStateManager.enableTexture2D();
GlStateManager.enableLighting();
GlStateManager.popMatrix();
}
}
示例13: getRecipeOutput
import net.minecraft.entity.passive.EntitySheep; //导入方法依赖的package包/类
/**
* Returns the size of the recipe area
*/
/*public int getRecipeSize()
{
return 10;
}
@Nullable
public ItemStack getRecipeOutput()
{
return ItemStack.EMPTY;
}
public NonNullList<ItemStack> getRemainingItems(InventoryCrafting inv)
{
NonNullList<ItemStack> aitemstack = NonNullList.withSize(inv.getSizeInventory(),ItemStack.EMPTY);
for (int i = 0; i < aitemstack.size(); ++i)
{
ItemStack itemstack = inv.getStackInSlot(i);
aitemstack.set(i,net.minecraftforge.common.ForgeHooks.getContainerItem(itemstack));
}
return aitemstack;
}*/
@Override
public ItemStack getCraftingResult(InventoryCrafting inv)
{
int dyeCount = 0;
int[] aint = new int[3];
int i = 0;
for (int k = 0; k < inv.getSizeInventory(); ++k) {
ItemStack itemstack = inv.getStackInSlot(k);
if (!itemstack.isEmpty()) {
if (isDye(itemstack)) {
float[] afloat = EntitySheep.getDyeRgb(EnumDyeColor.byDyeDamage(itemstack.getMetadata()));
int l1 = (int) (afloat[0] * 255.0F);
int i2 = (int) (afloat[1] * 255.0F);
int j2 = (int) (afloat[2] * 255.0F);
i += Math.max(l1, Math.max(i2, j2));
aint[0] += l1;
aint[1] += i2;
aint[2] += j2;
++dyeCount;
}
}
}
ItemSamuraiArmor itemarmor = (ItemSamuraiArmor)outputItem.getItem();
int i1 = aint[0] / dyeCount;
int j1 = aint[1] / dyeCount;
int k1 = aint[2] / dyeCount;
float f3 = (float)i / (float)dyeCount;
float f4 = (float)Math.max(i1, Math.max(j1, k1));
i1 = (int)((float)i1 * f3 / f4);
j1 = (int)((float)j1 * f3 / f4);
k1 = (int)((float)k1 * f3 / f4);
int lvt_12_3_ = (i1 << 8) + j1;
lvt_12_3_ = (lvt_12_3_ << 8) + k1;
ItemStack outstack = outputItem.copy();
itemarmor.setColor(outstack, lvt_12_3_);
return outstack;
}
示例14: recipes
import net.minecraft.entity.passive.EntitySheep; //导入方法依赖的package包/类
public static void recipes(){
boolean useInfusion = Config.hardmode_MaterialCrops;
if(useInfusion){
Vec3d colorGreen = new Vec3d(0, 124, 16);
ModFusionRecipes.addRecipe(new ItemStack(Items.WHEAT_SEEDS), ItemMaterialSeed.getSeed(DIRT), new Object[] {new ItemStack(Blocks.DIRT)}, colorGreen);
ModFusionRecipes.addRecipe(new ItemStack(Items.WHEAT_SEEDS), ItemMaterialSeed.getSeed(COBBLESTONE), new Object[] {"cobblestone"}, colorGreen);
ModFusionRecipes.addRecipe(new ItemStack(Items.WHEAT_SEEDS), ItemMaterialSeed.getSeed(SAND), new Object[] {"sand"}, colorGreen);
ModFusionRecipes.addRecipe(new ItemStack(Items.WHEAT_SEEDS), ItemMaterialSeed.getSeed(GRAVEL), new Object[] {"gravel"}, colorGreen);
ModFusionRecipes.addRecipe(new ItemStack(Items.WHEAT_SEEDS), ItemMaterialSeed.getSeed(LOG_OAK), new Object[] {new ItemStack(Blocks.LOG, 1, BlockPlanks.EnumType.OAK.getMetadata())}, colorGreen);
ModFusionRecipes.addRecipe(new ItemStack(Items.WHEAT_SEEDS), ItemMaterialSeed.getSeed(LOG_SPRUCE), new Object[] {new ItemStack(Blocks.LOG, 1, BlockPlanks.EnumType.SPRUCE.getMetadata())}, colorGreen);
ModFusionRecipes.addRecipe(new ItemStack(Items.WHEAT_SEEDS), ItemMaterialSeed.getSeed(LOG_BIRCH), new Object[] {new ItemStack(Blocks.LOG, 1, BlockPlanks.EnumType.BIRCH.getMetadata())}, colorGreen);
ModFusionRecipes.addRecipe(new ItemStack(Items.WHEAT_SEEDS), ItemMaterialSeed.getSeed(LOG_JUNGLE), new Object[] {new ItemStack(Blocks.LOG, 1, BlockPlanks.EnumType.JUNGLE.getMetadata())}, colorGreen);
ModFusionRecipes.addRecipe(new ItemStack(Items.WHEAT_SEEDS), ItemMaterialSeed.getSeed(LOG_ACACIA), new Object[] {new ItemStack(Blocks.LOG2, 1, BlockPlanks.EnumType.ACACIA.getMetadata() - 4)}, colorGreen);
ModFusionRecipes.addRecipe(new ItemStack(Items.WHEAT_SEEDS), ItemMaterialSeed.getSeed(LOG_BIG_OAK), new Object[] {new ItemStack(Blocks.LOG2, 1, BlockPlanks.EnumType.DARK_OAK.getMetadata() - 4)}, colorGreen);
for(EnumDyeColor color : new EnumDyeColor[]{EnumDyeColor.WHITE, EnumDyeColor.YELLOW, EnumDyeColor.BLUE, EnumDyeColor.GREEN, EnumDyeColor.RED, EnumDyeColor.BLACK}){
float[] array = EntitySheep.getDyeRgb(color);
Vec3d dyeColor = new Vec3d(array[0], array[1], array[2]);
ModFusionRecipes.addRecipe(new ItemStack(Items.WHEAT_SEEDS), ItemMaterialSeed.getSeed(DYE_CROPS.get(color.getDyeDamage())), new Object[] {new ItemStack(Items.DYE, 1, color.getDyeDamage())}, dyeColor);
}
ModFusionRecipes.addRecipe(new ItemStack(Items.WHEAT_SEEDS), ItemMaterialSeed.getSeed(STRING), new Object[] {"woolWhite"}, colorGreen);
} else {
ModCrafting.addShapelessRecipe(ItemMaterialSeed.getSeed(DIRT), new Object[]{Items.WHEAT_SEEDS, Blocks.DIRT});
ModCrafting.addShapelessOreRecipe(ItemMaterialSeed.getSeed(COBBLESTONE), new Object[]{Items.WHEAT_SEEDS, "cobblestone"});
ModCrafting.addShapelessOreRecipe(ItemMaterialSeed.getSeed(SAND), new Object[]{Items.WHEAT_SEEDS, "sand"});
ModCrafting.addShapelessOreRecipe(ItemMaterialSeed.getSeed(GRAVEL), new Object[]{Items.WHEAT_SEEDS, "gravel"});
ModCrafting.addShapelessOreRecipe(ItemMaterialSeed.getSeed(LOG_OAK), new Object[]{Items.WHEAT_SEEDS, new ItemStack(Blocks.LOG, 1, 0)});
ModCrafting.addShapelessOreRecipe(ItemMaterialSeed.getSeed(LOG_SPRUCE), new Object[]{ItemMaterialSeed.getSeed(LOG_OAK), new ItemStack(Blocks.LOG, 1, 1)});
ModCrafting.addShapelessOreRecipe(ItemMaterialSeed.getSeed(LOG_BIRCH), new Object[]{ItemMaterialSeed.getSeed(LOG_OAK), new ItemStack(Blocks.LOG, 1, 2)});
ModCrafting.addShapelessOreRecipe(ItemMaterialSeed.getSeed(LOG_JUNGLE), new Object[]{ItemMaterialSeed.getSeed(LOG_OAK), new ItemStack(Blocks.LOG, 1, 3)});
ModCrafting.addShapelessOreRecipe(ItemMaterialSeed.getSeed(LOG_ACACIA), new Object[]{ItemMaterialSeed.getSeed(LOG_OAK), new ItemStack(Blocks.LOG2, 1, 0)});
ModCrafting.addShapelessOreRecipe(ItemMaterialSeed.getSeed(LOG_BIG_OAK), new Object[]{ItemMaterialSeed.getSeed(LOG_OAK), new ItemStack(Blocks.LOG2, 1, 1)});
ModCrafting.addShapelessOreRecipe(ItemMaterialSeed.getSeed(DYE_CROPS.get(EnumDyeColor.WHITE.getDyeDamage())), new Object[]{Items.WHEAT_SEEDS, "dyeWhite"});
ModCrafting.addShapelessOreRecipe(ItemMaterialSeed.getSeed(DYE_CROPS.get(EnumDyeColor.YELLOW.getDyeDamage())), new Object[]{Items.WHEAT_SEEDS, "dyeYellow"});
ModCrafting.addShapelessOreRecipe(ItemMaterialSeed.getSeed(DYE_CROPS.get(EnumDyeColor.BLUE.getDyeDamage())), new Object[]{Items.WHEAT_SEEDS, "dyeBlue"});
ModCrafting.addShapelessOreRecipe(ItemMaterialSeed.getSeed(DYE_CROPS.get(EnumDyeColor.GREEN.getDyeDamage())), new Object[]{Items.WHEAT_SEEDS, "dyeGreen"});
ModCrafting.addShapelessOreRecipe(ItemMaterialSeed.getSeed(DYE_CROPS.get(EnumDyeColor.RED.getDyeDamage())), new Object[]{Items.WHEAT_SEEDS, "dyeRed"});
ModCrafting.addShapelessOreRecipe(ItemMaterialSeed.getSeed(DYE_CROPS.get(EnumDyeColor.BLACK.getDyeDamage())), new Object[]{Items.WHEAT_SEEDS, new ItemStack(Items.DYE, 1, EnumDyeColor.BLACK.getDyeDamage())});
ModCrafting.addShapelessOreRecipe(ItemMaterialSeed.getSeed(STRING), new Object[]{Items.WHEAT_SEEDS, "woolWhite"});
}
GameRegistry.addSmelting(ItemMaterialSeed.getSeed(COBBLESTONE), ItemMaterialSeed.getSeed(STONE), 0.35F);
GameRegistry.addSmelting(ItemMaterialSeed.getSeed(SAND), ItemMaterialSeed.getSeed(GLASS), 0.35F);
CrystalInfusionManager.addRecipe(ItemMaterialSeed.getSeed(COBBLESTONE), new FluidStack(FluidRegistry.LAVA, 100), ItemMaterialSeed.getSeed(NETHERRACK), 1600);
GameRegistry.addSmelting(ItemMaterialSeed.getSeed(CLAY), ItemMaterialSeed.getSeed(HARDENED_CLAY), 0.35F);
}
示例15: drawGuiContainerForegroundLayer
import net.minecraft.entity.passive.EntitySheep; //导入方法依赖的package包/类
@Override
public void drawGuiContainerForegroundLayer(int par1, int par2){
super.drawGuiContainerForegroundLayer(par1, par2);
int cuX = 51;
int rfX = 71;
int flX = 91;
if(ItemStackTools.isValid(backpackInv.getBackpack())){
int id = ItemNBTHelper.getInteger(backpackInv.getBackpack(), "Code", 0);
int color1 = id & 15;
int color2 = (id >> 4) & 15;
int color3 = (id >> 8) & 15;
EnumDyeColor c1 = EnumDyeColor.byMetadata(color1);
EnumDyeColor c2 = EnumDyeColor.byMetadata(color2);
EnumDyeColor c3 = EnumDyeColor.byMetadata(color3);
int back = Color.BLACK.getRGB();
drawRect(10, 20, 30, 40, back);
drawRect(10, 42, 30, 62, back);
drawRect(10, 64, 30, 84, back);
float[] afloat = EntitySheep.getDyeRgb(c1);
float[] afloat1 = EntitySheep.getDyeRgb(c2);
float[] afloat2 = EntitySheep.getDyeRgb(c3);
drawRect(12, 22, 28, 38, new Color(afloat[0], afloat[1], afloat[2]).getRGB());
drawRect(12, 44, 28, 60, new Color(afloat1[0], afloat1[1], afloat1[2]).getRGB());
drawRect(12, 66, 28, 82, new Color(afloat2[0], afloat2[1], afloat2[2]).getRGB());
}
if(buffer !=null){
EnderBuffer ebuffer = buffer;
int cu = ebuffer.cuStorage.getCEnergyStored(); int maxCU = ebuffer.cuStorage.getMaxCEnergyStored();
int rf = ebuffer.rfStorage.getEnergyStored(); int maxRF = ebuffer.rfStorage.getMaxEnergyStored();
final int barHeight = 58;
RenderUtil.renderPowerBar(cuX, 16, (int)zLevel, 10, barHeight, cu, maxCU, Color.CYAN.getRGB(), Color.CYAN.darker().getRGB());
RenderUtil.renderPowerBar(rfX, 16, (int)zLevel, 10, barHeight, rf, maxRF, Color.RED.getRGB(), Color.RED.darker().getRGB());
RenderUtil.renderGuiTank(ebuffer.tank, flX, 15, zLevel, 10, 58);
int xAxis = (par1 - (width - xSize) / 2);
int yAxis = (par2 - (height - ySize) / 2);
if(xAxis > cuX-3 && xAxis < (cuX-3)+12 && yAxis >= 15 && yAxis <= 62+12)
{
List<String> lines = Lists.newArrayList();
lines.add(cu > 0 ? "CU: "+ cu +" / "+ maxCU +"CU": Lang.localize("gui.empty"));
drawHoveringText(lines, xAxis, yAxis);
RenderHelper.enableGUIStandardItemLighting();
}
if(xAxis > rfX-3 && xAxis < (rfX-3)+12 && yAxis >= 15 && yAxis <= 62+12)
{
drawCreativeTabHoveringText(rf > 0 ? "RF: "+ rf +" / "+ maxRF +"RF": Lang.localize("gui.empty"), xAxis, yAxis);
RenderHelper.enableGUIStandardItemLighting();
}
if(xAxis > flX-3 && xAxis < (flX-3)+12 && yAxis >= 15 && yAxis <= 62+12)
{
drawCreativeTabHoveringText(ebuffer.tank.getFluid() !=null ? ebuffer.tank.getFluid().getLocalizedName()+": "+ ebuffer.tank.getFluid().amount+" / "+ebuffer.tank.getCapacity()+"Mb": Lang.localize("gui.empty"), xAxis, yAxis);
RenderHelper.enableGUIStandardItemLighting();
}
}
}