Everything posted by sequituri
-
task :reObf fails with java 8
Just to see if my project could use some new java features - iterfaces with default methods, method references in lambdas, and such, I set the sourceCompatibility and targetCompatibility = 8 in my build.gradle and tried to build. The build failed and the error is here: (I snipped away the successful stuff) It appears that org.ow2.asm.4x is not compatible with java 8 for the :reObf task to complete properly. There is a 5.0 and 5.0.1 version available that would solve this issue, but I could not figure out how to make gradle use it. Is this a future enhancement, or will Forge always be stuck at 1.6 compatibility?
-
[1.6.4] getBlockTileEntity not as intensive as it seems?
derp! I just realized that despite the similarity of names, TileEntities do not inherit from Entity in any way. I also just figured out that an Entity (like EntityMinecartChest) can move but a TileEntity (like TileEntityChest) cannot. I wonder if that is the only difference, since both can have inventories and additional data and NBT's. I would be nice to be able to learn all this on the Wiki...
-
[1.6.4] getBlockTileEntity not as intensive as it seems?
The Hopper uses a method that looks somewhat reasonable for finding nearby TEs. world.getEntitiesWithinAABBExcludingEntity((Entity)null, AxisAlignedBB.getAABBPool().getAABB(xPos, yPos, zPos, xPos + 1.0D, yPos + 1.0D, zPos + 1.0D), IEntitySelector.selectInventories); The first argument is the entity to exclude - don't want to include oneself. The last one filters by EntityTypes. It would be nice to know if this is one of the better (faster) methods.
-
[1.6.4] Magic Spell
So, show us what you've tried so far.
-
[1.6.4][SOLVED] Block orientation for custom rendered block.
Have you tried overriding setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z) ? Take a look at the override of this method in BlockAnvil.class for an idea how to do it. But use your own metadata states.
-
[1.6.4] NTB not applying to item
You really are using superfluous loops for no good reason here. for(int y = 0; y < items[ i ].stackSize; y++){ flowering++; } flowering += items[ i ].stackSize; does the same thing with one instruction.
-
[1.6.4][SOLVED] Block orientation for custom rendered block.
You didn't happen to notice that part of your copied code sets the metadata in the range [2,5] and the rest sets the metadata in the range [0,3]? You really need to decide if you are encoding the facing direction as in 0==north, 1==west... etc. or are you encoding it as a an unencoded direction (as in 0=down, 1=up, 2=north.. etc). You really cannot code it both ways.
-
[SOLVED][1.7.2] Getting Enchantment Off A Tool
Why are you testing this tag: if (item.stackTagCompound.getTag("ench") != null) and then using this other tag as if you know its contents are non-null: enchants = (NBTTagList) item.stackTagCompound.getTag("StoredEnchantments") ? The "ench" tag is not the same tag as the "StoredEnchantments" tag. Why not test the tag you are actually setting enchants to?
-
Making a creature attack mobs
Did you check that EntityAnimal actually has the attributes: this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(10.0D); this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.3D); that you are trying to set values on? I'm guessing it doesn't and that is causing your NPE.
-
[1.6.4/1.7.2] Bad packet id
This code might save a few bytes of space. But, I haven't tested it, so use as your own risk.
-
Block Rendering
I'll give you the answer that someone else on the forum gave a couple days ago: Use getIconFromSideAndMetadata for your furnace block. If side == 0 and metadata == 0, return the icon for side 2 Of course, this assumes your storing your orientation in metadata like the vanilla furnace does. Because, furnaces are never oriented to side 0 or 1 (top of bottom side), so it's safe to assume the item is still in inventory.
-
Mod setup errors
If you are running Java 8 then you'll want to get the newest Forge (1049) from the Files section. LexManos explains that it works with Java 8 because of the FernFLower fix he made. If you aren't using Java 8, then IDK what's wrong, and I can't help you.
-
Making a dual tool?
In 1.7.x, you can use the method setHarvestLevel("axe",n) and setHarvestLevel("pickaxe",m), and so on. Derive from itemTool for a start or the main type of tool it is. Or you could derive from ItemSword and just add in the toolClass settings. There is more to make it all work than just that, but it should get you started.
-
Spawning a custom entity?
I just found this, so it may already have been tried and failed... There is a MinecraftForge event called WorldEvent.PotentialSpawns that can be handled and will allow the spawnlist to be set to any spawnlist desired (added to, or removed from). That might make your creature spawn wherever you want. I have not tested this theory, so it's up to you.
-
[1.7.2] Custom Biomes.
This is probably handled with events now. For instance, there is the getModdedBiomeGenerators(WorldType wtype, long seed, GenLayer[] original) that fires WorldTypeEvent.InitBiomeGens event on TERRAIN_GEN_BUS, that allows new biomegenerators to be added/removed.
-
[1.7.2] Ore Not Generating in World Properly
The subject of this thread is way off. There is no Forge for 1.7.4. Also, your code new WorldGenMinable(MobOres.creeptoniteOre, 5)). says you only want 5 attempts to place your ore in a vein. That is not a very large number if you want to find your ore easily.
-
[1.6.4] Question on how to make a specific block mechanic
I have nothing against your plan for these respawning ores and trees, but just a word of caution. TileEntities that tick (which I presume these would) eventually lead to lag in larger quantities. If you don't mind a little slowdown, then press on.
-
[Answered] ForgeGradle setup fail - OverlappingFileLockException
I've heard that cleanCache is the switch to make it clean out the cache and start over.
-
Spawning a custom entity?
I went looking for the spawn code for different creatureTypes and I discovered the possible problem you are encountering getting your creatureType to spawn. Check this code in BiomeGenBase: public List getSpawnableList(EnumCreatureType par1EnumCreatureType) { return par1EnumCreatureType == EnumCreatureType.monster ? this.spawnableMonsterList : (par1EnumCreatureType == EnumCreatureType.creature ? this.spawnableCreatureList : (par1EnumCreatureType == EnumCreatureType.waterCreature ? this.spawnableWaterCreatureList : (par1EnumCreatureType == EnumCreatureType.ambient ? this.spawnableCaveCreatureList : null))); } Apparently it is not smart enough to support spawning custom CreatureTypes. This makes is hard to accomplish what you want short of using ASM and changing the method. On the other hand, if you used a standard creature type from the list then it should spawn nicely.
-
Spawning a custom entity?
Which biomes did you set them to spawn in? You might need to find such a biome and spend some time there looking around. I had a similar issue when horses were added, for I did not know they only spawned in plains and such.
-
Spawning a custom entity?
oops! The error is in EnumHelper and it's incorrect signature for EnumCreatureType (both the addCreatureType method, and the commonTypes grid.)
-
Tameable Mobs?
ItemFood (porkchops) heals the dog/wolf when he is tamed. Items.bone (from skeletons) can tame the wolf (with some random chance) unless he is angry. isBreedingTime returns true if the item passed in is the wolfsFavoriteMeat (property held by an ItemFood: like porkChop) Most of the otherstuff is pretty standard tameable methodology. I don't know where the follow player code come into play.
-
Spawning a custom entity?
Please post your EntityNeola class. The classloader seems to be having trouble loading it. Or there is another problem.
-
(1.7) Changing vanilla features
Look at what diesieben07 said after studying the CraftinManager, he give you the informative piece. For the rest, it's just simple java, searching a list and calling remove() on the one you want.
-
(1.7) Changing vanilla features
Start by looking at the class CraftingManager and seeing if you can understand how it works. Then, you can write the code to do what you want.
IPS spam blocked by CleanTalk.