Everything posted by f1rSt1kChannel
-
[1.7.10]Change player model and making the size in one block
Thanks. And lowering the height of the eye / camera player?
-
[1.7.10]Change player model and making the size in one block
BUMP
-
[1.6.4] Why world.isRemote is always true?
А я тебе говорил, что хранить переменную надо в NBT
-
[1.7.10]Change player model and making the size in one block
How to change player model and making the size in one block?
- [1.7.2]Multiblock
-
[1.7.10][1180]Ingame Config Files
Look this tutorial: http://minalien.com/minecraft-forge-feature-spotlight-config-guis/
-
Getting Player name?
player.getCommandSenderName();
-
SLOVED[1.7.10]Mod Update Detector
Look my updater: https://www.dropbox.com/sh/8m0dkk7xrx4e53a/AADw2-H9sDqAp98MX4DMInVWa/java/agravaine/agravainelib/updater
-
[1.7.2]Add vanilla mob xp drop..
Helped me FakePlayer FakePlayerFactory.getMinecraft ((WorldServer) world) Working version: public static final Method xpPoints = getExperiencePoints(); @EventHandler public void preInit(FMLPreInitializationEvent event){ MinecraftForge.EVENT_BUS.register(this); } @SubscribeEvent public void dropXP(LivingDropsEvent event){ EntityLivingBase entity = event.entityLiving; World world = entity.worldObj; if(entity != null){ EntityLivingBase living = (EntityLivingBase)entity; if(!world.isRemote && !event.recentlyHit){ int xp = 0; try{ xp = (Integer)xpPoints.invoke(living, FakePlayerFactory.getMinecraft((WorldServer)world)); }catch(Exception e){} while(xp > 0){ int cap = EntityXPOrb.getXPSplit(xp); xp -= cap; living.worldObj.spawnEntityInWorld(new EntityXPOrb(living.worldObj, living.posX, living.posY, living.posZ, cap)); } } } } public static Method getExperiencePoints(){ Method method = null; try{ method = EntityLivingBase.class.getDeclaredMethod("getExperiencePoints", EntityPlayer.class); method.setAccessible(true); }catch(Exception e){} return method; } Thank you, guys! =)
-
[1.7.2]Making an Item lose durability while Crafting :o
In item class: public boolean doesContainerItemLeaveCraftingGrid(ItemStack iStack){ return false; } public boolean hasContainerItem(){ return true; } public ItemStack getContainerItemStack(ItemStack iStack){ iStack.setItemDamage(iStack.getItemDamage() + 1); return iStack; } In Recipe: GameRegistry.addShapelessRecipe(new ItemStack(Your_Item, 1), new Object[] {new ItemStack(Your_Item_To_Damage, 1, OreDictionary.WILDCARD_VALUE)});
-
[1.7.2]Add vanilla mob xp drop..
Where can I find a player?
-
[1.7.2]Add vanilla mob xp drop..
Right? public static Method getExperiencePoints(){ Method method = null; try{ method = EntityLivingBase.class.getDeclaredMethod("getExperiencePoints", EntityPlayer.class); }catch(Exception e){} method.setAccessible(true); return method; } public static final Method xpPoints = getExperiencePoints(); xp = (Integer)xpPoints.invoke(living, (Object[])null); ?
-
[1.7.2]Add vanilla mob xp drop..
Not work... @SubscribeEvent public void dropXP(LivingDropsEvent event){ EntityLivingBase entity = event.entityLiving; if(entity != null){ EntityLivingBase living = (EntityLivingBase)entity; if(!living.worldObj.isRemote && !event.recentlyHit){ Method getExperiencePoints = null; int xp = 0; try{ getExperiencePoints = EntityLivingBase.class.getDeclaredMethod("getExperiencePoints", EntityPlayer.class); getExperiencePoints.setAccessible(true); xp = (Integer)getExperiencePoints.invoke(null, (Object[])null); }catch(Exception e){ logger.error("Error!", e); } System.out.println(xp); while(xp > 0){ int cap = EntityXPOrb.getXPSplit(xp); xp -= cap; living.worldObj.spawnEntityInWorld(new EntityXPOrb(living.worldObj, living.posX, living.posY, living.posZ, cap)); } } } } d) I do not understand what you wrote... :\
-
[1.7.2]Add vanilla mob xp drop..
My code: @SubscribeEvent public void dropXP(LivingDropsEvent event){ EntityLivingBase entity = event.entityLiving; if(entity != null){ EntityLivingBase living = (EntityLivingBase)entity; int recentlyHit = ObfuscationReflectionHelper.getPrivateValue(EntityLivingBase.class, living, "recentlyHit"); if(!living.worldObj.isRemote && recentlyHit == 0){ Method getExperiencePoints = null; int xp = 0; try{ Class fake = Class.forName("net.minecraft.entity.EntityLivingBase"); getExperiencePoints = fake.getMethod("getExperiencePoints", EntityPlayer.class); xp = (Integer)getExperiencePoints.invoke(null, (Object[])null); }catch(Exception e){ logger.error("Error!", e); } System.out.println(xp); while(xp > 0){ int cap = EntityXPOrb.getXPSplit(xp); xp -= cap; living.worldObj.spawnEntityInWorld(new EntityXPOrb(living.worldObj, living.posX, living.posY, living.posZ, cap)); } } } } Error: java.lang.NoSuchMethodException: net.minecraft.entity.EntityLivingBase.getExperiencePoints(net.minecraft.entity.player.EntityPlayer) at java.lang.Class.getMethod(Unknown Source) ~[?:1.7.0_55] at agravaine.easyxp.EasyXP.dropXP(EasyXP.java:54) [EasyXP.class:?] at cpw.mods.fml.common.eventhandler.ASMEventHandler_7_EasyXP_dropXP_LivingDropsEvent.invoke(.dynamic) [?:?] at cpw.mods.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:51) [ASMEventHandler.class:?] at cpw.mods.fml.common.eventhandler.EventBus.post(EventBus.java:122) [EventBus.class:?] at net.minecraftforge.common.ForgeHooks.onLivingDrops(ForgeHooks.java:297) [ForgeHooks.class:?] at net.minecraft.entity.EntityLivingBase.onDeath(EntityLivingBase.java:1039) [EntityLivingBase.class:?] at net.minecraft.entity.monster.EntityCreeper.onDeath(EntityCreeper.java:200) [EntityCreeper.class:?] at net.minecraft.entity.EntityLivingBase.attackEntityFrom(EntityLivingBase.java:950) [EntityLivingBase.class:?] at net.minecraft.entity.monster.EntityMob.attackEntityFrom(EntityMob.java:84) [EntityMob.class:?] at net.minecraft.entity.EntityLivingBase.fall(EntityLivingBase.java:1139) [EntityLivingBase.class:?] at net.minecraft.entity.monster.EntityCreeper.fall(EntityCreeper.java:83) [EntityCreeper.class:?] at net.minecraft.entity.Entity.updateFallState(Entity.java:1042) [Entity.class:?] at net.minecraft.entity.EntityLivingBase.updateFallState(EntityLivingBase.java:234) [EntityLivingBase.class:?] at net.minecraft.entity.Entity.moveEntity(Entity.java:856) [Entity.class:?] at net.minecraft.entity.EntityLivingBase.moveEntityWithHeading(EntityLivingBase.java:1689) [EntityLivingBase.class:?] at net.minecraft.entity.EntityLivingBase.onLivingUpdate(EntityLivingBase.java:2027) [EntityLivingBase.class:?] at net.minecraft.entity.EntityLiving.onLivingUpdate(EntityLiving.java:431) [EntityLiving.class:?] at net.minecraft.entity.monster.EntityMob.onLivingUpdate(EntityMob.java:39) [EntityMob.class:?] at net.minecraft.entity.EntityLivingBase.onUpdate(EntityLivingBase.java:1820) [EntityLivingBase.class:?] at net.minecraft.entity.EntityLiving.onUpdate(EntityLiving.java:250) [EntityLiving.class:?] at net.minecraft.entity.monster.EntityMob.onUpdate(EntityMob.java:47) [EntityMob.class:?] at net.minecraft.entity.monster.EntityCreeper.onUpdate(EntityCreeper.java:176) [EntityCreeper.class:?] at net.minecraft.world.World.updateEntityWithOptionalForce(World.java:2254) [World.class:?] at net.minecraft.world.WorldServer.updateEntityWithOptionalForce(WorldServer.java:697) [WorldServer.class:?] at net.minecraft.world.World.updateEntity(World.java:2214) [World.class:?] at net.minecraft.world.World.updateEntities(World.java:2064) [World.class:?] at net.minecraft.world.WorldServer.updateEntities(WorldServer.java:528) [WorldServer.class:?] at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:697) [MinecraftServer.class:?] at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:608) [MinecraftServer.class:?] at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:118) [integratedServer.class:?] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:482) [MinecraftServer.class:?] at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:746) [MinecraftServer$2.class:?] 0 This method is exists! Line 417 protected int getExperiencePoints(EntityPlayer par1EntityPlayer) { return 0; }
-
[1.7.2]Add vanilla mob xp drop..
I need to make the experience dropped from mobs not matter whether it killed a player or he died himself. How can this be implemented?
-
[1.7.2]Problem with packets
Packet code remained unchanged. Register: packetSender.registerMessage(PacketOpenGui.class, PacketOpenGui.class, 0, Side.SERVER); Sending: @SubscribeEvent public void keyEvent(KeyInputEvent event){ if(key.getIsKeyPressed() && FMLClientHandler.instance().getClient().inGameHasFocus){ Esoteric.logger.info("MEOW"); Esoteric.packetSender.sendToServer(new PacketOpenGui(Esoteric.instance, 2)); } } Gui handler: public class EsotericGuiHandler implements IGuiHandler{ public Object getServerGuiElement(int id, EntityPlayer player, World world, int x, int y, int z){ TileEntity tileEntity = world.getTileEntity(x, y, z); if(id == 0){ return new ContainerRelic(player.inventory, (TileEntityRelic)tileEntity); } if(id == 1){ return new ContainerCampfire(player.inventory, (TileEntityCampfire)tileEntity); } if(id == 2){ return new ContainerPlayerExtended(player.inventory, !world.isRemote, player); } return null; } public Object getClientGuiElement(int id, EntityPlayer player, World world, int x, int y, int z){ TileEntity tileEntity = world.getTileEntity(x, y, z); if(id == 0){ return new GuiRelic(player.inventory, (TileEntityRelic)tileEntity); } if(id == 1){ return new GuiCampfire(player.inventory, (TileEntityCampfire)tileEntity); } if(id == 2){ return new GuiPlayerExtended(player); } return null; } }
-
[1.7.2]Problem with packets
I have all the same. By the way, now the packet is sent without errors, but still GUI will not open ...
-
[1.7.2]Problem with packets
I need to open by pressing the GUI, can give a working version? P.S Azanor makes in one class and it all works [https://github.com/Azanor/Baubles/blob/master/src/main/java/baubles/common/network/PacketOpenBaublesInventory.java].
-
[1.7.2]Problem with packets
Thanks. Not work... Writes the same thing... My packet: public class PacketOpenGui implements IMessage, IMessageHandler<PacketOpenGui, IMessage>{ Object mod; int id; public PacketOpenGui(){} public PacketOpenGui(Object modGui, int guiId){ mod = modGui; id = guiId; } public void fromBytes(ByteBuf buf){} public void toBytes(ByteBuf buf){} public IMessage onMessage(PacketOpenGui message, MessageContext ctx){ Esoteric.logger.info("DUDE"); EntityPlayerMP player = ctx.getServerHandler().playerEntity; player.openGui(mod, id, player.worldObj, (int)player.posX, (int)player.posY, (int)player.posZ); return null; } }
-
[1.7.2]Problem with packets
How to get there player?
-
[1.7.2]Problem with packets
Hello I'm trying to send a packet to the server to open a GUI, but the console writes the following: [server thread / ERROR] [FML]: Messages for channel Esoteric for side SERVER were not processed by the embedded channel [agravaine.agravainelib.network.packet.message.PacketOpenGui @ 198c9c7]. They have been dropped. Length: 0 Made from the tutorial http://www.minecraftforge.net/wiki/Netty_Packet_Handling.
-
onFoodEaten Event?
Is there something like that?
-
[1.7.2] Laggy generation and two forge questions
О, русский )
-
[1.7.2]Multiblock
I understand. I need at least suggestions on how it can be implemented.
-
[1.7.2]Multiblock
How to make something like this? https://www.youtube.com/watch?v=Q_adb2Af1C0 I need to make a block height of two meters and TileEntity and GUI. And that was the stroke and the collision height of two meters . Sorry for my english.
IPS spam blocked by CleanTalk.