Everything posted by Draco18s
-
[UNSOLVED]Strange things happen with my energysystem[1.8]
1) Why is this class abstract? 2) Why are you writing the block metadata to the description packet? (You're ignoring it when the packet arrives, too) 3) Your "connectTo" function is never called, making storedPos always null (unless its being called from another class you haven't posted) 4) Why are you getting the World and saving it to the local variable world when you have access to (and use!) worldObj? 5) Why are you using Minecraft.getMinecraft().thePlayer ?
-
[1.8] Changing order of block registration messes up old world saves
The irony here is that this Forge bug is why Keybounce was banned from the forums permanently, because it had the potential to corrupt a world irrevocably and Lex told him "that's why it creates a .bak file." But by the time the player logs in, the .bak files for the world info (containing the original mappings) have been overwritten three times.
-
How can I knew if blocks were placed on light beam way.
You are making beams that travel at arbitrary angles. So no. You're going to have to raycast. Raycasts are only expensive if you're doing a LOT of them (or they're going really far). Think about how expensive TNT is at the range you're interested in, then divide by 1352.
-
[1.7.10]Custom Grass Block
Also don't just copy the class wholesale. That'll never work correctly and it will be impossible to debug unless you actually know what you're doing. That said: public static IIcon getIconSideOverlay() return MBlocks.Rgrass.field_149994_N;[ <------error. cannot be resolved or is not a field.] } Did it occur to you to do this? public static IIcon getIconSideOverlay() return this.field_149994_N; } Magic!
-
[1.7.10] Changing animal AI
The Entity tasks variable is public, so you can create an insert your own AI tasks when the entity spawns (EntitySpawnedInWorldEvent, if I am remembering the name correctly). EntityConstructedEvent is too early (tasks is null).
-
HashMap of ItemStacks?
While I will probably just use wrapper objects, that's pretty neat.
-
Crafting semi-shapleless recipes?
It works because when you specify a grid arrangement smaller than 3x3 it lets it occur in any location on the grid. Enforcing a 3x3 shape by using spaces forces the recipe into the only place it fits: right where the spaces tell it it should go.
-
how not to include a class into the resulting jar when building with gradle?
exclude 'com/mymod/tests/**'
-
[1.8][off topic] how do you put a mod in pages like 9minecraft or minecrafteo
Reminds me that I once had to download a mod from 9minecraft because the original, official host was long, long gone. And I wanted to examine the source code. I still feel dirty. *shudder*
-
Crafting semi-shapleless recipes?
This is not a crafting recipe.
-
[1.7.10] how to load non vanilla chunks
ChunkEvent and ChunkDataEvent. You get access to the chunk's nbt data so you can store and retrieve any custom data you'd like. Note that chunks are saved and loaded on separate threads, so if you're using any data structures (e.g. HashMap) you will need to make it concurrent.
-
[1.7.10] Give myself a dev item
What?
-
[1.8]is there a way to stop a playSoundEffect
Yeah, mine's a looped sound. Was easy enough to create and manage, so the extra work traking individual instances want that much of a bother.
-
[1.7.10] event when item gets equiped/unequiped?
You don't need events. In your item, override: //called every tick for all items in the inventory public void onUpdate(ItemStack itemStack, World world, Entity entity, int slot, boolean held) { } //only makes sense for armor items, called every tick for equipped armors public void onArmorTickUpdate(World world, EntityPlayer player, ItemStack itemStack) { }
-
[1.8]is there a way to stop a playSoundEffect
Here's what I did, which is based on the way minecart sounds work. The client proxy is responsible for playing the actual sound (the server side does nothing) and making sure that we've only got 1 sound playing per location. The "ChunkCoordTriplet" class is a poorly named object which is effectively a Vec4. It was originally intended for storing 3D chunk coordinates + dimension, hence the name; overrides equals() and getHashCode() as to be a valid key type. You could probably just use a BlockPos. @Override public void startMillSound(TileEntityMillstone te) { ChunkCoordTriplet tepos = new ChunkCoordTriplet(te.getWorldObj().provider.dimensionId, te.xCoord, te.yCoord, te.zCoord); if(!sounds.containsKey(tepos)) { SoundWindmill snd = new SoundWindmill(new ResourceLocation("ores:grain-mill-loop"), te); //this is the important bit Minecraft.getMinecraft().getSoundHandler().playSound(snd); sounds.put(tepos, snd); } else { SoundWindmill snd = sounds.get(tepos); if(snd.isDonePlaying()) { sounds.remove(tepos); snd = new SoundWindmill(new ResourceLocation("ores:grain-mill-loop"), te); Minecraft.getMinecraft().getSoundHandler().playSound(snd); sounds.put(tepos, snd); } } } This is the class that handles the actual sound: public class SoundWindmill extends PositionedSound implements ITickableSound{ protected TileEntityMillstone millstone; protected boolean donePlaying = false; protected SoundWindmill(ResourceLocation sound, TileEntityMillstone mill) { super(sound); this.repeat = true; millstone = mill; this.xPosF = mill.xCoord; this.yPosF = mill.yCoord; this.zPosF = mill.zCoord; } public void update() { TileEntity te = millstone.getWorldObj().getTileEntity((int)xPosF,(int)yPosF,(int)zPosF); //handles checking to make sure the TE is still loaded, not replaced, and checks if the sound still needs to play //using the same function I would use in a GUI if this machine had one (its also used by WAILA). //For your use you'd probably just need to check the on/off state of the radio and make sure it's synced to the client //Metadata/Blockstate might be a good option if (!(te != null && te instanceof TileEntityMillstone) || millstone.getGrindTime() <= 0) { donePlaying = true; } } public boolean isDonePlaying() { return donePlaying; } }
-
[1.8]is there a way to stop a playSoundEffect
You need to do the sounds differently, as a streaming source. I'm away from my source code at the moment, or I'd look up how I did it. Long story short, it's routed through my common and client proxies (I'm playing a sound effect for a machine, client already knows the machine is operating due to synced TE data, so it just tells the proxy the start or stop the sound as needed, no networking required).
-
Custom minecart track
I never looked into those, actually.
-
Custom minecart track
What version of Minecraft? I've successfully extended the rails class in 1.7.10 just fine. http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/2379886-micromod-rail-bridges
-
[1.8] Custom Furnace, some bugs....that i am spinning in circles!
- [SOLVED] Particle Rendering - not facing the player
You aren't rotating the quad.- Holy TileEntity bugs... [1.8] [Unsolved]
It crashes, because that's not how you open a gui. https://github.com/Draco18s/Artifacts/blob/master/main/java/com/draco18s/artifacts/block/BlockPedestal.java#L140 Also, you have a huge crapton of stuff you absolutely should not need in your ContainerGrinder class. You can see caves through the block because you didn't override renderAsNormalBlock and isOpaqueCube to return false: the neighboring blocks are seeing your block as a full, solid, cube, so they're not bothering to render faces that can't be seen.- How to set a block without updating all the surround blocks
Look at the Javadoc on world.setBlock(int, int, int, Block, int, int)- [1.8] [Solved]Crash on planting custom crop
As an aside, any reason you aren't storing references to your blocks and items where they can be easily accessed? That would eliminate the need to so FindBlock.- [1.7.10] Rendering Item Icon on side of blocks
The thing you see in your inventory is a 3D model of it in the world, seen from a diagonal, orthographic, viewpoint. You are unlikely to get this representation as a flat texture to draw on the face of a block. Which is why barrel mods draw a 3D block sticking out.- [1.8] Servertick Crash
Yeah, there's a boolean in the TileEntity class that controls their tick/not-tick behavior. There's a setter for it. Use it. (Or a function you override, I haven't actually messed with 1.8 yet, but the standard behavior still exists) - [SOLVED] Particle Rendering - not facing the player
IPS spam blocked by CleanTalk.
Important Information
By using this site, you agree to our Terms of Use.