Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Try4W

Members
  • Joined

  • Last visited

  1. Good time of day! I wanna give access to some right click by item if player have permission like -dc.useTools. How i can use permissions from plugin by forge? In CustomNPCs source code i found one class and interface, but i don't understand, how it works. package noppes.npcs.permissions; import noppes.npcs.permissions.PermissionsInterface; public class CustomNpcsPermissions implements PermissionsInterface { public static PermissionsInterface Instance = new CustomNpcsPermissions(); private static final String[] permissions = new String[]{"-customnpcs.*"}; public boolean hasPermission(String username, String permission) { return true; } } package noppes.npcs.permissions; public interface PermissionsInterface { boolean hasPermission(String var1, String var2); }
  2. If I understand correctly, these methods do not give 100% accurate. This method may not be compatible with other mods. I create some constructor for change drops of mobs. It must works with all mobs. Maybe I should read about ASM-lib and somehow insert custom xp-drop event in the method OnDathUpdate?
  3. Nope, but thanks. I wanna remove experience orbs if it will drop, for example from creeper. But mobs drops orbs with this stupid metod: protected void onDeathUpdate() { ++this.deathTime; if (this.deathTime == 20) { int i; if (!this.worldObj.isRemote && (this.recentlyHit > 0 || this.isPlayer()) && !this.isChild() && this.worldObj.getGameRules().getGameRuleBooleanValue("doMobLoot")) { i = this.getExperiencePoints(this.attackingPlayer); // ! while (i > 0) { int j = EntityXPOrb.getXPSplit(i); i -= j; this.worldObj.spawnEntityInWorld(new EntityXPOrb(this.worldObj, this.posX, this.posY, this.posZ, j)); } } this.setDead(); for (i = 0; i < 20; ++i) { double d0 = this.rand.nextGaussian() * 0.02D; double d1 = this.rand.nextGaussian() * 0.02D; double d2 = this.rand.nextGaussian() * 0.02D; this.worldObj.spawnParticle("explode", this.posX + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, this.posY + (double)(this.rand.nextFloat() * this.height), this.posZ + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, d0, d1, d2); } } }
  4. Hi! Question in title. And... I can do this without using ASM?
  5. Found: https://bitbucket.org/Erasmus_Crowley/ex-nihilo/src/e34e320fd51c5d3b13061a9d35735f3e6a88237a/src/main/java/exnihilo/world/?at=master Thanks for f1rSt1k.
  6. Good time of day I need to create empty world, without structures and terrain. I sucssesful: public class ERROREDEmptyDimChunkProvider implements IChunkProvider { /** RNG. */ private Random rand; /** Reference to the World object. */ private World worldObj; public ERROREDEmptyDimChunkProvider(World par1World, long par2, boolean par4) { this.worldObj = par1World; this.rand = new Random(par2); } /** * loads or generates the chunk at the chunk location specified */ @Override public Chunk loadChunk(int par1, int par2) { return this.provideChunk(par1, par2); } /** * Will return back a chunk, if it doesn't exist and its not a MP client it will generates all the blocks for the * specified chunk from the map seed and chunk seed */ @Override public Chunk provideChunk(int par1, int par2) { byte[] abyte = new byte[32768]; Chunk chunk = new Chunk(this.worldObj, abyte, par1, par2); byte[] abyte1 = chunk.getBiomeArray(); chunk.generateSkylightMap(); return chunk; } /** * Checks to see if a chunk exists at x, y */ @Override public boolean chunkExists(int par1, int par2) { return true; } /** * Two modes of operation: if passed true, save all Chunks in one go. If passed false, save up to two chunks. * Return true if all chunks have been saved. */ @Override public boolean saveChunks(boolean par1, IProgressUpdate par2IProgressUpdate) { return true; } /** * Unloads chunks that are marked to be unloaded. This is not guaranteed to unload every such chunk. */ @Override public boolean unloadQueuedChunks() { return false; } /** * Returns if the IChunkProvider supports saving. */ @Override public boolean canSave() { return true; } /** * Converts the instance data to a readable string. */ @Override public String makeString() { return "RandomLevelSource"; } /** * Returns a list of creatures of the specified type that can spawn at the given location. */ @Override public List getPossibleCreatures(EnumCreatureType par1EnumCreatureType, int par2, int par3, int par4) { return null; } /** * Returns the location of the closest structure of the specified type. If not found returns null. */ @Override public ChunkPosition findClosestStructure(World par1World, String par2Str, int par3, int par4, int par5) { return null; //"Stronghold".equals(par2Str) && this.strongholdGenerator != null ? this.strongholdGenerator.getNearestInstance(par1World, par3, par4, par5) : null; } @Override public int getLoadedChunkCount() { return 0; } public void recreateStructures(int par1, int par2) {} @Override public void saveExtraData() { } @Override public void populate(IChunkProvider ichunkprovider, int i, int j) { /* if(this.worldObj.getBlockId(0, 40, 0) != Block.bedrock.blockID) this.worldObj.setBlock(0, 40, 0, Block.bedrock.blockID, 0, 2); } */ } } But with this ChunkProvider have errors with IC2, because it try to read some fields in my world(biomeList, for example), but i delete it. And so... What fields/methods i can remove, and what not? p.s. - Apologies for the ignorance, if that

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.