Everything posted by GotoLink
-
Editing the WorldInfo
I would use GuiOpenEvent to replace the Gui with the right one when you want.
-
Spawning mobs from a Tile Entity with custom NBT
IEntityAdditionalSpawnData that would help syncing the things at spawn time.
-
Automatic planting
//first, we parasitically use the first player in the world list. //(change this later) World world=Minecraft.getMinecraft().theWorld; You need to change that now. It is client-side only, while placing blocks is server side.
-
Stupid, stupid question (memory saving)
Save the thing. Redoing the calculation would be a waste of computing power, since you can't be sure the memory is freed every time you remove the reference in Java.
-
How to use Keyhandler value in Entity
Put the counter in the entity onUpdate(). Put a default constructor with World as parameter. Use the keyhandler to send a packet to server side to start the entity counter. You'll need a way to link the entity with a player...maybe his username when the entity is spawned ?
-
Effective Tools: Shears
Look into ForgeHooks. By the way, shears are not tools (meaning, ItemShears only extend Item, not ItemTool), so they aren't registered as a tool class. I'd recommend making your block implement IShearable, that is an easier way to achieve what you want.
-
LivingAttackEvent invoke twice
That code is called when the player is attacked, not the other way around. Use AttackEntityEvent for that.
-
What's up with creating IDs
No, by using the item instance. Item#itemID
-
LivingAttackEvent invoke twice
//In EntityPlayer public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) { if (ForgeHooks.onLivingAttack(this, par1DamageSource, par2)) return false; //some intermediate code return super.attackEntityFrom(par1DamageSource, par2); } } } } //In EntityLivingBase public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) { if (ForgeHooks.onLivingAttack(this, par1DamageSource, par2)) return false; Sounds redundant, huh ? Well actually, there is no difference between these too, when considering EntityPlayer. They both call LivingAttackEvent, and further processing is cancel when the event is. Except the first one is called sooner, even if player is immune or damage is 0. Does it matter ? I don't think so.
-
Ore not spawning
System.out.println("Ore Spawned Succesfully"); Did that print ? If not, you may want to check your generator registration.
-
What's up with creating IDs
Configuration(File)#getItem(String...)#getInt()
-
Question about GuiHandler
If you don't want slots, you don't need a container. Register a IGuiHandler with NetworkRegistry.registerGuiHandler, then return an instance of a GuiScreen in getClientGuiElement, that is enough.
-
Removing Biomes
If that wasn't clear, I am suggesting to make a custom WorldChunkManager which overrides getBiomesForGeneration. Since OP was talking about "his world", it would make sense to change this part of the world generation.
-
When one block in slot, it is not used
if(stack0!=null) { if(stack0.stackSize--<=0) tileEntityGrinder.setInventorySlotContents(0,null); This is really common code, you know.
-
Can I do everything in my Mods? How?
I'd go with the general process of any computer work: -Learn a bit -Think a bit -Try a bit -Repeat forever (or until satisfied)
-
[Solved] Getting Paulscode Source - IllegalArgumentException
I'd recommend: try{ Field field = SoundSystem.class.getDeclaredField("soundLibrary"); field.setAccessible(true); Library soundLibrary = Library.class.cast(field.get(classMainEventHandler.soundManager.sndSystem)); }catch(Exception e){ }
-
Need some help with block names
public class Blocks { public static Block block; You have only one reference of Block in your Blocks class.
-
{SOLVED!!}A "simple" question.
You should call super.onUpdate()
-
Removing Biomes
You don't touch the BiomeGenBase, that would remove biomes for all worlds. I'd recommend you to look into WorldChunkManager#getBiomesForGeneration.
-
Constructive Criticism Requested
You could do something like this in your TileEntity: private boolean mark = true; private String[] players = new String[2]; public boolean getNextMark(){//returns a boolean opposite each time, equivalent to 0 or X mark = !mark; return mark; } public boolean isNextPlayer(EntityPlayer player){//check that a player can play this game, on this turn return player.username.equals(players[mark?0:1]); } public boolean setPlayer(EntityPlayer player){//sets a player, return true if it was added to the game if(players[0]==null){ players[0] = player.username; return true; }else if(players[1]==null){ players[1] = player.username; return true; } return false; }
-
Constructive Criticism Requested
You are not keeping track of the game at all. You are not saving anything to the NBT methods.
-
Help with random skins
Do you want it to be completely random, or rely on types (like horses ?).
-
Grenade with a Blindness on Explode Help ! Please
boundingBox is set by Entity#setSize(...). I assume you don't want your grenade to be bigger, so I'd recommend using AxisAlignedBB#expand(double,double,double) on boundingBox. By the way, EntityPlayer is not an EntityLiving in recent Minecraft versions, you may want to check for EntityLivingBase instead. You will probably need a counter too, to avoid the grenade exploding in the player hands.
-
Bind custom texture to Mob?
A...resource pack ?
-
Constructive Criticism Requested
I don't understand why you used an Item and an Entity. You can place the blocks themselves, and they already contain the TileEntity. My advice: Merge the entity-placing-blocks code into the "item use" method, then move that content into the "block placed" method, finally delete everything about the item and the entity. The TileEntity should store everything related to the play. Not optimal, but better. Then you could improve the thing by using only one TileEntity, for example in the middle block. With two block states based on metadata, only one having the TileEntity. (do not use BlockContainer, prefer hasTileEntity(metadata)...) The "block placed" method would check around for other similar blocks, and set the middle block to the state with a TileEntity, when the board is complete. The "block activated" method would check around for a block with the tileentity, and write to it.
IPS spam blocked by CleanTalk.