Jump to content

Lambda

Members
  • Posts

    486
  • Joined

  • Last visited

Everything posted by Lambda

  1. Oh derp, Thanks! But I still dont think the NBT write issue isnt fixed, not much I can add however EDIT: Seems to work now, Thanks.
  2. It does have a constructor?
  3. Hmm I dont see where, however
  4. Hello all, So I have these 'transreceivers' for transporting around energy, however, I'm having trouble saving the connections to NBT. I do have a error that I caught, which is: [21:58:54] [Client thread/FATAL]: Registering a TileEntity failed! java.lang.InstantiationException: com.lambda.plentifulmisc.tile.TileEntityTransreceiverRelay at java.lang.Class.newInstance(Class.java:427) ~[?:1.8.0_91] at com.lambda.plentifulmisc.tile.TileEntityBase.register(TileEntityBase.java:66) [TileEntityBase.class:?] at com.lambda.plentifulmisc.tile.TileEntityBase.init(TileEntityBase.java:57) [TileEntityBase.class:?] at com.lambda.plentifulmisc.PlentifulMisc.init(PlentifulMisc.java:60) [PlentifulMisc.class:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_91] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_91] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_91] at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_91] at net.minecraftforge.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:602) [FMLModContainer.class:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_91] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_91] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_91] at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_91] at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) [guava-17.0.jar:?] at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) [guava-17.0.jar:?] at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) [guava-17.0.jar:?] at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) [guava-17.0.jar:?] at com.google.common.eventbus.EventBus.post(EventBus.java:275) [guava-17.0.jar:?] at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:243) [LoadController.class:?] at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:221) [LoadController.class:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_91] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_91] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_91] at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_91] at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) [guava-17.0.jar:?] at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) [guava-17.0.jar:?] at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) [guava-17.0.jar:?] at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) [guava-17.0.jar:?] at com.google.common.eventbus.EventBus.post(EventBus.java:275) [guava-17.0.jar:?] at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:145) [LoadController.class:?] at net.minecraftforge.fml.common.Loader.initializeMods(Loader.java:795) [Loader.class:?] at net.minecraftforge.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:330) [FMLClientHandler.class:?] at net.minecraft.client.Minecraft.startGame(Minecraft.java:560) [Minecraft.class:?] at net.minecraft.client.Minecraft.run(Minecraft.java:385) [Minecraft.class:?] at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_91] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_91] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_91] at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_91] at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?] at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_91] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_91] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_91] at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_91] at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?] at GradleStart.main(GradleStart.java:26) [start/:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_91] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_91] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_91] at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_91] at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147) [idea_rt.jar:?] Caused by: java.lang.NoSuchMethodException: com.lambda.plentifulmisc.tile.TileEntityTransreceiverRelay.<init>() at java.lang.Class.getConstructor0(Class.java:3082) ~[?:1.8.0_91] at java.lang.Class.newInstance(Class.java:412) ~[?:1.8.0_91] ... 51 more However, this error is from the 'base relay' which gets extended by the energy / fluid relays. Here is the TE Base, where the TE are registered and just makes creating new TE easier: Now for the 'TileEntityTransreceiverRelay' , which gets extended by all other transrecievers: Now for the 'TileEntityTransreceiverRelayEnergy', I'll just be using this one for example, all of them have the NBT issue, however. In this class, because the original Relay class was outputting an error, I overwrote the NBT READ/WRITE. package com.lambda.plentifulmisc.tile; /** * Created by Blake on 11/25/2016. */ import cofh.api.energy.IEnergyReceiver; import com.lambda.api.transmitters.IConnectionPair; import com.lambda.api.transmitters.Network; import com.lambda.api.PlentifulMiscAPI; import com.lambda.api.transmitters.TransreceiversType; import com.lambda.plentifulmisc.config.ConfigBoolValues; import com.lambda.plentifulmisc.util.misc.ConnectionPair; import io.netty.util.internal.ConcurrentSet; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumFacing; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.MathHelper; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; public class TileEntityTransreciverRelayEnergy extends TileEntityTransreceiverRelay implements ICustomEnergyReceiver{ public static final int CAP = 1000; public final ConcurrentHashMap<EnumFacing, TileEntity> receiversAround = new ConcurrentHashMap<EnumFacing, TileEntity>(); public TileEntityTransreciverRelayEnergy(String name){ super(name, TransreceiversType.ENERGY); } public TileEntityTransreciverRelayEnergy(){ this("transreceiverRelay"); } @Override public int receiveEnergy(EnumFacing from, int maxReceive, boolean simulate){ return this.transmitEnergy(from, maxReceive, simulate); } @Override public int getEnergyStored(EnumFacing from){ return 0; } @Override public int getMaxEnergyStored(EnumFacing from){ return this.getEnergyCap(); } private int transmitEnergy(EnumFacing from, int maxTransmit, boolean simulate){ int transmitted = 0; if(maxTransmit > 0){ Network network = PlentifulMiscAPI.connectionHandler.getNetworkFor(this.pos, this.worldObj); if(network != null){ transmitted = this.transferEnergyToReceiverInNeed(from, network, maxTransmit, simulate); } } return transmitted; } @Override public boolean canConnectEnergy(EnumFacing from){ return true; } @Override public boolean shouldSaveDataOnChangeOrWorldStart(){ return true; } @Override public void saveDataOnChangeOrWorldStart(){ Map<EnumFacing, TileEntity> old = new HashMap<EnumFacing, TileEntity>(this.receiversAround); boolean change = false; this.receiversAround.clear(); for(EnumFacing side : EnumFacing.values()){ BlockPos pos = this.getPos().offset(side); TileEntity tile = this.worldObj.getTileEntity(pos); if(tile != null && !(tile instanceof TileEntityTransreceiverRelay)){ if(tile instanceof IEnergyReceiver){ this.receiversAround.put(side, tile); TileEntity oldTile = old.get(side); if(oldTile == null || !tile.equals(oldTile)){ change = true; } } } } if(change){ Network network = PlentifulMiscAPI.connectionHandler.getNetworkFor(this.getPos(), this.getWorld()); if(network != null){ network.changeAmount++; } } } @Override public void readSyncableNBT(NBTTagCompound compound, NBTType type){ super.readSyncableNBT(compound, type); if(type == NBTType.SYNC){ PlentifulMiscAPI.connectionHandler.removeRelayFromNetwork(this.pos, this.worldObj); NBTTagList list = compound.getTagList("Connections", 10); if(!list.hasNoTags()){ for(int i = 0; i < list.tagCount(); i++){ ConnectionPair pair = new ConnectionPair(); pair.readFromNBT(list.getCompoundTagAt(i)); PlentifulMiscAPI.connectionHandler.addConnection(pair.getPositions()[0], pair.getPositions()[1], this.type, this.worldObj, pair.doesSuppressRender()); } } } } @Override public void writeSyncableNBT(NBTTagCompound compound, NBTType type){ super.writeSyncableNBT(compound, type); if(type == NBTType.SYNC){ NBTTagList list = new NBTTagList(); ConcurrentSet<IConnectionPair> connections = PlentifulMiscAPI.connectionHandler.getConnectionsFor(this.pos, this.worldObj); if(connections != null && !connections.isEmpty()){ for(IConnectionPair pair : connections){ NBTTagCompound tag = new NBTTagCompound(); pair.writeToNBT(tag); list.appendTag(tag); } } compound.setTag("Connections", list); } } private int transferEnergyToReceiverInNeed(EnumFacing from, Network network, int maxTransfer, boolean simulate){ int transmitted = 0; //Keeps track of all the Laser Relays and Energy Acceptors that have been checked already to make nothing run multiple times List<BlockPos> alreadyChecked = new ArrayList<BlockPos>(); List<TileEntityTransreciverRelayEnergy> relaysThatWork = new ArrayList<TileEntityTransreciverRelayEnergy>(); int totalReceiverAmount = 0; for(IConnectionPair pair : network.connections){ for(BlockPos relay : pair.getPositions()){ if(relay != null && !alreadyChecked.contains(relay)){ alreadyChecked.add(relay); TileEntity relayTile = this.worldObj.getTileEntity(relay); if(relayTile instanceof TileEntityTransreciverRelayEnergy){ TileEntityTransreciverRelayEnergy theRelay = (TileEntityTransreciverRelayEnergy)relayTile; int amount = theRelay.receiversAround.size(); if(amount > 0){ relaysThatWork.add(theRelay); totalReceiverAmount += amount; } } } } } if(totalReceiverAmount > 0 && !relaysThatWork.isEmpty()){ int amountPer = maxTransfer/totalReceiverAmount; if(amountPer <= 0){ amountPer = maxTransfer; } for(TileEntityTransreciverRelayEnergy theRelay : relaysThatWork){ double highestLoss = Math.max(theRelay.getLossPercentage(), this.getLossPercentage()); int lowestCap = Math.min(theRelay.getEnergyCap(), this.getEnergyCap()); for(Map.Entry<EnumFacing, TileEntity> receiver : theRelay.receiversAround.entrySet()){ if(receiver != null){ EnumFacing side = receiver.getKey(); EnumFacing opp = side.getOpposite(); TileEntity tile = receiver.getValue(); if(!alreadyChecked.contains(tile.getPos())){ alreadyChecked.add(tile.getPos()); if(theRelay != this || side != from){ if(tile instanceof IEnergyReceiver){ IEnergyReceiver iReceiver = (IEnergyReceiver)tile; if(iReceiver.canConnectEnergy(opp)){ int theoreticalReceived = iReceiver.receiveEnergy(opp, Math.min(amountPer, lowestCap), true); if(theoreticalReceived > 0){ int deduct = this.calcDeduction(theoreticalReceived, highestLoss); if(deduct >= theoreticalReceived){ //Happens with small numbers deduct = 0; } transmitted += iReceiver.receiveEnergy(opp, theoreticalReceived-deduct, simulate); transmitted += deduct; } } } if(transmitted >= maxTransfer){ return transmitted; } } } } } } } return transmitted; } private int calcDeduction(int theoreticalReceived, double highestLoss){ return ConfigBoolValues.TRANSMIT_LOSS.isEnabled() ? MathHelper.ceiling_double_int(theoreticalReceived*(highestLoss/100)) : 0; } public int getEnergyCap(){ return CAP; } public double getLossPercentage(){ return 5; } } Thanks for your time.
  5. Okay, Updated, For some reason I thought everybody would know my problem
  6. Looking into vanilla classes, I believe I'm already doing so.
  7. Okay that makes sense.. How would I register it as a colored item, however
  8. Hello, So I have some dusts, all of vanilla ores, and I'm using IItemColor to choose colors over the 1 Icon, here is the code: [The Colors are not displaying.] ItemDust: package com.lambda.plentifulmisc.items; /** * Created by Blake on 11/26/2016. */ import com.lambda.plentifulmisc.PlentifulMisc; import com.lambda.plentifulmisc.items.base.ItemBase; import com.lambda.plentifulmisc.items.globalization.Dusts; import com.lambda.plentifulmisc.util.StringUtil; import net.minecraft.client.renderer.color.IItemColor; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.EnumRarity; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.NonNullList; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; public class ItemDust extends ItemBase implements IColorItem{ public static final Dusts[] ALL_DUSTS = Dusts.values(); public ItemDust(String name){ super(name); this.setHasSubtypes(true); } @Override public int getMetadata(int damage){ return damage; } @Override public String getUnlocalizedName(ItemStack stack){ return stack.getItemDamage() >= ALL_DUSTS.length ? StringUtil.BUGGED_ITEM_NAME : this.getUnlocalizedName()+"_"+ALL_DUSTS[stack.getItemDamage()].name; } @Override public EnumRarity getRarity(ItemStack stack){ return stack.getItemDamage() >= ALL_DUSTS.length ? EnumRarity.COMMON : ALL_DUSTS[stack.getItemDamage()].rarity; } @Override @SideOnly(Side.CLIENT) public void getSubItems(Item item, CreativeTabs tab, NonNullList list){ for(int j = 0; j < ALL_DUSTS.length; j++){ list.add(new ItemStack(this, 1, j)); } } @Override protected void registerRendering(){ for(int i = 0; i < ALL_DUSTS.length; i++){ PlentifulMisc.proxy.addRenderRegister(new ItemStack(this, 1, i), this.getRegistryName(), "inventory"); } } @SideOnly(Side.CLIENT) @Override public IItemColor getColor(){ return new IItemColor(){ @Override public int getColorFromItemstack(ItemStack stack, int pass){ return stack.getItemDamage() >= ALL_DUSTS.length ? 0xFFFFFF : ALL_DUSTS[stack.getItemDamage()].color; } }; } } Dusts: package com.lambda.plentifulmisc.items.globalization; import com.lambda.plentifulmisc.util.StringUtil; import net.minecraft.item.EnumRarity; /** * Created by Blake on 11/26/2016. */ public enum Dusts{ IRON("iron", 7826534, EnumRarity.COMMON), GOLD("gold", 14335744, EnumRarity.UNCOMMON), DIAMOND("diamond", 292003, EnumRarity.RARE), EMERALD("emerald", 4319527, EnumRarity.EPIC), LAPIS("lapis", 1849791, EnumRarity.UNCOMMON), QUARTZ("quartz", StringUtil.DECIMAL_COLOR_WHITE, EnumRarity.UNCOMMON), COAL("coal", 0, EnumRarity.UNCOMMON), CELESTRIUM("celestrium", 1251327, EnumRarity.RARE); public final String name; public final int color; public final EnumRarity rarity; Dusts(String name, int color, EnumRarity rarity){ this.name = name; this.color = color; this.rarity = rarity; } } IColorItem: package com.lambda.plentifulmisc.items; import net.minecraft.client.renderer.color.IItemColor; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; /** * Created by Blake on 11/26/2016. */ public interface IColorItem{ @SideOnly(Side.CLIENT) IItemColor getColor(); } Note: The icon is WHITE. Lastly if you would like to help more: How could I search for existing 'mod ores' and create dusts for them? Thanks for your time
  9. How would I return an Item with damage? return new ItemStack(this, ??)
  10. EDIT: Detailed Hello, So I have created a TE that uses 2 INPUTS for 1 OUTPUT, however, when I go to put the intended recipe in, the TE does not process it into the intended output, instead it sits and idles. What I want to have happen is for the TE to use BOTH inputs for 1 output. Here is the TE: Container: RecipeRegistry: public class AtomicDiffuserRecipeRegistry { public static void registerFinally(){ int recipeStartedAt = PlentifulMiscAPI.ATOMIC_RECIPES.size(); ArrayList<String> addedRecipes = new ArrayList<String>(); for(int i = recipeStartedAt; i < PlentifulMiscAPI.ATOMIC_RECIPES.size(); i++){ AtomicDiffuserRecipe recipe = PlentifulMiscAPI.ATOMIC_RECIPES.get(i); addedRecipes.add(recipe.firstInput+"+"+recipe.secondInput+" -> "+recipe.output); } ModUtil.LOGGER.info("Added "+addedRecipes.size()+" Atomic Recipes automatically: "+addedRecipes); } /* public static boolean hasBlacklistedOutput(ItemStack output, String[] config){ if(StackUtil.isValid(output)){ Item item = output.getItem(); if(item != null){ String reg = item.getRegistryName().toString(); for(String conf : config){ String confReg = conf; int meta = 0; if(conf.contains("@")){ try{ String[] split = conf.split("@"); confReg = split[0]; meta = Integer.parseInt(split[1]); } catch(Exception e){ ModUtil.LOGGER.warn("A config option appears to be incorrect: The entry "+conf+" can't be parsed!"); } } if(reg.equals(confReg) && output.getItemDamage() == meta){ return true; } } return false; } } return true; } */ private static boolean hasException(String ore){ for(String conf : ConfigStringListValues.ATOMIC_RECIPE_EXCEPTIONS.getValue()){ if(conf.equals(ore)){ return true; } } return false; } public static ItemStack getOutput(ItemStack input, ItemStack inputSecond){ AtomicDiffuserRecipe recipe = getRecipeFromInput(input, inputSecond); return recipe == null ? null : recipe.output; } public static AtomicDiffuserRecipe getRecipeFromInput(ItemStack input, ItemStack secondInput){ for(AtomicDiffuserRecipe recipe : PlentifulMiscAPI.ATOMIC_RECIPES){ if(ItemUtil.areItemsEqual(recipe.firstInput, input, true) && ItemUtil.areItemsEqual(recipe.secondInput, secondInput, true)){ return recipe; } } return null; } } Recipes: public final class AtomicDiffuserRecipes { public static final ArrayList<AtomicDiffuserRecipe> MISC_RECIPES = new ArrayList<AtomicDiffuserRecipe>(); public void init() { ModUtil.LOGGER.info("Initializing Atomic Diffuser Recipes..."); PlentifulMiscAPI.addAtomicRecipe(new ItemStack(Items.BONE), new ItemStack(Items.STICK), new ItemStack(Items.APPLE)); MISC_RECIPES.add(RecipeUtil.lastAtomicRecipe()); AtomicDiffuserRecipeRegistry.registerFinally(); } } Main API: public final class PlentifulMiscAPI{ public static final String MOD_ID = "plentifulmisc"; public static final String API_ID = MOD_ID+"api"; public static final String API_VERSION = "1"; public static IMethodHandler methodHandler; public static IRelayConnectionHandler connectionHandler; public static final List<AtomicDiffuserRecipe> ATOMIC_RECIPES = new ArrayList<AtomicDiffuserRecipe>(); public static void addAtomicRecipe(ItemStack firstInput, ItemStack secondInput, ItemStack output){ ATOMIC_RECIPES.add(new AtomicDiffuserRecipe(firstInput, secondInput, output)); } public static boolean addAtomicRecipes(List<ItemStack> firstInput, List<ItemStack> secondInput, List<ItemStack> output) { return methodHandler.addAtomicRecipes(firstInput, secondInput, output); } } Recipe: public class AtomicDiffuserRecipe { public ItemStack firstInput; public ItemStack secondInput; public ItemStack output; public AtomicDiffuserRecipe(ItemStack firstInput, ItemStack secondInput, ItemStack output) { this.firstInput = firstInput; this.secondInput = secondInput; this.output = output; } }
  11. Hello, So I have an item here that I need for it to take damage when its used in crafting, However, I'm having a hard time apply the damage, here is what I have so far: public class ItemSqueezer extends ItemBase { public ItemSqueezer(String name){ super(name); this.setMaxStackSize(1); this.setMaxDamage(10); } @Override public boolean hasContainerItem(ItemStack stack){ return true; } @Override public ItemStack getContainerItem(ItemStack itemStack) { return //What to return? } }
  12. Lambda

    AABB Help

    Here is what I have so far, however, I'm having trouble translating from north to all of the other sides: private static final float F = 1/16F; private static final AxisAlignedBB AABB_UP = new AxisAlignedBB(4*F, 0, 1+2*F, 12*F, 1*F, 1-2*F); private static final AxisAlignedBB AABB_DOWN = new AxisAlignedBB(2*F, 5F, 2*F, 1-2*F, 1, 1-2*F); private static final AxisAlignedBB AABB_NORTH = new AxisAlignedBB(4*F, 6 * F, 1+2*F, 12*F, 10*F, 1-1*F); private static final AxisAlignedBB AABB_EAST = new AxisAlignedBB(0, 2*F, 2*F, 1-6*F, 1-2*F, 1-2*F); private static final AxisAlignedBB AABB_SOUTH = new AxisAlignedBB(2*F, 2*F, 0, 1-2*F, 1-2*F, 1-6*F); private static final AxisAlignedBB AABB_WEST = new AxisAlignedBB(6*F, 2*F, 2*F, 1, 1-2*F, 1-2*F);
  13. Lambda

    AABB Help

    Sorry, I meant: 6/16x1/16x6/16th of block big, its relatively small.
  14. Hello, So I have a custom model here that needs a sizeable bounding box, however, I cannot seem to configure the coords (x1, y1, z1, x2, y2, z2), correctly Its a 6x1x6 model,
  15. Hello, So I have here a block, when placed on a machine, will allow it to communicated with the network and transfer energy. However the model is small, and I would like to be able to place it anywhere on the block, and possibly make it so you can place a block in the same space. Any idea how I would do that?
  16. Ah thanks! Used to eclipse.
  17. Yeah I did, still doesn't seem to be working > http://prntscr.com/dbpwee , I run the rask > I run Debug, http://prntscr.com/dbpxiz > Edit some stuff, doesn't change.
  18. Hello, So I'm using CoFH API and got an entire line of machines that use RF and can accept energy from generators ( must be placed next to it ), I looked through some code like Ender IO and such, but couldn't find anything of use. All I want to do is transmit power from one block to another, I PREFERABLY would like to have it be cables, however, I could do a 'Link system' like Actually Additions does. Any pointers into how I would do this? I'm new to modding, so some in-depth pointers would be best. Thanks
  19. In the constructor: this.setTickRandomly(true);
  20. Hello, So I created an Item that looks for a te and on right click upgrades it. However, I ran into an issue where SHIFT+right click doesn't do anything, and when I just right click, It opens the gui, upgrades BUT does not use the item. So How would I check for if the player is sneaking. Here is the item if you need reference: public class ItemFuelUpgrade extends ItemBase { public ItemFuelUpgrade(String name) { super(name); } @Override public EnumActionResult onItemUse(EntityPlayer stack, World playerIn, BlockPos worldIn, EnumHand pos, EnumFacing hand, float facing, float hitX, float hitY) { ItemStack itemstack = stack.getHeldItem(pos); if(!playerIn.isRemote) { TileEntity tile = playerIn.getTileEntity(worldIn); if(tile instanceof TileEntityCoalGenerator) { ((TileEntityCoalGenerator) tile).isFuelUpgraded = true; soundRemove(itemstack, stack, playerIn, worldIn); return EnumActionResult.SUCCESS; } } return EnumActionResult.PASS; } protected void soundRemove(ItemStack stack, EntityPlayer player, World worldIn, BlockPos pos) { worldIn.playSound(player, pos, SoundEvents.BLOCK_ANVIL_LAND, SoundCategory.BLOCKS, 1.0F, 1.0F); if (!worldIn.isRemote) { stack.func_190918_g(1); } } }
  21. Hello, So I'm using intellj for creating my mod, however I need to access 'live editing' for moving slots around. However, the builtin Intellj Debug seems to not update. Thanks.
  22. That seemed to do it
  23. Yeah I dont think it is either, bottom of the spoiler i said something like that, how would I do that?
  24. Should I be checking if the world is null before calling the update?
  25. public final void sendUpdate(){ if(!this.worldObj.isRemote){ NBTTagCompound compound = new NBTTagCompound(); this.writeSyncableNBT(compound, NBTType.SYNC); NBTTagCompound data = new NBTTagCompound(); data.setTag("Data", compound); data.setInteger("X", this.pos.getX()); data.setInteger("Y", this.pos.getY()); data.setInteger("Z", this.pos.getZ()); -> 106 PacketHandler.theNetwork.sendToAllAround(new PacketServerToClient(data, PacketHandler.TILE_ENTITY_HANDLER), new NetworkRegistry.TargetPoint(this.worldObj.provider.getDimension(), this.getPos().getX(), this.getPos().getY(), this.getPos().getZ(), 128)); } } and yes that is in my update entity
×
×
  • Create New...

Important Information

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