Jump to content

Darki

Members
  • Posts

    161
  • Joined

  • Last visited

Everything posted by Darki

  1. Ok I find it displayGuiScreen will be called from FMLClientHandler.showGuiScreen(GuiScreen) and that will be called from FMLCommonHandler.showGuiScreen(Object) and that will be called from FMLCommonHandler.showGuiScreen(Object) : 1. net.minecraftforge.fml.common.network.internal.FMLNetworkHandler.openGui(this, mod, modGuiId, world, x, y, z); 2. FMLCommonHandler.instance().showGuiScreen(guiContainer); 3. sidedDelegate.showGuiScreen(clientGuiElement); 4. client.displayGuiScreen(gui);
  2. Yeah it will be called. Something in this code is the Problem: this.setIngameNotInFocus(); KeyBinding.unPressAllKeys(); while (Mouse.next()) { ; } while (Keyboard.next()) { ; } ScaledResolution scaledresolution = new ScaledResolution(this); int i = scaledresolution.getScaledWidth(); int j = scaledresolution.getScaledHeight(); ((GuiScreen)guiScreenIn).setWorldAndResolution(this, i, j); this.skipRenderWorld = false;
  3. wait i used player.openGui and there wasnt a displayGuiScreen
  4. Yeah I see it.....but through this line it goes: else if (FMLCommonHandler.instance().getSide().equals(Side.CLIENT)) But after that, hm I dont know...after that there are only 2 Lines 1. Object guiContainer = NetworkRegistry.INSTANCE.getLocalGuiContainer(mc, entityPlayer, modGuiId, world, x, y, z); and 2. FMLCommonHandler.instance().showGuiScreen(guiContainer);
  5. Ok I did a Debug with Breakpoints and it says that it doesnt go through that: if (entityPlayer instanceof EntityPlayerMP && !(entityPlayer instanceof FakePlayer))
  6. I tried a litte bit but it has to be the player.openGui method that doesnt open the gui
  7. It goes through all ifs but the gui doesnt screen anyway
  8. Now I changed it a little bit: private ConcurrentHashMap<EntityPlayer, Boolean> shown = new ConcurrentHashMap<EntityPlayer, Boolean>(); @SubscribeEvent public void onJoin(EntityJoinWorldEvent e) { if (e.getEntity() instanceof EntityPlayer) { EntityPlayer player = (EntityPlayer) e.getEntity(); shown.put(player, false); if (!(new File(Main.path + File.separator + "Datas" + File.separator + player.getName() + ".data").exists())) { if(!shown.get(player)){ if(e.getWorld().isRemote){ player.openGui(Main.getInstance(), GuiHandler.GUI_ID_CB, e.getWorld(), player.getPosition().getX(), player.getPosition().getY(), player.getPosition().getZ()); shown.put(player, true); } } }else{ shown.put(player, true); } } } Nothing happend
  9. How? I try to open it with player.openGUI
  10. Ok I am looking at this, but my GUI doesnt need a Container because it is a GUI Screen
  11. At the moment I try to open a GUI when the Player joins the game but the GUI dont open. But why? GUIHandler: public class GuiHandler implements IGuiHandler { public static final int GUI_ID_CB = 0; @Override public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { return null; } @Override public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { if (ID == GUI_ID_CB) return new CharacterBuilder(); return null; } } My GUI: public class CharacterBuilder extends GuiScreen{ private GuiButtonExt a; private GuiSlider b; private static int strength; @Override public void initGui() { buttonList.add(this.a = new GuiButtonExt(0, this.width / 2 - 50, this.height - 30, 100, 20, "Start")); buttonList.add(this.b = new GuiSlider(1, this.width / 4 - 75 , 30, 150, 20, "Strength: ", "", 0, 5, 0, false, true)); } @Override protected void actionPerformed(GuiButton button) throws IOException { if(button.id == a.id){ strength = b.getValueInt(); mc.displayGuiScreen((GuiScreen)null); } super.actionPerformed(button); } @Override public void drawScreen(int mouseX, int mouseY, float partialTicks) { drawDefaultBackground(); super.drawScreen(mouseX, mouseY, partialTicks); } @Override public boolean doesGuiPauseGame() { return true; } public static int getStrength(){ return strength; } } My Main Class: @Mod(modid = Main.MODID, version = Main.VERSION) public class Main { public static final String MODID = "ultrareal"; public static final String VERSION = "1.0"; private static Main INSTANCE; public static Main getInstance(){return INSTANCE;} public static String path = System.getProperty("user.dir"); @SidedProxy(clientSide = "me.darki.ultrareal.proxy.ClientProxy", serverSide = "me.darki.ultrareal.proxy.ServerProxy") public static ServerProxy proxy; public static HealPack healPack = new HealPack(); //------------------------------------------------------------------------------------------\\ @EventHandler public void preInit(FMLPreInitializationEvent e){ INSTANCE = this; registerItems(); registerEvents(); } @EventHandler public void init(FMLInitializationEvent e){ NetworkRegistry.INSTANCE.registerGuiHandler(INSTANCE, new GuiHandler()); SoundsManager.registerSounds(); } @EventHandler public void postInit(FMLPostInitializationEvent e){ proxy.registerClientStuff(); io(); } //------------------------------------------------------------------------------------------\\ private void io(){ new File(path + "\\", "UltraReal").mkdirs(); path = path + "\\" + "UltraReal"; new File(path, "UltraReal.data"); } private void registerItems(){ GameRegistry.register(healPack); } private void registerEvents(){ MinecraftForge.EVENT_BUS.register(new OverlayRenderEvents()); MinecraftForge.EVENT_BUS.register(new WorldEvents()); MinecraftForge.EVENT_BUS.register(new PlayerEvents()); MinecraftForge.EVENT_BUS.register(new BlackScreen()); } } And my Event Class where I open the GUI: @SubscribeEvent public void onJoin(EntityJoinWorldEvent e){ if(e.getEntity() instanceof EntityPlayer && !shown){ EntityPlayer player = (EntityPlayer) e.getEntity(); player.openGui(Main.getInstance(), GuiHandler.GUI_ID_CB, e.getWorld(), player.getPosition().getX(), player.getPosition().getY(), player.getPosition().getZ()); shown = true; } } private boolean shown = false;
  12. Is there another way to do that at this moment?
  13. Is there an Event that will fire when a Player take off or put on Armor or something like that?
  14. Today I changed the ClassPath of my PC after that all my Mod Eclipse Projects have the same errors: http://prntscr.com/cj0jqk I tried to change the ClassPath back to the old and but nothing changed, still the same error. Why?
  15. Rather i found it
  16. Yeah I searched for it 10 minutes ago.
  17. Everyone is making mistakes and now its working thanks a lot^^
  18. Nothing changed... { "parent": "block/cube_all", "textures": { "olportal": "chemmix:blocks/olportal" }, "display": { "thirdperson": { "rotation": [ 10, -45, 170 ], "translation": [ 0, 1.5, -2.75 ], "scale": [ 0.375, 0.375, 0.375 ] } } }
  19. What did I wrong
  20. I never did it like this I am new at this
  21. I am making a new Dimension and working at the Protal Block. The hitbox of the Portal is working but the texture is not working, The front and the back texture is purple. Here the PortalBlock class: package me.darki.chemmix.blocks; import java.util.Random; import com.google.common.cache.LoadingCache; import me.darki.chemmix.Main; import net.minecraft.block.Block; import net.minecraft.block.BlockBreakable; import net.minecraft.block.material.Material; import net.minecraft.block.properties.IProperty; import net.minecraft.block.properties.PropertyEnum; import net.minecraft.block.state.BlockStateContainer; import net.minecraft.block.state.BlockWorldState; import net.minecraft.block.state.IBlockState; import net.minecraft.block.state.pattern.BlockPattern; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityList; import net.minecraft.entity.monster.EntityPigZombie; import net.minecraft.init.Blocks; import net.minecraft.init.SoundEvents; import net.minecraft.item.ItemMonsterPlacer; import net.minecraft.item.ItemStack; import net.minecraft.util.BlockRenderLayer; import net.minecraft.util.EnumFacing; import net.minecraft.util.EnumParticleTypes; import net.minecraft.util.Rotation; import net.minecraft.util.SoundCategory; import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.BlockPos; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; public class BlockPortalBlock extends BlockBreakable { public static final PropertyEnum<EnumFacing.Axis> AXIS = PropertyEnum.<EnumFacing.Axis>create("axis", EnumFacing.Axis.class, new EnumFacing.Axis[] {EnumFacing.Axis.X, EnumFacing.Axis.Z}); protected static final AxisAlignedBB field_185683_b = new AxisAlignedBB(0.0D, 0.0D, 0.375D, 1.0D, 1.0D, 0.625D); protected static final AxisAlignedBB field_185684_c = new AxisAlignedBB(0.375D, 0.0D, 0.0D, 0.625D, 1.0D, 1.0D); protected static final AxisAlignedBB field_185685_d = new AxisAlignedBB(0.375D, 0.0D, 0.375D, 0.625D, 1.0D, 0.625D); public BlockPortalBlock() { super(Material.portal, false); this.setDefaultState(this.blockState.getBaseState().withProperty(AXIS, EnumFacing.Axis.X)); this.setTickRandomly(true); setHardness(1000000000000F); setCreativeTab(Main.chemTab); setRegistryName("olportal"); setUnlocalizedName("olportal"); } /** * Called When an Entity Collided with the Block */ public void onEntityCollidedWithBlock(World worldIn, BlockPos pos, IBlockState state, Entity entityIn) { if (!entityIn.isRiding() && !entityIn.isBeingRidden() && entityIn.isNonBoss()) { entityIn.setPortal(pos); } } public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos) { switch ((EnumFacing.Axis)state.getValue(AXIS)) { case X: return field_185683_b; case Y: default: return field_185685_d; case Z: return field_185684_c; } } public void updateTick(World worldIn, BlockPos pos, IBlockState state, Random rand) { super.updateTick(worldIn, pos, state, rand); if (worldIn.provider.isSurfaceWorld() && worldIn.getGameRules().getBoolean("doMobSpawning") && rand.nextInt(2000) < worldIn.getDifficulty().getDifficultyId()) { int i = pos.getY(); BlockPos blockpos; for (blockpos = pos; !worldIn.getBlockState(blockpos).isFullyOpaque() && blockpos.getY() > 0; blockpos = blockpos.down()) { ; } if (i > 0 && !worldIn.getBlockState(blockpos.up()).isNormalCube()) { Entity entity = ItemMonsterPlacer.spawnCreature(worldIn, EntityList.func_188430_a(EntityPigZombie.class), (double)blockpos.getX() + 0.5D, (double)blockpos.getY() + 1.1D, (double)blockpos.getZ() + 0.5D); if (entity != null) { entity.timeUntilPortal = entity.getPortalCooldown(); } } } } public AxisAlignedBB getSelectedBoundingBox(IBlockState blockState, World worldIn, BlockPos pos) { return NULL_AABB; } public static int getMetaForAxis(EnumFacing.Axis axis) { return axis == EnumFacing.Axis.X ? 1 : (axis == EnumFacing.Axis.Z ? 2 : 0); } public boolean isFullCube(IBlockState state) { return false; } public boolean func_176548_d(World worldIn, BlockPos pos) { BlockPortalBlock.Size blockportal$size = new BlockPortalBlock.Size(worldIn, pos, EnumFacing.Axis.X); if (blockportal$size.func_150860_b() && blockportal$size.field_150864_e == 0) { blockportal$size.func_150859_c(); return true; } else { BlockPortalBlock.Size blockportal$size1 = new BlockPortalBlock.Size(worldIn, pos, EnumFacing.Axis.Z); if (blockportal$size1.func_150860_b() && blockportal$size1.field_150864_e == 0) { blockportal$size1.func_150859_c(); return true; } else { return false; } } } /** * Called when a neighboring block changes. */ public void onNeighborBlockChange(World worldIn, BlockPos pos, IBlockState state, Block neighborBlock) { EnumFacing.Axis enumfacing$axis = (EnumFacing.Axis)state.getValue(AXIS); if (enumfacing$axis == EnumFacing.Axis.X) { BlockPortalBlock.Size blockportal$size = new BlockPortalBlock.Size(worldIn, pos, EnumFacing.Axis.X); if (!blockportal$size.func_150860_b() || blockportal$size.field_150864_e < blockportal$size.field_150868_h * blockportal$size.field_150862_g) { worldIn.setBlockState(pos, Blocks.air.getDefaultState()); } } else if (enumfacing$axis == EnumFacing.Axis.Z) { BlockPortalBlock.Size blockportal$size1 = new BlockPortalBlock.Size(worldIn, pos, EnumFacing.Axis.Z); if (!blockportal$size1.func_150860_b() || blockportal$size1.field_150864_e < blockportal$size1.field_150868_h * blockportal$size1.field_150862_g) { worldIn.setBlockState(pos, Blocks.air.getDefaultState()); } } } @SideOnly(Side.CLIENT) public boolean shouldSideBeRendered(IBlockState blockState, IBlockAccess blockAccess, BlockPos pos, EnumFacing side) { pos = pos.offset(side); EnumFacing.Axis enumfacing$axis = null; if (blockState.getBlock() == this) { enumfacing$axis = (EnumFacing.Axis)blockState.getValue(AXIS); if (enumfacing$axis == null) { return false; } if (enumfacing$axis == EnumFacing.Axis.Z && side != EnumFacing.EAST && side != EnumFacing.WEST) { return false; } if (enumfacing$axis == EnumFacing.Axis.X && side != EnumFacing.SOUTH && side != EnumFacing.NORTH) { return false; } } boolean flag = blockAccess.getBlockState(pos.west()).getBlock() == this && blockAccess.getBlockState(pos.west(2)).getBlock() != this; boolean flag1 = blockAccess.getBlockState(pos.east()).getBlock() == this && blockAccess.getBlockState(pos.east(2)).getBlock() != this; boolean flag2 = blockAccess.getBlockState(pos.north()).getBlock() == this && blockAccess.getBlockState(pos.north(2)).getBlock() != this; boolean flag3 = blockAccess.getBlockState(pos.south()).getBlock() == this && blockAccess.getBlockState(pos.south(2)).getBlock() != this; boolean flag4 = flag || flag1 || enumfacing$axis == EnumFacing.Axis.X; boolean flag5 = flag2 || flag3 || enumfacing$axis == EnumFacing.Axis.Z; return flag4 && side == EnumFacing.WEST ? true : (flag4 && side == EnumFacing.EAST ? true : (flag5 && side == EnumFacing.NORTH ? true : flag5 && side == EnumFacing.SOUTH)); } /** * Returns the quantity of items to drop on block destruction. */ public int quantityDropped(Random random) { return 0; } public ItemStack getItem(World worldIn, BlockPos pos, IBlockState state) { return null; } /** * Convert the given metadata into a BlockState for this Block */ public IBlockState getStateFromMeta(int meta) { return this.getDefaultState().withProperty(AXIS, (meta & 3) == 2 ? EnumFacing.Axis.Z : EnumFacing.Axis.X); } @SideOnly(Side.CLIENT) public BlockRenderLayer getBlockLayer() { return BlockRenderLayer.TRANSLUCENT; } @SideOnly(Side.CLIENT) public void randomDisplayTick(IBlockState worldIn, World pos, BlockPos state, Random rand) { if (rand.nextInt(100) == 0) { pos.playSound((double)state.getX() + 0.5D, (double)state.getY() + 0.5D, (double)state.getZ() + 0.5D, SoundEvents.block_portal_ambient, SoundCategory.BLOCKS, 0.5F, rand.nextFloat() * 0.4F + 0.8F, false); } for (int i = 0; i < 4; ++i) { double d0 = (double)((float)state.getX() + rand.nextFloat()); double d1 = (double)((float)state.getY() + rand.nextFloat()); double d2 = (double)((float)state.getZ() + rand.nextFloat()); double d3 = ((double)rand.nextFloat() - 0.5D) * 0.5D; double d4 = ((double)rand.nextFloat() - 0.5D) * 0.5D; double d5 = ((double)rand.nextFloat() - 0.5D) * 0.5D; int j = rand.nextInt(2) * 2 - 1; if (pos.getBlockState(state.west()).getBlock() != this && pos.getBlockState(state.east()).getBlock() != this) { d0 = (double)state.getX() + 0.5D + 0.25D * (double)j; d3 = (double)(rand.nextFloat() * 2.0F * (float)j); } else { d2 = (double)state.getZ() + 0.5D + 0.25D * (double)j; d5 = (double)(rand.nextFloat() * 2.0F * (float)j); } pos.spawnParticle(EnumParticleTypes.PORTAL, d0, d1, d2, d3, d4, d5, new int[0]); } } /** * Convert the BlockState into the correct metadata value */ public int getMetaFromState(IBlockState state) { return getMetaForAxis((EnumFacing.Axis)state.getValue(AXIS)); } /** * Returns the blockstate with the given rotation from the passed blockstate. If inapplicable, returns the passed * blockstate. */ public IBlockState withRotation(IBlockState state, Rotation rot) { switch (rot) { case COUNTERCLOCKWISE_90: case CLOCKWISE_90: switch ((EnumFacing.Axis)state.getValue(AXIS)) { case X: return state.withProperty(AXIS, EnumFacing.Axis.Z); case Z: return state.withProperty(AXIS, EnumFacing.Axis.X); default: return state; } default: return state; } } protected BlockStateContainer createBlockState() { return new BlockStateContainer(this, new IProperty[] {AXIS}); } public BlockPattern.PatternHelper func_181089_f(World p_181089_1_, BlockPos p_181089_2_) { EnumFacing.Axis enumfacing$axis = EnumFacing.Axis.Z; BlockPortalBlock.Size blockportal$size = new BlockPortalBlock.Size(p_181089_1_, p_181089_2_, EnumFacing.Axis.X); LoadingCache<BlockPos, BlockWorldState> loadingcache = BlockPattern.func_181627_a(p_181089_1_, true); if (!blockportal$size.func_150860_b()) { enumfacing$axis = EnumFacing.Axis.X; blockportal$size = new BlockPortalBlock.Size(p_181089_1_, p_181089_2_, EnumFacing.Axis.Z); } if (!blockportal$size.func_150860_b()) { return new BlockPattern.PatternHelper(p_181089_2_, EnumFacing.NORTH, EnumFacing.UP, loadingcache, 1, 1, 1); } else { int[] aint = new int[EnumFacing.AxisDirection.values().length]; EnumFacing enumfacing = blockportal$size.field_150866_c.rotateYCCW(); BlockPos blockpos = blockportal$size.field_150861_f.up(blockportal$size.func_181100_a() - 1); for (EnumFacing.AxisDirection enumfacing$axisdirection : EnumFacing.AxisDirection.values()) { BlockPattern.PatternHelper blockpattern$patternhelper = new BlockPattern.PatternHelper(enumfacing.getAxisDirection() == enumfacing$axisdirection ? blockpos : blockpos.offset(blockportal$size.field_150866_c, blockportal$size.func_181101_b() - 1), EnumFacing.getFacingFromAxis(enumfacing$axisdirection, enumfacing$axis), EnumFacing.UP, loadingcache, blockportal$size.func_181101_b(), blockportal$size.func_181100_a(), 1); for (int i = 0; i < blockportal$size.func_181101_b(); ++i) { for (int j = 0; j < blockportal$size.func_181100_a(); ++j) { BlockWorldState blockworldstate = blockpattern$patternhelper.translateOffset(i, j, 1); if (blockworldstate.getBlockState() != null && blockworldstate.getBlockState().getMaterial() != Material.air) { ++aint[enumfacing$axisdirection.ordinal()]; } } } } EnumFacing.AxisDirection enumfacing$axisdirection1 = EnumFacing.AxisDirection.POSITIVE; for (EnumFacing.AxisDirection enumfacing$axisdirection2 : EnumFacing.AxisDirection.values()) { if (aint[enumfacing$axisdirection2.ordinal()] < aint[enumfacing$axisdirection1.ordinal()]) { enumfacing$axisdirection1 = enumfacing$axisdirection2; } } return new BlockPattern.PatternHelper(enumfacing.getAxisDirection() == enumfacing$axisdirection1 ? blockpos : blockpos.offset(blockportal$size.field_150866_c, blockportal$size.func_181101_b() - 1), EnumFacing.getFacingFromAxis(enumfacing$axisdirection1, enumfacing$axis), EnumFacing.UP, loadingcache, blockportal$size.func_181101_b(), blockportal$size.func_181100_a(), 1); } } public static class Size { private final World world; private final EnumFacing.Axis axis; private final EnumFacing field_150866_c; private final EnumFacing field_150863_d; private int field_150864_e = 0; private BlockPos field_150861_f; private int field_150862_g; private int field_150868_h; public Size(World worldIn, BlockPos p_i45694_2_, EnumFacing.Axis p_i45694_3_) { this.world = worldIn; this.axis = p_i45694_3_; if (p_i45694_3_ == EnumFacing.Axis.X) { this.field_150863_d = EnumFacing.EAST; this.field_150866_c = EnumFacing.WEST; } else { this.field_150863_d = EnumFacing.NORTH; this.field_150866_c = EnumFacing.SOUTH; } for (BlockPos blockpos = p_i45694_2_; p_i45694_2_.getY() > blockpos.getY() - 21 && p_i45694_2_.getY() > 0 && this.func_150857_a(worldIn.getBlockState(p_i45694_2_.down()).getBlock()); p_i45694_2_ = p_i45694_2_.down()) { ; } int i = this.func_180120_a(p_i45694_2_, this.field_150863_d) - 1; if (i >= 0) { this.field_150861_f = p_i45694_2_.offset(this.field_150863_d, i); this.field_150868_h = this.func_180120_a(this.field_150861_f, this.field_150866_c); if (this.field_150868_h < 2 || this.field_150868_h > 21) { this.field_150861_f = null; this.field_150868_h = 0; } } if (this.field_150861_f != null) { this.field_150862_g = this.func_150858_a(); } } protected int func_180120_a(BlockPos p_180120_1_, EnumFacing p_180120_2_) { int i; for (i = 0; i < 22; ++i) { BlockPos blockpos = p_180120_1_.offset(p_180120_2_, i); if (!this.func_150857_a(this.world.getBlockState(blockpos).getBlock()) || this.world.getBlockState(blockpos.down()).getBlock() != Main.portalStone) { break; } } Block block = this.world.getBlockState(p_180120_1_.offset(p_180120_2_, i)).getBlock(); return block == Main.portalStone ? i : 0; } public int func_181100_a() { return this.field_150862_g; } public int func_181101_b() { return this.field_150868_h; } protected int func_150858_a() { label24: for (this.field_150862_g = 0; this.field_150862_g < 21; ++this.field_150862_g) { for (int i = 0; i < this.field_150868_h; ++i) { BlockPos blockpos = this.field_150861_f.offset(this.field_150866_c, i).up(this.field_150862_g); Block block = this.world.getBlockState(blockpos).getBlock(); if (!this.func_150857_a(block)) { break label24; } if (block == Main.portalBlock) { ++this.field_150864_e; } if (i == 0) { block = this.world.getBlockState(blockpos.offset(this.field_150863_d)).getBlock(); if (block != Main.portalStone) { break label24; } } else if (i == this.field_150868_h - 1) { block = this.world.getBlockState(blockpos.offset(this.field_150866_c)).getBlock(); if (block != Main.portalStone) { break label24; } } } } for (int j = 0; j < this.field_150868_h; ++j) { if (this.world.getBlockState(this.field_150861_f.offset(this.field_150866_c, j).up(this.field_150862_g)).getBlock() != Main.portalStone) { this.field_150862_g = 0; break; } } if (this.field_150862_g <= 21 && this.field_150862_g >= 3) { return this.field_150862_g; } else { this.field_150861_f = null; this.field_150868_h = 0; this.field_150862_g = 0; return 0; } } protected boolean func_150857_a(Block p_150857_1_) { return p_150857_1_.getMaterial(p_150857_1_.getDefaultState()) == Material.air || p_150857_1_ == Blocks.fire || p_150857_1_ == Main.portalBlock; } public boolean func_150860_b() { return this.field_150861_f != null && this.field_150868_h >= 2 && this.field_150868_h <= 21 && this.field_150862_g >= 3 && this.field_150862_g <= 21; } public void func_150859_c() { for (int i = 0; i < this.field_150868_h; ++i) { BlockPos blockpos = this.field_150861_f.offset(this.field_150866_c, i); for (int j = 0; j < this.field_150862_g; ++j) { this.world.setBlockState(blockpos.up(j), Main.portalBlock.getDefaultState().withProperty(BlockPortalBlock.AXIS, this.axis), 2); } } } } } And the json files: Blockstate: { "variants": { "axis=z": { "model": "chemmix:olportal_ew" }, "axis=x": { "model": "chemmix:olportal_ns" } } } Models Block EW: { "textures": { "particle": "chemmix:blocks/olportal", "portal": "chemmix:blocks/olportal" }, "elements": [ { "from": [ 6, 0, 0 ], "to": [ 10, 16, 16 ], "faces": { "east": { "uv": [ 0, 0, 16, 16 ], "texture": "#olportal" }, "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#olportal" } } } ] } Models Block NS: { "textures": { "particle": "chemmix:blocks/olportal", "portal": "chemmix:blocks/olportal" }, "elements": [ { "from": [ 0, 0, 6 ], "to": [ 16, 16, 10 ], "faces": { "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#olportal" }, "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#olportal" } } } ] } Models Item: { "parent": "block/cube_all", "textures": { "all": "chemmix:blocks/olportal" }, "display": { "thirdperson": { "rotation": [ 10, -45, 170 ], "translation": [ 0, 1.5, -2.75 ], "scale": [ 0.375, 0.375, 0.375 ] } } }
  22. I want to make a Blackscreen thats starts fading in when you have only 3 air when you are under water and when you have 0 air and starts drowning that the blackscreen is full faded in. And when you come over water when its starts fading in that the blackscreen instantly fading out. I hope you understand this. An Example is Subnautica, when you have not enough air. The screen will darker
  23. So hi everyone, At the moment I try to make a realistic mod therefore I make a character builder, but I have 2 Bugs. First of all the Class: GuiScreen: public class CharacterBuilder extends GuiScreen{ private GuiButtonExt bOk = new GuiButtonExt(0, width / 2 - 50, height / 2 + 5, 100, 20, "Start"); @Override public void initGui() { buttonList.add(bOk); } @Override protected void actionPerformed(GuiButton button) throws IOException { if(button == bOk){ mc.displayGuiScreen((GuiScreen)null); } super.actionPerformed(button); } @Override public void drawScreen(int mouseX, int mouseY, float partialTicks) { drawDefaultBackground(); super.drawScreen(mouseX, mouseY, partialTicks); } } Now the First Bug: I made a Ok Button this Button should close the GuiScreen but it wont be closed when you click the button. Second Bug: I tried to open the Screen when you join a world but the Screen wont be opened. Here the JoinEvent: @SubscribeEvent public void onJoin(EntityJoinWorldEvent e){ if(e.getEntity() instanceof EntityPlayer){ EntityPlayer player = (EntityPlayer) e.getEntity(); Minecraft.getMinecraft().displayGuiScreen(new CharacterBuilder()); } } The Event will called andMinecraft.getMinecraft().displayGuiScreen(new CharacterBuilder()); will be called too.
  24. Thanks man, now its working...but one little question I have anymore. Why is there a 10: NBTTagList list = compound.getTagList("ItemStacks-" + ID, 10); in: @Override public void readFromNBT(NBTTagCompound compound) { super.readFromNBT(compound); NBTTagList list = compound.getTagList("ItemStacks-" + ID, 10); this.inv = new InventoryBasic("Chemical Mixer", false, 3); for(int i = 0; i < list.tagCount(); i++){ NBTTagCompound tag = list.getCompoundTagAt(i); byte b = tag.getByte("Slot"); if(b >= 0 && b < inv.getSizeInventory()){ inv.setInventorySlotContents(b, ItemStack.loadItemStackFromNBT(tag)); } } }
  25. Yeah this is what I said when I add the Slot to the Container with the TileEntityInventory the inventory seems to be null
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.