-
Posts
16559 -
Joined
-
Last visited
-
Days Won
156
Everything posted by Draco18s
-
World#clip(...) It performs a raycast against blocks. A lot of things in vanilla use it to determine what you're looking at.
-
1.6.2 (Custom Energy Like Buildcraft/IC2/Thermal Expansion)
Draco18s replied to Bashula's topic in Modder Support
Grab their API and start using it. It makes your mod dependent on whichever one you choose, so choose wisely. (There is nothing wrong with creating a mod for another mod, it will however influence the direction and theme of your own mod) -
You don't set CURRENT damage in the constructor. The Item class is a singleton, only one of them exists at a time.* Each stack of your Item class is where the current damage comes in. You'd need to look through the player's inventory for those. *Exceptions exist.
-
1.6.2 (Custom Energy Like Buildcraft/IC2/Thermal Expansion)
Draco18s replied to Bashula's topic in Modder Support
Put another way: I've been modding for a while and I would still not attempt an energy system. Of course, what value does your own custom energy system that could not be achieved by either a) using IC2 b) using BC c) using Thermal Expansion or d) using Universal Electricity? -
Dug into Mystcraft awaiting a reply. Apparently XCW just waits until PostInit then loops through the entire BiomeList for non-null entries. Copied and utilized. Seems odd that Biomes don't fire off a registration event. There is this in the BiomeDictionary: public static void registerAllBiomesAndGenerateEvents() { for(int i = 0; i < BIOME_LIST_SIZE; i++) { BiomeGenBase biome = BiomeGenBase.biomeList[i]; if (biome.theBiomeDecorator instanceof DeferredBiomeDecorator) { DeferredBiomeDecorator decorator = (DeferredBiomeDecorator) biome.theBiomeDecorator; decorator.fireCreateEventAndReplace(); } if(biome != null) { checkRegistration(biome); } } } But it appears to be unused and would cause a crash if called (+1 cookie if you can figure out why).
-
Note useful for me. I don't use a teleporter.
-
Yes....but in order to add a spawn registration I need to hear that the biome exists: EntityRegistry.addSpawn(EntityNetherWisp.class, 1, 1, 1, EnumCreatureType.ambient, {biomes go here});
-
My fix involved calling travelToDimension followed by a setPositionAndUpdate. Doing that mysteriously doesn't cause a nether portal.
-
I'm trying to listen for other mods registering biomes so that my mod can set up mob spawns that are appropriate for the registered biome. It appears that this would be the BiomeEvent.CreateDecorator event, but when I listen for that, it never occurs. Widening the net to all BiomeEvents, I only see GetWaterColor and GetGrassColor (which, of course, fire all the time).
-
Vertical Redstone Wire Block... Help? [UNSOLVED]
Draco18s replied to CL4551C's topic in Modder Support
Here's the mod itself[/i]. The video should be enough to give you an idea of what's going on. -
Already using it: It's a very odd side effect that isn't caused by the Entity#travelToDimension() method directly.
-
How often does the entire entity class get called?
Draco18s replied to DanilaFE's topic in Modder Support
This is a basic java question. The problem with being able to answer it is that I don't know what scope you mean by global. Under the strict definition of global scope, the answer would be "yes" because every time a new necromancer spawned it would set your single, global scope, variable to 0. Which is not what you want. -
Did you set up your workspace properly?
-
I have an item that I would like to have teleport the player back to the overworld (dimension 0), at the overworld spawn position. I'd like to do this WITHOUT creating a nether portal at the overworld destination. Currently it appears that it is doing so, and immediately re-teleporting the player to the nether (regardless of original demarcation dimension). I tried looking at Mystcraft's teleportation code, but it is very complex, and with the amount of obfuscated method and field names I'm unable to follow it.
-
You would need the obfuscated name. Go into mcp/conf and open up fields.csv in a text editor of your choice (or excel, but notepad is sufficient). Search for the field name ("foodExhaustionLevel" without quotes). Next to it, you'll find an obfuscated name (eg. "field_75126_c"). That is the field name you'd want to use with reflections. Mind that that field name won't work in the dev environment!
-
I highly recommend Mystcraft. It adds some truly awesome features and if you need help merging your overworlds into Mystcraft ages, several people on the official forums can help out.
-
1) setTickRanomly(true); (If I'm remembering the method name properly) 2) world.getBlockId(x, y, z); //x, y, z will be "this block" you'll have to modify the coordinates to get adjacent blocks 3) Can't really. You can however use metadata or adjacent blocks to determine texture.
-
Replace ModLoader.getMinecraftInstance().getIntegratedServer().worldServers[0] With access
-
You're still using complicated ModLoader access: public Icon getBlockTexture(IBlockAccess access, int x, int y, int z, int side) { int front = 0; TileEntity tile = ModLoader.getMinecraftInstance().getIntegratedServer().worldServers[0].getBlockTileEntity(x, y, z); Seriously? ModLoader.getMinecraftInstance().getIntegratedServer().worldServers[0]? Dude, you're passed a world from the function parameters. IBlockAccess access. If you don't know what IBlockAccess is, it's basically ALL THE FUNCTIONS A WORLD HAS because World implements IBlockAccess.
-
1) I believe so. May have to tie into the "Hurt" event and check to see if the entity would die 2) Yes! Most certainly. 3) Absolutely! 4) With finagling and magical voodoo it would be possible (read: yes, but tricky. Know what you're doing first) 5) You'd need to create a new AI event and know how to program it. You might be able to get away with the behavior that causes wolves to hunt sheep. 6) Look at the Enderman 7) See 6. As for formations, that would require a really good AI structure.
-
int someColor = nbt.getInteger("currentColorInt"); someColor++; nbt.setInteger("currentColorInt",someColor);
-
public NBTTagCompound createDefault() { NBTTagCompound nbt = new NBTTagCompound("tag"); nbt.setInteger("someStringIdentifier",0); }
-
I'll see if I can use that at some point to provide an "archipelago" type landscape for Mystcraft worlds. I ventured into the worldgenerator code at one point to see what I could screw with and get the kind of look I wanted (to no success) and then here you come along and have exactly what I want without having done hardly anything (and don't want the result yourself). Thanks.