@Override public int getMetaFromState(IBlockState state) { return state.getValue(BotaniaStateProps.COLOR).getMetadata(); }
@Override public int getMetaFromState(IBlockState state) { return state.getValue(BotaniaStateProps.COLOR).getMetadata(); }
@Override public int getMetaFromState(IBlockState state) { return state.getValue(BotaniaStateProps.COLOR).getMetadata(); }
@Override public int getMetaFromState(IBlockState state) { return state.getValue(BotaniaStateProps.COLOR).getMetadata(); }
@Override public int getMetaFromState(IBlockState state) { return state.getValue(BotaniaStateProps.COLOR).getMetadata(); }
public void setNetwork(EnumDyeColor network) { dataManager.set(NETWORK, network.getMetadata()); }
@Override public int getMetaFromState(IBlockState state) { int meta = state.getValue(BotaniaStateProps.DOUBLEFLOWER_VARIANT_2).getMetadata() - 8; if (state.getValue(HALF) == BlockDoublePlant.EnumBlockHalf.UPPER) { meta |= 8; } return meta; }
@Override public int getMetaFromState(IBlockState state) { int meta = state.getValue(BotaniaStateProps.DOUBLEFLOWER_VARIANT_1).getMetadata(); if (state.getValue(HALF) == BlockDoublePlant.EnumBlockHalf.UPPER) { meta |= 8; } return meta; }
public SpecialFloatingFlowerWrapper(SpecialFloatingFlowerRecipe recipe) { inputs.add(ImmutableList.of(ItemBlockSpecialFlower.ofType(recipe.type))); List<ItemStack> normalFloaters = new ArrayList<>(); for (EnumDyeColor color : EnumDyeColor.values()) { normalFloaters.add(new ItemStack(ModBlocks.floatingFlower, 1, color.getMetadata())); } inputs.add(normalFloaters); output = ItemBlockSpecialFlower.ofType(new ItemStack(ModBlocks.floatingSpecialFlower), recipe.type); }
public static void placeDoubleFlower(World world, BlockPos pos, EnumDyeColor color, int flags) { Block flower = color.getMetadata() >= 8 ? ModBlocks.doubleFlower2 : ModBlocks.doubleFlower1; world.setBlockState(pos, flower.getDefaultState().withProperty(color.getMetadata() >= 8 ? BotaniaStateProps.DOUBLEFLOWER_VARIANT_2 : BotaniaStateProps.DOUBLEFLOWER_VARIANT_1, color).withProperty(BlockDoublePlant.HALF, BlockDoublePlant.EnumBlockHalf.LOWER), flags); world.setBlockState(pos.up(), flower.getDefaultState().withProperty(color.getMetadata() >= 8 ? BotaniaStateProps.DOUBLEFLOWER_VARIANT_2 : BotaniaStateProps.DOUBLEFLOWER_VARIANT_1, color).withProperty(BlockDoublePlant.HALF, BlockDoublePlant.EnumBlockHalf.UPPER), flags); }
@Override protected void writeEntityToNBT(@Nonnull NBTTagCompound cmp) { cmp.setBoolean(TAG_MASTER, isMaster()); cmp.setInteger(TAG_NETWORK, getNetwork().getMetadata()); cmp.setInteger(TAG_INVIS, isInvisible() ? 1 : 0); }
@Override public boolean recolorBlock( final World world, final BlockPos pos, final EnumFacing side, final EnumDyeColor color ) { final TileEntity te = this.getTileEntity( world, pos ); if( te instanceof IColorableTile ) { final IColorableTile ct = (IColorableTile) te; final AEColor c = ct.getColor(); final AEColor newColor = AEColor.values()[color.getMetadata()]; if( c != newColor ) { ct.recolourBlock( side, newColor, null ); return true; } return false; } return super.recolorBlock( world, pos, side, color ); }
entity.world.setBlockState(coords, stateThere.withProperty(BotaniaAPI.paintableBlocks.get(block), placeColor), 2); PacketHandler.sendToNearby(entity.world, coords, new PacketBotaniaEffect(PacketBotaniaEffect.EffectType.PAINT_LENS, coords.getX(), coords.getY(), coords.getZ(), placeColor.getMetadata()));
@Override public ItemStack getDisplayStack() { if(!forcedStack.isEmpty()) { ItemStack retStack = forcedStack; forcedStack = ItemStack.EMPTY; return retStack; } EnumDyeColor color = world.getBlockState(getPos()).getBlock() != ModBlocks.floatingFlower ? EnumDyeColor.WHITE : world.getBlockState(getPos()).getValue(BotaniaStateProps.COLOR); return new ItemStack(ModBlocks.shinyFlower, 1, color.getMetadata()); }
@Override public void writePacketNBT(NBTTagCompound cmp) { cmp.setInteger(TAG_MANA, mana); cmp.setBoolean(TAG_OUTPUTTING, outputting); cmp.setInteger(TAG_COLOR, color.getMetadata()); cmp.setInteger(TAG_MANA_CAP, manaCap); cmp.setBoolean(TAG_CAN_ACCEPT, canAccept); cmp.setBoolean(TAG_CAN_SPARE, canSpare); cmp.setBoolean(TAG_FRAGILE, fragile); cmp.setString(TAG_INPUT_KEY, inputKey); cmp.setString(TAG_OUTPUT_KEY, outputKey); }
@Nonnull @Override public List<BakedQuad> getQuads(IBlockState state, EnumFacing face, long rand) { if(state.getBlock() != ModBlocks.floatingSpecialFlower && state.getBlock() != ModBlocks.floatingFlower) return Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelShapes().getModelManager().getMissingModel().getQuads(state, face, rand); IExtendedBlockState realState = (IExtendedBlockState) state; IFloatingFlower.IslandType islandType = realState.getValue(BotaniaStateProps.ISLAND_TYPE); String identifier; if(state.getBlock() == ModBlocks.floatingSpecialFlower) { // Magic flower identifier = realState.getValue(BotaniaStateProps.SUBTILE_ID); } else { // Mundane flower identifier = MUNDANE_PREFIX + state.getValue(BotaniaStateProps.COLOR).getMetadata(); } return getModel(islandType, identifier).getQuads(state, face, rand); }
@Override public int getMetaFromState(@Nonnull IBlockState state) { return state.getValue(BlockColored.COLOR).getMetadata(); }
} else if(stack.getItem() == ModItems.dye) { int color = stack.getItemDamage(); if(color != getNetwork().getMetadata()) { setNetwork(EnumDyeColor.byMetadata(color));
@Override @SideOnly(Side.CLIENT) public void getSubBlocks(@Nonnull CreativeTabs par2CreativeTabs, @Nonnull NonNullList<ItemStack> par3List) { for (EnumDyeColor enumdyecolor : EnumDyeColor.values()) { par3List.add(new ItemStack(this, 1, enumdyecolor.getMetadata())); } }
private static void registerBags() { for (EnumDyeColor e : EnumDyeColor.values()) { ModelLoader.setCustomModelResourceLocation(ObjHandler.alchBag, e.getMetadata(), new ModelResourceLocation(PECore.MODID + ":" + "bags/alchbag_" + e.getName(), "inventory")); } }