-
How to ? Various operations
I just found another issue with this method. I have an method wich was called on right clic on the entity. I suppose the raycast issued by a clic doesn't collide anymore because now the method isn't called anymore.
-
How to ? Various operations
I tried, same result. I can walk through the entity but it's still pushed away when i stay close.
-
How to ? Various operations
I tried to overwrite the 2 methods but the entity still collides with the player. Is there other methods to implement ?
-
How to ? Various operations
thanks, i will try.
-
How to ? Various operations
Hi, i want to perform some modifications for my mod but don't really know how to apply them, if you can give me some hints please ... I want to : 1) disable mob & animals spawning. So, it's more than simply set mode to peacefull (I'm afraid of sheep's ). I don't know if it can be achieved thanks to an extension of IWorldGenerator ? 2) Register a creature such that the chunks around it will continue to be updated instead of being unloaded. This creature should never be unload. 3) Make a creature uncollidable with other creatures. Meaning for now if the player is on the entity path, it will collide while i would like to avoid this by going through the player (like a ghost mob). My current version is 1.6.2. Thanks.
-
Reduce vision range
I still did not found how to do it ... It can also be a modification in the basic code of minecraft, it's not o be part of a mod. If it's a modification in the render code of the game it's ok.
-
Reduce vision range
Thanks for these hints. I'll have a look to these locations and see if i can find what i need. The best of all solution would be a way to mark blocks as "to render" or "not to render". In fact i have a field of view algorithm and i want the player to see only blocks this algo considers as visible. I suppose there's no build-in solution to do it, so I'm looking to reduce the player vision range to make it looks like only the blocks from the field of view are displayed. So the objective is not really to increase the fog effect but more to block rendering of blocks which distance to the player is higher than 10. But if the fog can be set such that blocks at distance 9 are fully visible and blocks at 10 are absolutely not visible it also works. It's a bit tricky, i know. ^^ Edit : I had a look on renderDistance in the game settings but it seems it doesn't allow to set a custom distance. It looks like more a switch between the different distances already accessible from the option menu. Edit 2 : For the blind potion i found some code stubs concerning it but i cannot find the item in the creative tabs of the game.I forgot to mention that i'm still in 1.6.2. It may be the cause.
-
Reduce vision range
Hi, does anyone know how i can alter the client such that the player is only able to see blocks in a radius of 10 meters ? I don't want to do it only for a single custom block type but for the whole world. Thanks.
-
Key binding event during chat
thx
-
Key binding event during chat
Hi, I currently have a GUI which opens when a key is pressed. But the key binding also intercepts the key when the player write in the chat. Which condition should i impose to check if the chat is used and avoid opening my GUI ? thanks. NB : current code is package PLCmods.robotica.commands; import java.util.EnumSet; import net.minecraft.client.Minecraft; import net.minecraft.client.entity.EntityClientPlayerMP; import net.minecraft.client.settings.KeyBinding; import net.minecraft.entity.player.EntityPlayer; import org.lwjgl.input.Keyboard; import PLCmods.robotica.Robotica; import PLCmods.trashbin.LoggerKeyTickHandler; import cpw.mods.fml.client.registry.KeyBindingRegistry; import cpw.mods.fml.client.registry.KeyBindingRegistry.KeyHandler; import cpw.mods.fml.common.TickType; import cpw.mods.fml.common.registry.TickRegistry; import cpw.mods.fml.relauncher.Side; public class LoggerKeys extends KeyHandler { private EnumSet tickType = EnumSet.of(TickType.CLIENT); private boolean open; public static final KeyBinding[] key = {new KeyBinding("Logger GUI", Keyboard.KEY_L), new KeyBinding("Logger switch", Keyboard.KEY_O)}; public static final boolean[] repeat = {false,false}; public LoggerKeys() { super(key,repeat); KeyBindingRegistry.registerKeyBinding(this); open = false; } @Override public String getLabel() { return "Logger Key"; } @Override public void keyDown(EnumSet<TickType> types, KeyBinding kb, boolean tickEnd, boolean isRepeat) { if(!tickEnd) { EntityClientPlayerMP e = Minecraft.getMinecraft().thePlayer; if(kb.keyCode == Keyboard.KEY_L) { if(open) e.closeScreen(); else e.openGui(Robotica.modInstance, Robotica.GUI.LogControl, e.worldObj, 0, 0, 0); open = !open; } else if(kb.keyCode == Keyboard.KEY_O) e.sendChatMessage("/log switch"); } } @Override public void keyUp(EnumSet<TickType> types, KeyBinding kb, boolean tickEnd) {} @Override public EnumSet<TickType> ticks() { return tickType; } }
-
[SOLVED] Gui - server interaction
Ok, i suppose it's a better way to do it. But i could not find how to insert the player reference in the packets ... As i had already commands allowing to do the action, i found a way to force a client to send a command. Here the code line if someone have the same problem : ((EntityClientPlayerMP) entityPlayer).sendChatMessage("/[command]"); Unfortunately it's not very OOP but it works.
-
[SOLVED] Gui - server interaction
Hi, I currently have a set of commands executed on server side. I made a GUI to allow users an easy access to the features and perform the same actions as commands but the problem is my Gui is on client. So I need a way to execute code on server side when an action is performed on the GUI and to be able to find the player who did it. Is there a way to emulate the use of commands such that i can send these to the server when a player click on the buttons ? I tried addChatMessage but this does not check if it's a command and simply display it in the chat. I also found a way to send commands like if it was typed in the server terminal using MinecraftServer getters but i think it does not allow to recover which player issued the command. Can somebody help ? Thanks a lot.
-
Entity destroying blocks
I had a look, and there's the same call to destroyBlockInWorldPartially() but it's a special case where the computation seems different as it's not similar to breaking a block with a tool.
-
Entity destroying blocks
Hi, I want to make my entity destroy blocks like a real player, meaning the damage state of the block should be computed the same way so the entity breaks block at the same speed a player would. How can i do it ? From ItemInWorldManager.updateBlockRemoving() i tried to sum up the computation, leading to a result like : onLivingUpdate() { [some other entity updates]; if(this.destroying_block) { ++this.curblockDamage; i = this.theWorld.getBlockId(this.partiallyDestroyedBlockX, this.partiallyDestroyedBlockY, this.partiallyDestroyedBlockZ); Block block = Block.blocksList[i]; if (block == null) { this.theWorld.destroyBlockInWorldPartially(entityId, x,y,z, -1); this.destroying_block= false; } else { ItemStack items = inventory.getCurrentItem(); float f = items.getItem().getStrVsBlock(items,block,world.getBlockMetadata(x,y,z)); float hardness = block.getBlockHardness(world,x,y,z); int l = this.curBlockDamage; float f1 = f / hardness / 30F; float f2 = f1 * (l+1); float j = (int)( f2 * 10.0F ); this.theWorld.destroyBlockInWorldPartially(entityId, x,y,z, j); } } } where curBlockDamage is initialised to 0 when destroying block is set to true. Is this correct ? I don't really understand why there are so many steps and factors when computing j so I'm absolutely not sure. Moreover, what's the limit to know when the block is destroyed ? Thanks.
-
Inventory of an entity - interraction bugs
Can you show me the code you use to make the container work ? I tried to compare to some tutorials i found to fix mine but they don't all agree with each other and it still didn't work.
IPS spam blocked by CleanTalk.