Jump to content

Recommended Posts

Posted

EDIT: In mitems, I did jetpackt2 = new jetpack not new jetpack2. Lol

 

 

So, I have a piece of armour, with a texture resource location all correctly named. However, this piece of armour is the only piece of amour in my mod with a broken texture.

 

BUT - When I copy over a resource location of a working texture, it still dosen't work!!!

 

Can anyone help? Thanks!  :)

 

Classes:

 

Mitems:

 

package com.koopamillion.item;

 

import com.koopamillion.Main.MainRegistry;

import com.koopamillion.blocks.ItemBlockStandardMetadata;

import com.koopamillion.blocks.MBlocks;

import com.koopamillion.creativetabs.MCreativeTabs;

import com.koopamillion.lib.Names;

import com.koopamillion.lib.RefStrings;

 

import cpw.mods.fml.common.registry.GameRegistry;

import net.minecraft.creativetab.CreativeTabs;

import net.minecraft.init.Blocks;

import net.minecraft.init.Items;

import net.minecraft.item.Item;

import net.minecraft.item.ItemAppleGold;

import net.minecraft.item.Item.ToolMaterial;

import net.minecraft.item.ItemArmor.ArmorMaterial;

import net.minecraft.potion.Potion;

import net.minecraft.potion.PotionEffect;

import net.minecraft.item.ItemFood;

import net.minecraft.item.ItemSeeds;

import net.minecraftforge.common.util.EnumHelper;

 

public class Mitems {

 

public static void mainRegistry(){

initializeItem();

registerItem();

}

 

public static Item sIngot;

public static Item sStick;

public static Item tIngot;                                      //name//minelevel//durability//efficiency//dmg//enchantibility

public static ToolMaterial  tShard = EnumHelper.addToolMaterial("Tungsten Shard", 2, 450, 7.0f, 2.5f, 15);

public static ToolMaterial  eMaterial = EnumHelper.addToolMaterial("Electronic Material", 2, 256, 7.0f, 2.75F, 0); //iron

public static ToolMaterial  eMaterial1 = EnumHelper.addToolMaterial("Electronic Material2", 2, 256, 7.0f, 4.5F, 0); //iron

public static Item tPick;

public static Item tAxe;

public static Item tSpade;

public static Item tHoe;

public static Item tSword;

public static Item rStick;

public static Item crySeed;

public static Item crystal;

public static Item crystalPart;

public static Item urFc;

public static Item Fc;

public static Item uranium;

public static Item nht;

public static ToolMaterial nth = EnumHelper.addToolMaterial("Nether Ingot", 3, 3500, 16.0f, 6.50f, 25);

public static ToolMaterial basicBatteryTool = EnumHelper.addToolMaterial("battery", 0, 12000, 0f, 0f, 0);

public static Item NSword;

public static Item hStick;

public static Item dIngot;

public static Item lFrez;                                      //name//durability//reductionAmounts//enchantibility

public static ArmorMaterial tArmor = EnumHelper.addArmorMaterial("Tungsten Armour", 22, new int[]{2,7,5,2}, 15);

public static ArmorMaterial jetpack1 = EnumHelper.addArmorMaterial("Jetpack Armour", 44, new int[]{2,4,5,2}, 0);

public static ArmorMaterial jetpack2 = EnumHelper.addArmorMaterial("Jetpack2 Armour", 77, new int[]{2,4,5,2}, 0);

public static ArmorMaterial jetpack1dead = EnumHelper.addArmorMaterial("JetpackDead Armour", 99999, new int[]{0,0,0,0}, 0);

public static Item tArmorChest;

public static Item tArmorHead;

public static Item tArmorLegs;

public static Item tArmorFeet;

public static Item jetpack;

public static Item jetpackDead;

public static Item diamondPoundHead;

public static Item steelIngot;

public static Item debuggerTool;

public static Item CuIngot;

public static Item dApple;

public static Item copperDust;

public static Item CuCableConnector;

public static Item basicBattery;

public static Item dynamite;

public static Item wrench;

public static Item CuHeatCoil;

public static Item uninsulatedCopperCable;

public static Item insulatedCopperCable;

public static Item wireCutter;

public static Item ironDust;

public static Item goldDust;

public static Item tungstenDust;

public static Item coalDust;

public static Item silverDust;

public static Item steelDust;

public static Item advancedBattery;

public static Item upgrades;

public static Item ePick;

public static Item ePickDead;

public static Item eAxe;

public static Item eAxeDead;

public static Item jetEngine;

public static Item jetEngine2;

public static Item jetpackt2;

public static Item jetpackDead2;

 

public static void initializeItem(){

sIngot = new Item().setUnlocalizedName("sIngot").setCreativeTab(MCreativeTabs.tabItems).setTextureName(RefStrings.MODID + ":SIngot");

sStick = new Item().setUnlocalizedName("sStick").setCreativeTab(MCreativeTabs.tabTools).setTextureName(RefStrings.MODID + ":sStick");

tIngot = new Item().setUnlocalizedName("tIngot").setCreativeTab(MCreativeTabs.tabItems).setTextureName(RefStrings.MODID + ":tIngot");

tPick = new TPick(tShard).setUnlocalizedName("tPick").setCreativeTab(MCreativeTabs.tabTools).setTextureName(RefStrings.MODID + ":tP");

tAxe = new TAxe(tShard).setUnlocalizedName("tAxe").setCreativeTab(MCreativeTabs.tabTools).setTextureName(RefStrings.MODID + ":tA");

tSpade = new TSpade(tShard).setUnlocalizedName("tSpade").setCreativeTab(MCreativeTabs.tabTools).setTextureName(RefStrings.MODID + ":tSp");

tHoe = new THoe(tShard).setUnlocalizedName("tHoe").setCreativeTab(MCreativeTabs.tabTools).setTextureName(RefStrings.MODID + ":tH");

tSword = new TSword(tShard).setUnlocalizedName("tSword").setCreativeTab(MCreativeTabs.tabTools).setTextureName(RefStrings.MODID + ":tS");

sIngot = new Item().setUnlocalizedName("sIngot").setCreativeTab(MCreativeTabs.tabItems).setTextureName(RefStrings.MODID + ":SIngot");

rStick = new Item().setUnlocalizedName("rStick").setCreativeTab(MCreativeTabs.tabTools).setTextureName(RefStrings.MODID + ":rStick");

crySeed = new ItemSeeds(MBlocks.cryP, Blocks.farmland).setCreativeTab(MCreativeTabs.tabPlants).setUnlocalizedName("crySeed").setTextureName(RefStrings.MODID + ":crySeed");

crystal = new Item().setCreativeTab(MCreativeTabs.tabItems).setUnlocalizedName("crystal").setTextureName(RefStrings.MODID + ":crystal");

crystalPart = new Item().setCreativeTab(MCreativeTabs.tabItems).setUnlocalizedName("crystalPart").setTextureName(RefStrings.MODID + ":crystalPart");

uranium = new Item().setCreativeTab(MCreativeTabs.tabItems).setUnlocalizedName("uranium").setTextureName(RefStrings.MODID + ":uranium");

urFc = new Item().setCreativeTab(MCreativeTabs.tabItems).setUnlocalizedName("urFc").setTextureName(RefStrings.MODID + ":urFc");

Fc = new Item().setCreativeTab(MCreativeTabs.tabItems).setUnlocalizedName("Fc").setTextureName(RefStrings.MODID + ":Fc");

nht = new Item().setCreativeTab(MCreativeTabs.tabItems).setUnlocalizedName("nht").setTextureName(RefStrings.MODID + ":nht");

NSword = new nSword(nth).setUnlocalizedName("nSword").setCreativeTab(MCreativeTabs.tabTools).setTextureName(RefStrings.MODID + ":nSword");

hStick = new Item().setUnlocalizedName("hStick").setCreativeTab(MCreativeTabs.tabTools).setTextureName(RefStrings.MODID + ":hStick");

dIngot = new Item().setUnlocalizedName("dIngot").setCreativeTab(MCreativeTabs.tabItems).setTextureName(RefStrings.MODID + ":dIngot");

lFrez = new lFrez().setUnlocalizedName("lFrez").setCreativeTab(MCreativeTabs.tabTools).setTextureName(RefStrings.MODID + ":lFrez");

tArmorChest = new tArmor(tArmor, MainRegistry.proxy.addArmor("tArmor"), 1).setUnlocalizedName("tArmorChest").setCreativeTab(MCreativeTabs.tabTools).setTextureName(RefStrings.MODID + ":tArmorChest"); //0=helmet//1=chest//2=pants//3=boots//

tArmorHead = new tArmor(tArmor, MainRegistry.proxy.addArmor("tArmor"), 0).setUnlocalizedName("tArmorHead").setCreativeTab(MCreativeTabs.tabTools).setTextureName(RefStrings.MODID + ":tArmorHead"); //0=helmet//1=chest//2=pants//3=boots//

tArmorLegs = new tArmor(tArmor, MainRegistry.proxy.addArmor("tArmor"), 2).setUnlocalizedName("tArmorLegs").setCreativeTab(MCreativeTabs.tabTools).setTextureName(RefStrings.MODID + ":tArmorLegs"); //0=helmet//1=chest//2=pants//3=boots//

tArmorFeet = new tArmor(tArmor, MainRegistry.proxy.addArmor("tArmor"), 3).setUnlocalizedName("tArmorFeet").setCreativeTab(MCreativeTabs.tabTools).setTextureName(RefStrings.MODID + ":tArmorFeet"); //0=helmet//1=chest//2=pants//3=boots//

diamondPoundHead = new Item().setCreativeTab(MCreativeTabs.tabItems).setUnlocalizedName("dPH").setTextureName(RefStrings.MODID + ":dPH");

steelIngot = new Item().setCreativeTab(MCreativeTabs.tabItems).setUnlocalizedName("sI").setTextureName(RefStrings.MODID + ":sI");

debuggerTool = new ItemEnergyMeter().setCreativeTab(MCreativeTabs.tabTools).setMaxStackSize(1).setUnlocalizedName(Names.ENERGY_METER).setTextureName(RefStrings.MODID + ":ENERGY_METER");

CuIngot = new Item().setUnlocalizedName("CuIngot").setCreativeTab(MCreativeTabs.tabItems).setTextureName(RefStrings.MODID + ":CuIngot");

dApple = new ItemAppleDiamond(10, 5f, true).setPotionEffect(Potion.regeneration.id, 120, 5, 1.0F).setCreativeTab(MCreativeTabs.tabPlants).setUnlocalizedName("dApple").setTextureName(RefStrings.MODID + ":dApple");

CuCableConnector = new Item().setUnlocalizedName("CuCableConnector").setCreativeTab(MCreativeTabs.tabItems).setTextureName(RefStrings.MODID + ":CuCableConnector");

basicBattery = new BasicBatteryItem().setMaxStackSize(1).setUnlocalizedName("basicBattery").setCreativeTab(MCreativeTabs.tabItems).setTextureName(RefStrings.MODID + ":basicBattery");

dynamite = new dynamite().setUnlocalizedName("dynamite").setCreativeTab(MCreativeTabs.tabItems).setTextureName(RefStrings.MODID + ":dynamite");

wrench = new ItemWrench();

CuHeatCoil = new Item().setUnlocalizedName("CuHeatCoil").setCreativeTab(MCreativeTabs.tabItems).setTextureName(RefStrings.MODID + ":CuHeatCoil");

uninsulatedCopperCable = new ItemCopperCable().setCreativeTab(MCreativeTabs.tabItems).setUnlocalizedName("uCuCable").setTextureName(RefStrings.MODID + ":uCuItem");

insulatedCopperCable = new IItemCopperCable().setCreativeTab(MCreativeTabs.tabItems).setUnlocalizedName("iCuCable").setTextureName(RefStrings.MODID + ":iCuItem");

wireCutter = new ItemCutter();

ironDust = new Item().setUnlocalizedName("ironDust").setCreativeTab(MCreativeTabs.tabItems).setTextureName(RefStrings.MODID + ":ironDust");

goldDust = new Item().setUnlocalizedName("goldDust").setCreativeTab(MCreativeTabs.tabItems).setTextureName(RefStrings.MODID + ":goldDust");

tungstenDust = new Item().setUnlocalizedName("tungstenDust").setCreativeTab(MCreativeTabs.tabItems).setTextureName(RefStrings.MODID + ":tungstenDust");

silverDust = new Item().setUnlocalizedName("silverDust").setCreativeTab(MCreativeTabs.tabItems).setTextureName(RefStrings.MODID + ":silverDust");

coalDust = new Item().setUnlocalizedName("coalDust").setCreativeTab(MCreativeTabs.tabItems).setTextureName(RefStrings.MODID + ":coalDust");

steelDust = new Item().setUnlocalizedName("steelDust").setCreativeTab(MCreativeTabs.tabItems).setTextureName(RefStrings.MODID + ":steelDust");

copperDust = new Item().setUnlocalizedName("copperDust").setCreativeTab(MCreativeTabs.tabItems).setTextureName(RefStrings.MODID + ":copperDust");

advancedBattery = new AdvancedBatteryItem().setMaxStackSize(1).setUnlocalizedName("advancedBattery").setCreativeTab(MCreativeTabs.tabItems).setTextureName(RefStrings.MODID + ":advancedBattery");

upgrades = new ItemUpgrades().setMaxStackSize(15).setUnlocalizedName("upgrades").setCreativeTab(MCreativeTabs.tabItems).setTextureName(RefStrings.MODID + ":upgrades");

ePick = new EPick(eMaterial).setUnlocalizedName("ePick").setCreativeTab(MCreativeTabs.tabTools).setTextureName(RefStrings.MODID + ":eP");

ePickDead = new Item().setMaxStackSize(1).setUnlocalizedName("ePickDead").setCreativeTab(MCreativeTabs.tabTools).setTextureName(RefStrings.MODID + ":ePDead");

eAxe = new eAxe(eMaterial1).setUnlocalizedName("eAxe").setCreativeTab(MCreativeTabs.tabTools).setTextureName(RefStrings.MODID + ":eAxe");

eAxeDead = new Item().setMaxStackSize(1).setUnlocalizedName("eAxeDead").setCreativeTab(MCreativeTabs.tabTools).setTextureName(RefStrings.MODID + ":eAxeDead");

jetpack = new jetpack(jetpack1, MainRegistry.proxy.addArmor("jetpack"), 1).setUnlocalizedName("jetpack").setCreativeTab(MCreativeTabs.tabTools).setTextureName(RefStrings.MODID + ":jetpack");

jetpackDead = new jetpackDead(jetpack1dead, MainRegistry.proxy.addArmor("jetpackDead"), 1).setCreativeTab(MCreativeTabs.tabTools).setUnlocalizedName("jetpackDead").setCreativeTab(MCreativeTabs.tabTools).setTextureName(RefStrings.MODID + ":jetpackDead");

jetEngine = new Item().setMaxStackSize(1).setUnlocalizedName("jetEngine").setCreativeTab(MCreativeTabs.tabItems).setTextureName(RefStrings.MODID + ":jetEngine");

jetEngine2 = new Item().setMaxStackSize(1).setUnlocalizedName("jetEngine2").setCreativeTab(MCreativeTabs.tabItems).setTextureName(RefStrings.MODID + ":jetEngine2");

jetpackt2 = new jetpack(jetpack2, MainRegistry.proxy.addArmor("jetpack2"), 1).setUnlocalizedName("jetpackt2").setCreativeTab(MCreativeTabs.tabTools).setTextureName(RefStrings.MODID + ":jetpack2");

jetpackDead2 = new jetpackDead2(jetpack1dead, MainRegistry.proxy.addArmor("jetpackDead2"), 1).setCreativeTab(MCreativeTabs.tabTools).setUnlocalizedName("jetpackDead2").setCreativeTab(MCreativeTabs.tabTools).setTextureName(RefStrings.MODID + ":jetpackDead2");

}

 

public static void registerItem(){

GameRegistry.registerItem(sIngot, sIngot.getUnlocalizedName());

GameRegistry.registerItem(sStick, sStick.getUnlocalizedName());

GameRegistry.registerItem(tIngot, tIngot.getUnlocalizedName());

GameRegistry.registerItem(tPick, tPick.getUnlocalizedName());

GameRegistry.registerItem(ePick, ePick.getUnlocalizedName());

GameRegistry.registerItem(ePickDead, ePickDead.getUnlocalizedName());

GameRegistry.registerItem(tAxe, tAxe.getUnlocalizedName());

GameRegistry.registerItem(tSpade, tSpade.getUnlocalizedName());

GameRegistry.registerItem(tHoe, tHoe.getUnlocalizedName());

GameRegistry.registerItem(tSword, tSword.getUnlocalizedName());

GameRegistry.registerItem(rStick, rStick.getUnlocalizedName());

GameRegistry.registerItem(crySeed, crySeed.getUnlocalizedName());

GameRegistry.registerItem(crystal, crystal.getUnlocalizedName());

GameRegistry.registerItem(crystalPart, crystalPart.getUnlocalizedName());

GameRegistry.registerItem(uranium, uranium.getUnlocalizedName());

GameRegistry.registerItem(urFc, urFc.getUnlocalizedName());

GameRegistry.registerItem(Fc, Fc.getUnlocalizedName());

GameRegistry.registerItem(nht, nht.getUnlocalizedName());

GameRegistry.registerItem(NSword, NSword.getUnlocalizedName());

GameRegistry.registerItem(hStick, hStick.getUnlocalizedName());

GameRegistry.registerItem(dIngot, dIngot.getUnlocalizedName());

GameRegistry.registerItem(lFrez, lFrez.getUnlocalizedName());

GameRegistry.registerItem(tArmorFeet, tArmorFeet.getUnlocalizedName());

GameRegistry.registerItem(tArmorHead, tArmorHead.getUnlocalizedName());

GameRegistry.registerItem(tArmorChest, tArmorChest.getUnlocalizedName());

GameRegistry.registerItem(tArmorLegs, tArmorLegs.getUnlocalizedName());

GameRegistry.registerItem(diamondPoundHead, diamondPoundHead.getUnlocalizedName());

GameRegistry.registerItem(steelIngot, steelIngot.getUnlocalizedName());

GameRegistry.registerItem(CuIngot, CuIngot.getUnlocalizedName());

GameRegistry.registerItem(debuggerTool, Names.ENERGY_METER);

GameRegistry.registerItem(dApple, dApple.getUnlocalizedName());

GameRegistry.registerItem(copperDust, copperDust.getUnlocalizedName());

GameRegistry.registerItem(CuCableConnector, CuCableConnector.getUnlocalizedName());

GameRegistry.registerItem(basicBattery, basicBattery.getUnlocalizedName());

GameRegistry.registerItem(dynamite, dynamite.getUnlocalizedName());

GameRegistry.registerItem(CuHeatCoil, CuHeatCoil.getUnlocalizedName());

GameRegistry.registerItem(wrench, Names.WRENCH);

GameRegistry.registerItem(uninsulatedCopperCable,  uninsulatedCopperCable.getUnlocalizedName());

GameRegistry.registerItem(insulatedCopperCable,  insulatedCopperCable.getUnlocalizedName());

GameRegistry.registerItem(wireCutter, wireCutter.getUnlocalizedName());

GameRegistry.registerItem(ironDust, ironDust.getUnlocalizedName());

GameRegistry.registerItem(goldDust, goldDust.getUnlocalizedName());

GameRegistry.registerItem(tungstenDust, tungstenDust.getUnlocalizedName());

GameRegistry.registerItem(silverDust, silverDust.getUnlocalizedName());

GameRegistry.registerItem(coalDust, coalDust.getUnlocalizedName());

GameRegistry.registerItem(steelDust, steelDust.getUnlocalizedName());

GameRegistry.registerItem(advancedBattery, advancedBattery.getUnlocalizedName());

GameRegistry.registerItem(upgrades, upgrades.getUnlocalizedName());

GameRegistry.registerItem(eAxeDead, eAxeDead.getUnlocalizedName());

GameRegistry.registerItem(jetpack, jetpack.getUnlocalizedName());

GameRegistry.registerItem(jetpackDead, jetpackDead.getUnlocalizedName());

GameRegistry.registerItem(jetpackt2, jetpackt2.getUnlocalizedName());

GameRegistry.registerItem(jetpackDead2, jetpackDead2.getUnlocalizedName());

GameRegistry.registerItem(eAxe, eAxe.getUnlocalizedName());

GameRegistry.registerItem(jetEngine, jetEngine.getUnlocalizedName());

GameRegistry.registerItem(jetEngine2, jetEngine2.getUnlocalizedName());

}

 

 

}

 

 

 

Jetpack2 (broken):

 

package com.koopamillion.item;

 

 

import com.koopamillion.Main.JetpackMessage;

import com.koopamillion.Main.MainRegistry;

import com.koopamillion.energy.IEnergy;

import com.koopamillion.lib.RefStrings;

 

import cpw.mods.fml.common.eventhandler.SubscribeEvent;

import cpw.mods.fml.common.gameevent.TickEvent;

import cpw.mods.fml.common.gameevent.TickEvent.ClientTickEvent;

import cpw.mods.fml.common.gameevent.TickEvent.Phase;

import cpw.mods.fml.relauncher.Side;

import cpw.mods.fml.relauncher.SideOnly;

import net.minecraft.client.Minecraft;

import net.minecraft.entity.Entity;

import net.minecraft.entity.player.EntityPlayer;

import net.minecraft.item.ItemArmor;

import net.minecraft.item.ItemStack;

import net.minecraft.util.ChatComponentText;

import net.minecraft.world.World;

 

public class jetpack2 extends ItemArmor{

 

 

 

public jetpack2(ArmorMaterial p_i45325_1_, int p_i45325_2_, int p_i45325_3_) {

super(p_i45325_1_, p_i45325_2_, p_i45325_3_);

 

}

 

public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type){

if(stack.getItem() == Mitems.jetpackt2) {

        return RefStrings.MODID + ":textures/model/armor/jetpack2.png";

        }else{

        return null;

        }

    }

 

 

 

 

}

 

 

 

 

 

Jetpack (working):

 

package com.koopamillion.item;

 

 

import com.koopamillion.Main.JetpackMessage;

import com.koopamillion.Main.MainRegistry;

import com.koopamillion.energy.IEnergy;

import com.koopamillion.lib.RefStrings;

 

import cpw.mods.fml.common.eventhandler.SubscribeEvent;

import cpw.mods.fml.common.gameevent.TickEvent;

import cpw.mods.fml.common.gameevent.TickEvent.ClientTickEvent;

import cpw.mods.fml.common.gameevent.TickEvent.Phase;

import cpw.mods.fml.relauncher.Side;

import cpw.mods.fml.relauncher.SideOnly;

import net.minecraft.client.Minecraft;

import net.minecraft.entity.Entity;

import net.minecraft.entity.player.EntityPlayer;

import net.minecraft.item.ItemArmor;

import net.minecraft.item.ItemStack;

import net.minecraft.util.ChatComponentText;

import net.minecraft.world.World;

 

public class jetpack extends ItemArmor{

 

 

 

public jetpack(ArmorMaterial p_i45325_1_, int p_i45325_2_, int p_i45325_3_) {

super(p_i45325_1_, p_i45325_2_, p_i45325_3_);

 

}

 

public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type){

if(stack.getItem() == Mitems.jetpack) {

        return RefStrings.MODID + ":textures/model/armor/jetpack.png";

        }else{

        return null;

        }

    }

 

 

 

 

}

 

 

 

 

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Ah, it appears I spoke too soon, I still need a little help here. I now have the forceloading working reliably.  However, I've realized it's not always the first tick that loads the entity.  I've seen it take anywhere from 2-20ish to actually go through, in which time my debugging has revealed that the chunk is loaded, but during which time calling  serverLevelIn.getEntity(uuidIn) returns a null result.  I suspect this has to do with queuing and how entities are loaded into the game.  While not optimal, it's acceptable, and I don't think there's a whole ton I can do to avoid it. However, my concern is that occasionally teleporting an entity in this manner causes a lag spike.  It's not every time and gives the appearance of being correlated with when other chunks are loading in.  It's also not typically a long spike, but can last a second or two, which is less than ideal.  The gist of how I'm summoning is here (although I've omitted some parts that weren't relevant.  The lag occurs before the actual summon so I'm pretty confident it's the loading, and not the actual summon call). ChunkPos chunkPos = new ChunkPos(entityPosIn); if (serverLevelIn.areEntitiesLoaded(chunkPos.toLong())) { boolean isSummoned = // The method I'm using for actual summoning is called here. Apart from a few checks, the bulk of it is shown later on. if (isSummoned) { // Code that runs here just notifies the player of the summon, clears it from the queue, and removes the forceload } } else { // I continue forcing the chunk until the summon succeeds, to make sure it isn't inadvertently cleared ForgeChunkManager.forceChunk(serverLevelIn, MODID, summonPosIn, chunkPos.x, chunkPos.z, true, true); } The summon code itself uses serverLevelIn.getEntity(uuidIn) to retrieve the entity, and moves it as such.  It is then moved thusly: if (entity.isAlive()) { entity.moveTo(posIn.getX(), posIn.getY(), posIn.getZ()); serverLevelIn.playSound(null, entity, SoundEvents.ENDERMAN_TELEPORT, SoundSource.NEUTRAL, 1.0F, 1.0F); return true; } I originally was calling .getEntity() more frequently and didn't have the check for whether or not entities were loaded in place to prevent unnecessary code calls, but even with those safety measures in place, the lag still persists.  Could this just be an issue with 1.18's lack of optimization in certain areas?  Is there anything I can do to mitigate it?  Is there a performance boosting mod I could recommend alongside my own to reduce the chunk loading lag? At the end of the day, it does work, and I'm putting measures in place to prevent players from abusing the system to cause lag (i.e. each player can only have one queued summon at a time-- trying to summon another replaces the first call).  It's also not an unacceptable level of lag, IMO, given the infrequency of such calls, and the fact that I'm providing the option to toggle off the feature if server admins don't want it used.  However, no amount of lag is ideal, so if possible I'd love to find a more elegant solution-- or at least a mod recommendation to help improve it. Thanks!
    • When i start my forge server its on but when i try to join its come a error Internal Exception: java.lang.OutOfMemoryError: Requested array size exceeds VM limit Server infos: Linux Minecraft version 1.20.1 -Xmx11G -Xms8G
    • Also add the latest.log from your logs-folder
    • Add the mods in groups
  • Topics

×
×
  • Create New...

Important Information

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