Everything posted by Draco18s
-
[1.7.10] Updating a Block texture
3. You should be passing a 3.
-
[1.10.2] Code Improvement/Optimization
Or I could do everything in the base mod class and delegate to the proxy when, and only when, sided code is required. i.e. the registering of event handlers, renderers, and suchlike.
-
[1.10.2] How do I integrate my mod machines's recipes with NEI?
No, no one has ever done that ever. Also, NEI is "dead." It's not going to update. I think JEI is the "hot shit" now.
-
[1.7.10] Updating a Block texture
IBlockAccess is "world-lite" or "read-only World." World implements IBlockAcess and IBlockAccess provides access to blocks (every single getter). Please look at world#setBlock to know what that last parameter does. 1 is not the right value to pass.
-
[1.10.2] Code Improvement/Optimization
Eehhh. I prefer that common goes goes in the base mod class. I see way to much "it should be in the proxy" so the main mod class tells the proxy about the init events, then the proxy goes "well all the code is over in the ModBlocks class" and shunts the event over there. It's a right pain in the ass to debug when the person has a problem because we have to ask for THREE classes to identify the problem (oops, their ModBlocks.preInit() method is actually called durring an init event). There's no reason to shunt method calls around, sure it adheres to some abstract notion of encapsulation, but encapsulation really isn't that good (if encapsulation is followed to the letter, then no package would ever import any package other than itself, its direct parent, and its direct children sub-packages and all cross-package invocation would be fired up or down this chain*). *That is, in order for a block to reference an item, the block would have to ask ModBlocks to forward a call to BaseMod, which would then forward the call to ModItems, and so forth.
-
[1.10.2] what's the purpose of INBTSerializable?
...which will then probably make you write writeToNBT and readFromNBT methods. (Protip: an interface never lets you avoid implementing something)
-
[1.7.10] Updating a Block texture
?
-
[1.10] 1.10 Changes
I heard that from diesieben07, if he's wrong then the information I have available to me is wrong and there's no way I'd know that.
-
[1.7.10] Updating a Block texture
Override public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) Get the TileEntity Get the block stored in the TE Ask it what it's icon is
-
[1.10] 1.10 Changes
If it's in the Block class and you're overriding it, then @Depreicated doesn't mean "we're not using this any more." Mojang is using the annotation incorrectly.
-
[1.7.10] Updating a Block texture
I would store the block inside the TileEntity and then get the TileEntity from world.getTileEntityAt
-
[1.10] Set biome at position?
Yeah, no shit. Creating a new biome instance is not the same as referencing an existing instance.
-
Compilied mod not appearing in build folder
After running gradlew build, you need to browse to build/libs to find your jar file. One of those other two commands likely deleted it.
-
[1.7.10] Updating a Block texture
http://www.sololearn.com/Course/Java/
-
[1.7.10] Updating a Block texture
See all this stuff? private boolean isAdv = false; private Block block; private TileEntityElevator tile; You can't do that. Blocks are singleton classes. You must store this information in the TE. You should never ever be storing a reference to the TileEntity in your block class either, that already tells you you have no idea WTF you're doing. Also, don't use BlockContainer. Override hasTileEntity and createNewTileEntity instead. Also... public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) { try{ return new TileEntityElevator(); }catch (Exception var3){ throw new RuntimeException(var3); } } WHY ARE YOU DOING THIS. You catch an exception for the sole purpose of throwing it again? Why? Not to mention that creating a new TE can't even throw an exception!
-
[Solved] Error With Particles
If the raycast hits with distance 5, then its guaranteed to hit if the distance is 6 instead. However, it is not guaranteed to hit if the distance is 4...
-
[1.7.10] Updating a Block texture
You need to show more of the class, then. Post the whole thing.
-
Player nbt not saved after death [1.9.4-1.10.2]
Isn't that what Ernio showed via PlayerEvent.Clone? I missed that.
-
Player nbt not saved after death [1.9.4-1.10.2]
Also, you will need to manually copy the capability on respawn. The respawned EntityPlayer is a new instance.
-
[1.7.10] Updating a Block texture
Mmm. You've posted the same code again along with a bunch of words. It doesn't help me figure out why you're not using this.block.getIcon(side,meta); Yes, I skipped the "else" statement, but whatever. I still don't know what the "problem" you're having even is.
-
[Solved] Error With Particles
Well of course it still crashes. Inside the loop you're doing a raytrace at increasingly shorter distances. What do you think happens when that raytrace doesn't hit something?
-
[1.7.10] Updating a Block texture
@SideOnly(Side.CLIENT) public IIcon getIcon(int side, int meta){ if(this.isAdv && this.block != null){ return this.block.getIcon(side,meta); //why not this? } } ?
-
[Solved] Error With Particles
Is the method onItemRightClick marked as @SideOnly(Side.CLIENT) in the Item class?
-
[1.8] Block Face Direction (MrCrayfish Model Maker)
While....vaguely correct, you shouldn't use the unlocalized name for your json. You should use your registry name for both of those.
-
[solved] Just looking for an idea to implement tent block.
Honestly, store the rotation in metadata, then store the rest in the TE. (2 bits for fabric, BTW, is 4 colors)
IPS spam blocked by CleanTalk.