Ewe Loon
-
Posts
158 -
Joined
-
Last visited
Posts posted by Ewe Loon
-
-
I have created flying mounts (Pegasus] and I want to stop players from dismounting (pressing sneak key) while flying , its kind of fatal at heights
but i cant find a way to stop it.
-
inn 1.7.10 i think you might want to look at rotationPitch and rotationYaw
-
Does anyone know if there is a way to prevent a player from dismounting ?
-
worked perfectly, thank-you
-
How do I make ExtendedProperties survive Death
I am using ExtendedProperties to store keys for players , but they disappear when the player dies,
how do i get them to survive death
-
I read somewhere that mobs have a delayed tick.
have you actually tried it ?
I assume you are referring to movement not animation , by this i mean going to block 2,64,90 , then to block 5,55,96 etc
if this is the case all you have to do is set a new destination as soon as (or just before) they reach the the connecting point (it worked for me)
-
in the case of your code change to
@Override protected boolean interact(EntityPlayer player) { ItemStack cei=player.getCurrentEquippedItem(); if(cei !=null && cei.getItem() == ModItems.staff){ System.out.println("interact called"); if (cei.stackTagCompound == null){ cei.setTagCompound(new NBTTagCompound()); } cei.stackTagCompound.setInteger("target", this.getEntityId()); // the problem line } return super.interact(player); }
though as diesieben07 said this.getEntityId() will change when the entity unloads
-
@Override
public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z)
{
return null;
}
should be returning the Gui to open
and use
player.openGui(mod.instance, GUI_ID, world, x, y, z);
to open the gui
-
i recomend adding a debug line to excavate method
System.out.println("x="+x+" y="+y+" z="+z);
also change world.setBlockToAir(x, y, z); to set it to something else , to verify that x,y,z arnt pointing to a block that is already air
might help find the problem
-
where is the center point of your arrow ?
set it to the tip of the arrow,
-
can you post the block code too,
if its using custom renderers post them as well
-
this is the post he made
public static void removeFurnaceRecipe(ItemStack stack) { Map recipes = FurnaceRecipes.smelting().getSmeltingList(); Iterator entries = recipes.entrySet().iterator(); while (entries.hasNext()) { Entry thisEntry = (Entry) entries.next(); if (stack.getItem() != null && stack.getItem() == Items.baked_potato) { entries.remove(); } } }
problem 1
if (stack.getItem() != null && stack.getItem() == Items.baked_potato) {
this is testing to see what the item passes to the method is not the item from the recipe, in the very first post he actually had this bit correct
problem 2
entries.remove();
is removing it from the Iterator not the Recipe HashMap it should be
recipes.remove(thisEntry.getKey());
just as a note, removing the items from a hashmap can cause errors while reading through the Map
I would recommend instead of removing immediately create a list of items to remove then remove them after scanning the list
like this
public static void removeFurnaceRecipe(ItemStack stack) { Map<ItemStack, ItemStack> recipes = FurnaceRecipes.smelting().getSmeltingList(); LinkedList<ItemStack> remlist=new LinkedList<ItemStack>(); Iterator<Entry<ItemStack, ItemStack>> entries = recipes.entrySet().iterator(); while (entries.hasNext()) { Entry<ItemStack, ItemStack> thisEntry = (Entry<ItemStack, ItemStack>) entries.next(); if (ItemStack.areItemStacksEqual(thisEntry.getValue(), stack)) { remlist.add(thisEntry.getKey()); } } for(ItemStack rm:remlist) recipes.remove(rm); }
-
My Skyblock mod uses a custom chunk generator , but it keeps the original boime map
-
Yes, Failender your right, he isnt testing the recipe at all is he, in or out
There are actually 2 major errors
both these 2 lines contain the errors
if (stack.getItem() != null && stack.getItem() == Items.baked_potato) { entries.remove();
-
Overriden WorldProvider (thanks Ernio)
however i got an error when the trying to get the biomes to generate (this only happens when the player spawn where chunks have not been generated and only sometimes)
here is the stacktrace
at net.minecraft.world.gen.ChunkProviderServer.originalLoadChunk(ChunkProviderServer.java:201) ~[ChunkProviderServer.class:?] at net.minecraft.world.gen.ChunkProviderServer.loadChunk(ChunkProviderServer.java:151) ~[ChunkProviderServer.class:?] at net.minecraft.server.management.PlayerManager$PlayerInstance.<init>(PlayerManager.java:411) ~[PlayerManager$PlayerInstance.class:?] at net.minecraft.server.management.PlayerManager.getOrCreateChunkWatcher(PlayerManager.java:114) ~[PlayerManager.class:?] at net.minecraft.server.management.PlayerManager.addPlayer(PlayerManager.java:158) ~[PlayerManager.class:?] at net.minecraft.server.management.ServerConfigurationManager.func_72375_a(ServerConfigurationManager.java:256) ~[serverConfigurationManager.class:?] at net.minecraft.server.management.ServerConfigurationManager.playerLoggedIn(ServerConfigurationManager.java:314) ~[serverConfigurationManager.class:?] at net.minecraft.server.management.ServerConfigurationManager.initializeConnectionToPlayer(ServerConfigurationManager.java:174) ~[serverConfigurationManager.class:?] at cpw.mods.fml.common.network.handshake.NetworkDispatcher.completeServerSideConnection(NetworkDispatcher.java:173) ~[NetworkDispatcher.class:?] at cpw.mods.fml.common.network.handshake.NetworkDispatcher.completeHandshake(NetworkDispatcher.java:446) ~[NetworkDispatcher.class:?] at cpw.mods.fml.common.network.internal.HandshakeCompletionHandler.channelRead0(HandshakeCompletionHandler.java:17) ~[HandshakeCompletionHandler.class:?] at cpw.mods.fml.common.network.internal.HandshakeCompletionHandler.channelRead0(HandshakeCompletionHandler.java:11) ~[HandshakeCompletionHandler.class:?] at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:98) ~[simpleChannelInboundHandler.class:?] at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:337) [DefaultChannelHandlerContext.class:?] at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:323) [DefaultChannelHandlerContext.class:?] at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) [MessageToMessageDecoder.class:?] at io.netty.handler.codec.MessageToMessageCodec.channelRead(MessageToMessageCodec.java:111) [MessageToMessageCodec.class:?] at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:337) [DefaultChannelHandlerContext.class:?] at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:323) [DefaultChannelHandlerContext.class:?] at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:785) [DefaultChannelPipeline.class:?] at io.netty.channel.embedded.EmbeddedChannel.writeInbound(EmbeddedChannel.java:169) [EmbeddedChannel.class:?] at cpw.mods.fml.common.network.internal.FMLProxyPacket.processPacket(FMLProxyPacket.java:86) [FMLProxyPacket.class:?] at net.minecraft.network.NetworkManager.processReceivedPackets(NetworkManager.java:247) [NetworkManager.class:?] at net.minecraft.network.NetworkSystem.networkTick(NetworkSystem.java:182) [NetworkSystem.class:?] at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:736) [MinecraftServer.class:?] at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:624) [MinecraftServer.class:?] at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:118) [integratedServer.class:?] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:495) [MinecraftServer.class:?] at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:762) [MinecraftServer$2.class:?] Caused by: java.lang.NullPointerException at net.minecraft.world.biome.WorldChunkManager.getRainfall(WorldChunkManager.java:88) ~[WorldChunkManager.class:?] at net.minecraft.world.biome.BiomeCache$Block.<init>(BiomeCache.java:109) ~[biomeCache$Block.class:?] at net.minecraft.world.biome.BiomeCache.getBiomeCacheBlock(BiomeCache.java:39) ~[biomeCache.class:?] at net.minecraft.world.biome.BiomeCache.getCachedBiomes(BiomeCache.java:88) ~[biomeCache.class:?] at net.minecraft.world.biome.WorldChunkManager.getBiomeGenAt(WorldChunkManager.java:183) ~[WorldChunkManager.class:?] at net.minecraft.world.biome.WorldChunkManager.loadBlockGeneratorData(WorldChunkManager.java:165) ~[WorldChunkManager.class:?] at me.el.LoonTerra.BaseChunkProvider.provideChunk(BaseChunkProvider.java:54) ~[baseChunkProvider.class:?] at net.minecraft.world.gen.ChunkProviderServer.originalLoadChunk(ChunkProviderServer.java:192) ~[ChunkProviderServer.class:?]
It appears that it is failing while trying to get rainfall levels
This is how im reading the biome data
protected BiomeGenBase[] getBiomeData(int cx, int cz) { return this.worldObj.getWorldChunkManager().loadBlockGeneratorData(this.biomesForGeneration, cx * 16, cz * 16, 16, 16); }
-
The WorldProvider's class is WorldProviderSurface
and I cant find any way to Override it
-
the only classes i'm overiding are WorldType and IChunkProvider
WorldType is use by the internal world generator to generate DEFAULT ,FLAT ,AMPLIFIED ,LARGE_BIOMES and DEFAULT_1_1 Types
by overriding this I can set the main world type to My own generated world
Currently i have 2 Islands and SkyBlock, selectable at world creation time in single player
Note. these are Dimension 0, not additional Dimentions
-
thankyou, makes sense but unfortunatly WorldProvider isnt being overriden , but ill look and see if i can override it
-
I tend not to use Iterator myself (but thats because i didnt grow up with them being there)
to me it looks like you are searching the this of item you put into the furnace , and as far as i know Items.baked_potato comes out, not goes in
secondly these 2 things are your friends when dealing with unknowns
System.out.println(unknown);
unknown.getClass().getSimpleName();
and togeather
System.out.println(unknown.getClass().getSimpleName());
-
I just copied this from the client proxy of one of my mods PreInit method
GameTable.gameTableRenderID = RenderingRegistry.getNextAvailableRenderId(); RenderingRegistry.registerBlockHandler(GameTable.gameTableRenderID, new GameTableRenderer()); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityGameTable.class, new TileEntityGameTableRenderer());
this registers a renderer to the block and one to the tileentity
hope this is of some help
-
I have a WorldType and ChunkGenerator to generate a new world type
the problem is I cant find a way to set the spawn location to where it needs to be
this is what i have found WorldInfo.setSpawnPosition() is call by WorldServer.createSpawnPosition() during initialization
I havn't been able to find anywhere in code I can set it myself after this point and before the player is spawned in single player mode
I tried teleporting the player when first logging in but this sometimes causes fetal errors
this is the trace from where i trapped during WorldServer.createSpawnPosition()
at me.el.LoonTerra.BaseChunkProvider.provideChunk(BaseChunkProvider.java:56) at net.minecraft.world.gen.ChunkProviderServer.originalLoadChunk(ChunkProviderServer.java:192) at net.minecraft.world.gen.ChunkProviderServer.loadChunk(ChunkProviderServer.java:151) at net.minecraft.world.gen.ChunkProviderServer.loadChunk(ChunkProviderServer.java:121) at net.minecraft.world.gen.ChunkProviderServer.provideChunk(ChunkProviderServer.java:223) at net.minecraft.world.World.getChunkFromChunkCoords(World.java:485) at net.minecraft.world.World.getBlock(World.java:390) at net.minecraft.world.World.isAirBlock(World.java:413) at net.minecraft.world.World.getTopBlock(World.java:374) at net.minecraft.world.WorldProvider.canCoordinateBeSpawn(WorldProvider.java:97) at net.minecraft.world.WorldServer.createSpawnPosition(WorldServer.java:807) at net.minecraft.world.WorldServer.initialize(WorldServer.java:771) at net.minecraft.world.World.<init>(World.java:299) at net.minecraft.world.WorldServer.<init>(WorldServer.java:104) at net.minecraft.server.integrated.IntegratedServer.loadAllWorlds(IntegratedServer.java:63) at net.minecraft.server.integrated.IntegratedServer.startServer(IntegratedServer.java:96) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:455) at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:762)
any ideas would be appreciated
-
when you want to rename a class in eclipse do the following
right click the class in the package explorer
from the dropdown select refactor then rename
items are remembered in a list by their name, if you change this the map will no longer know what the old items/ blocks where as they are no longer registered
these old items will be removed from the map
to prevent this, leave the old items in the mod, but remove them from the creative tabs and recipes
create the new items as new items
I also noticed you are registering the item by the first 5 letters of its unlocalized name, this isnt a good idea as you may end up with 2 items being registered with the same name
-
if you only want to know if a key has been pressed you can use
@Override protected void keyTyped(char p_73869_1_, int p_73869_2_) { // TODO Auto-generated method stub super.keyTyped(p_73869_1_, p_73869_2_); }
and you can also use
@Override public void handleKeyboardInput() { // TODO Auto-generated method stub super.handleKeyboardInput(); }
but as far as i can see there are no function that test to see if a key is actually held down
KeyBinding can be used to allow the client to set the keys to be used
KeyBinding.getIsKeyPressed() and KeyBinding.isPressed()
however these may not work while a gui is open ,
-
I want to add an options menu into some of my mods
I dont want them bound to keys
does anyone know if there is a way to add int the existing options menu
[1.7.10]Axe that cuts whole tree.
in Modder Support
Posted
I created an axe to do that
its not perfect, had major problems with hugemushroom blocks , here is the code for it