![](https://forums.minecraftforge.net/uploads/set_resources_2/84c1e40ea0e759e3f1505eb1788ddf3c_pattern.png)
sequituri
-
Posts
669 -
Joined
-
Last visited
Posts posted by sequituri
-
-
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...
-
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.
-
So, show us what you've tried so far.
-
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.
-
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.
-
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.
-
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?
-
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.
-
This code might save a few bytes of space. But, I haven't tested it, so use as your own risk.
@Override public void readFromNBT(final NBTTagCompound nbttagcompound) { if (nbttagcompound == null) //Assembly.logger.warn("AssemblyCounter should read from null NBT ?!"); return; super.readFromNBT(nbttagcompound); NBTTagCompound cdTag = nbttagcompound.getCompoundTag("counterdata"); int sizes = cdTag.getInteger("countersize"); int[] ids = cdTag.getIntArray("id"); int[] damages = cdTag.getIntArray("damage"); int[] counts = cdTag.getIntArray("count"); counter.clear(); for (int i = 0; i < sizes; ++i) counter.put(new int[] {ids[i], damages[i]}, counts[i]); } @Override public void writeToNBT(final NBTTagCompound nbttagcompound) { super.writeToNBT(nbttagcompound); final NBTTagCompound nbt = new NBTTagCompound(); nbt.setInteger("countersize", counter.size()); final int[][] splat = split(counter.keySet()); nbt.setIntArray("id", splat[0]); nbt.setIntArray("damage", splat[1]); nbt.setIntArray("count", ArrayUtils.toPrimitive(counter.values().toArray(new Integer[0]))); nbttagcompound.setTag("counterdata", nbt); } int[][] split(final Set<int[]> in) { final int[] a0 = new int[in.size()]; final int[] a1 = new int[in.size()]; int o = 0; for (final int[] a: in) { a0[o] = a[0]; a1[o++] = a[1]; } return new int[][] { a0, a1}; }
-
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.
-
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.
-
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.
-
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.
-
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.
-
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.
-
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.
-
Ok. After diving into gradle a little more it looks like using clean and other commands will not clear out the cache. Before I had been looking for the .gradle folder but couldn't find it to delete it manually in case something was wrong with the downloads from before. I found I can override the manual cache directory using the "-g" option. I set it to a blank folder and it has started downloading and getting assets which is a lot farther then it ever got before. I will update if this continues well.
EDIT: It looks like that has worked. 1 hour and 34 minutes later I have a BUILD SUCCESSFUL.
I've heard that cleanCache is the switch to make it clean out the cache and start over.
-
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.
-
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.
-
oops! The error is in EnumHelper and it's incorrect signature for EnumCreatureType (both the addCreatureType method, and the commonTypes grid.)
-
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.
-
Please post your EntityNeola class. The classloader seems to be having trouble loading it. Or there is another problem.
-
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.
-
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.
task :reObf fails with java 8
in ForgeGradle
Posted
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?