Jump to content

ConsoleHack000

Members
  • Posts

    18
  • Joined

  • Last visited

Converted

  • Gender
    Male
  • Personal Text
    Newish to modding,but a lot of experience in java

ConsoleHack000's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. You mean This? @Override public void readFromNBT(NBTTagCompound nbt) { super.readFromNBT(nbt); meta = nbt.getInteger("meta"); b = nbt.getInteger("id"); } @Override public void writeToNBT(NBTTagCompound nbt) { super.writeToNBT(nbt); nbt.setInteger("id",b); nbt.setInteger("meta",meta); } Doesn't seem to work. Still not getting called
  2. Hello everyone. I am making a block which can change its texture to that of some other block's. I use a TileEntity to store the metadata and the ID of the block of which I am showing the texture. The problem is that writeToNBT and readFromNBT methods are not called (checked using System.out.println). Here's the code of TileEntityCoolBlock.java package net.net23.aregsroom.mc.lotostuff.entities.tile; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.network.NetworkManager; import net.minecraft.network.Packet; import net.minecraft.network.play.server.S35PacketUpdateTileEntity; import net.minecraft.tileentity.TileEntity; /** * Created by DeLL on 10/09/2016. */ public class TileEntityCoolBlock extends TileEntity{ public int b = 4; public int meta = 0; public TileEntityCoolBlock() { } @Override public Packet getDescriptionPacket() { NBTTagCompound tag = new NBTTagCompound(); this.writeToNBT(tag); return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, 1, tag); } @Override public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity packet) { readFromNBT(packet.func_148857_g()); } @Override public void readFromNBT(NBTTagCompound nbt) { meta = nbt.getInteger("meta"); b = nbt.getInteger("id"); } @Override public void writeToNBT(NBTTagCompound nbt) { nbt.setInteger("id",b); nbt.setInteger("meta",meta); System.out.println(nbt); } } And CoolBlock.java package net.net23.aregsroom.mc.lotostuff.tools.coolblock; import cpw.mods.fml.common.registry.GameRegistry; import net.minecraft.block.Block; import net.minecraft.block.ITileEntityProvider; import net.minecraft.block.material.Material; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.IIcon; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.net23.aregsroom.mc.lotostuff.entities.tile.TileEntityCoolBlock; import static net.net23.aregsroom.mc.lotostuff.Constants.tabMetal; /** * Created by DeLL on 04/09/2016. */ public class CoolBlock extends Block implements ITileEntityProvider{ public CoolBlock() { super(Material.rock); setCreativeTab(tabMetal); setBlockName("coolblock"); setHardness(2); setHarvestLevel("pickaxe", 2); setStepSound(Block.soundTypeMetal); setResistance(2); setLightOpacity(0); setBlockTextureName("ltstf:cool_block"); GameRegistry.registerBlock(this, getUnlocalizedName().substring(5)); } @Override public boolean isOpaqueCube() { return false; } @Override public boolean onBlockActivated(World w, int x, int y, int z, EntityPlayer p, int p_149727_6_, float p_149727_7_, float p_149727_8_, float p_149727_9_) { if(!w.isRemote) return true; if(!(p.inventory.getCurrentItem().getItem() instanceof TextureExtractor)) return false; TileEntityCoolBlock b = new TileEntityCoolBlock(); b.readFromNBT(p.inventory.getCurrentItem().getTagCompound()); // I can call it this way, and works fine, changes texture, but when I exit the world and enter it again it has the default texture. b.markDirty(); w.setTileEntity(x,y,z,b); w.markBlockForUpdate(x,y,z); return true; } @Override public IIcon getIcon(IBlockAccess p, int x, int y, int z, int side) { TileEntityCoolBlock tecb = (TileEntityCoolBlock) p.getTileEntity(x,y,z); return Block.getBlockById(tecb.b).getIcon(side,tecb.meta); } @Override public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) { return new TileEntityCoolBlock(); } } And I registered the tileentity like so: GameRegistry.registerTileEntity(TileEntityCoolBlock.class, "ltstf-tileentity_coolblock"); in my preInit method. Any help would be really appreciated.
  3. Don't know how but solved it. Go to File->Settings->JRebel->Advanced->and choose JRebel 6 agent as the agent. That did it for me.
  4. So ok guys the title describes the main part of the problem. I am using intellij to mod. I installed JRebel Social 6.4.7 and the jrebel minecraft plugin. The problem MIGHT be the thing that I am using 1.7.10. So when I click "Run with JRebel" it launches but it crashes. Stacktrace: JRebel: Starting logging to file: C:\Users\DeLL\.jrebel\jrebel.log 2016-08-06 10:19:59 JRebel: Directory 'E:\Games\MC\Modding\ltstf\src\main\resources' will be monitored for changes. 2016-08-06 10:19:59 JRebel: Directory 'E:\Games\MC\Modding\ltstf\out' will be monitored for changes. 2016-08-06 10:20:00 JRebel: Contacting myJRebel server .. 2016-08-06 10:20:02 JRebel: 2016-08-06 10:20:02 JRebel: ############################################################# 2016-08-06 10:20:02 JRebel: 2016-08-06 10:20:02 JRebel: JRebel Legacy Agent 6.4.7 (201607271052) 2016-08-06 10:20:02 JRebel: (c) Copyright ZeroTurnaround AS, Estonia, Tartu. 2016-08-06 10:20:02 JRebel: 2016-08-06 10:20:02 JRebel: Over the last 1 days JRebel prevented 2016-08-06 10:20:02 JRebel: at least 0 redeploys/restarts saving you about 0 hours. 2016-08-06 10:20:02 JRebel: 2016-08-06 10:20:02 JRebel: Licensed to Areg Hovhannisyan (using myJRebel). 2016-08-06 10:20:02 JRebel: 2016-08-06 10:20:02 JRebel: 2016-08-06 10:20:02 JRebel: ############################################################# 2016-08-06 10:20:02 JRebel: [10:20:02] [main/INFO] [GradleStart]: Extra: [] [10:20:02] [main/INFO] [GradleStart]: Running with arguments: [--userProperties, {}, --assetsDir, C:/Users/DeLL/.gradle/caches/minecraft/assets, --assetIndex, 1.7.10, --accessToken, {REDACTED}, --version, 1.7.10, --tweakClass, cpw.mods.fml.common.launcher.FMLTweaker, --tweakClass, net.minecraftforge.gradle.tweakers.CoremodTweaker] [10:20:03] [main/INFO] [LaunchWrapper]: Loading tweak class name cpw.mods.fml.common.launcher.FMLTweaker [10:20:03] [main/INFO] [LaunchWrapper]: Using primary tweak class name cpw.mods.fml.common.launcher.FMLTweaker [10:20:03] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.gradle.tweakers.CoremodTweaker [10:20:03] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.FMLTweaker [10:20:03] [main/INFO] [FML]: Forge Mod Loader version 7.99.36.1558 for Minecraft 1.7.10 loading [10:20:03] [main/INFO] [FML]: Java is Java HotSpot(TM) 64-Bit Server VM, version 1.8.0_31, running on Windows 8.1:amd64:6.3, installed at C:\Program Files\Java\jdk1.8.0_31\jre [10:20:03] [main/INFO] [FML]: Managed to load a deobfuscated Minecraft name- we are in a deobfuscated environment. Skipping runtime deobfuscation [10:20:03] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.gradle.tweakers.CoremodTweaker [10:20:03] [main/INFO] [GradleStart]: Injecting location in coremod cpw.mods.fml.relauncher.FMLCorePlugin [10:20:03] [main/INFO] [GradleStart]: Injecting location in coremod net.minecraftforge.classloading.FMLForgePlugin [10:20:03] [main/INFO] [LaunchWrapper]: Loading tweak class name cpw.mods.fml.common.launcher.FMLInjectionAndSortingTweaker [10:20:03] [main/INFO] [LaunchWrapper]: Loading tweak class name cpw.mods.fml.common.launcher.FMLDeobfTweaker [10:20:03] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.gradle.tweakers.AccessTransformerTweaker [10:20:03] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.FMLInjectionAndSortingTweaker [10:20:03] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.FMLInjectionAndSortingTweaker [10:20:03] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.relauncher.CoreModManager$FMLPluginWrapper [10:20:03] [main/ERROR] [FML]: The binary patch set is missing. Either you are in a development environment, or things are not going to work! [10:20:06] [main/ERROR] [FML]: FML appears to be missing any signature data. This is not a good thing [10:20:06] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.relauncher.CoreModManager$FMLPluginWrapper [10:20:06] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.FMLDeobfTweaker [10:20:07] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.gradle.tweakers.AccessTransformerTweaker [10:20:07] [main/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: java.lang.NoClassDefFoundError: com/zeroturnaround/javarebel/gen/RebelLocator$$1 [10:20:07] [main/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at net.minecraftforge.gradle.GradleStartCommon$AccessTransformerTransformer.<clinit>(Unknown Source) [10:20:07] [main/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) [10:20:07] [main/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) [10:20:07] [main/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) [10:20:07] [main/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at java.lang.reflect.Constructor.newInstance(Constructor.java:408) [10:20:07] [main/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at java.lang.Class.newInstance(Class.java:438) [10:20:07] [main/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at net.minecraft.launchwrapper.LaunchClassLoader.registerTransformer(LaunchClassLoader.java:88) [10:20:07] [main/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at net.minecraftforge.gradle.tweakers.AccessTransformerTweaker.injectIntoClassLoader(Unknown Source) [10:20:07] [main/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at net.minecraft.launchwrapper.Launch.launch(Launch.java:115) [10:20:07] [main/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [10:20:07] [main/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source) [10:20:07] [main/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at GradleStart.main(Unknown Source) [10:20:07] [main/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [10:20:07] [main/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) [10:20:07] [main/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [10:20:07] [main/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at java.lang.reflect.Method.invoke(Method.java:483) [10:20:07] [main/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at com.intellij.rt.execution.application.AppMain.main(AppMain.java:144) [10:20:07] [main/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: Caused by: java.lang.ClassNotFoundException: com.zeroturnaround.javarebel.gen.RebelLocator$$1 [10:20:07] [main/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:191) [10:20:07] [main/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at java.lang.ClassLoader.loadClass(ClassLoader.java:424) [10:20:07] [main/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at java.lang.ClassLoader.loadClass(ClassLoader.java:357) [10:20:07] [main/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: ... 16 more [10:20:07] [main/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: Caused by: java.lang.NullPointerException [10:20:07] [main/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:153) [10:20:07] [main/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: ... 18 more Exception in thread "main" Java HotSpot(TM) 64-Bit Server VM warning: Using incremental CMS is deprecated and will likely be removed in a future release Process finished with exit code 1 However, I can run minecraft client without JRebel normally. Just in case, here are gradlew.build and rebel.xml files: buildscript { repositories { mavenCentral() maven { name = "forge" url = "http://files.minecraftforge.net/maven" } maven { name = "sonatype" url = "https://oss.sonatype.org/content/repositories/snapshots/" } } dependencies { classpath 'net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT' } } apply plugin: 'forge' version = "1.0" group= "net.net23.aregsroom.ltstf" // http://maven.apache.org/guides/mini/guide-naming-conventions.html archivesBaseName = "Lot'O'Stuff" minecraft { version = "1.7.10-10.13.4.1558-1.7.10" runDir = "eclipse" } runClient { jvmArgs '-javaagent:C:/Users/DeLL/.IdeaIC2016/config/plugins/jr-ide-idea/lib/jrebel/jrebel.jar','-Xmx1g', '-Drebel.plugins=E:/Games/MC/Modding/ltstf/jr-minecraft-plugin.jar', '-Drebel.minecraft.skip_reload_handlers=net.minecraft.client.audio.SoundHandler' } dependencies { // you may put jars on which you depend on in ./libs // or you may define them like so.. //compile "some.group:artifact:version:classifier" //compile "some.group:artifact:version" // real examples //compile 'com.mod-buildcraft:buildcraft:6.0.8:dev' // adds buildcraft to the dev env //compile 'com.googlecode.efficient-java-matrix-library:ejml:0.24' // adds ejml to the dev env // for more info... // http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html // http://www.gradle.org/docs/current/userguide/dependency_management.html } processResources { // this will ensure that this task is redone when the versions change. inputs.property "version", project.version inputs.property "mcversion", project.minecraft.version // replace stuff in mcmod.info, nothing else from(sourceSets.main.resources.srcDirs) { include 'mcmod.info' // replace version and mcversion expand 'version':project.version, 'mcversion':project.minecraft.version } // copy everything else, thats not the mcmod.info from(sourceSets.main.resources.srcDirs) { exclude 'mcmod.info' } } and the rebel.xml file: <?xml version="1.0" encoding="UTF-8"?> <application xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.zeroturnaround.com" xsi:schemaLocation="http://www.zeroturnaround.com http://www.zeroturnaround.com/alderaan/rebel-2_0.xsd"> <classpath> <dir name="E:\Games\MC\Modding\ltstf\src\main\resources"> </dir> <dir name="E:\Games\MC\Modding\ltstf\out"> </dir> </classpath> </application>
  5. Yeah ok so it turns out that I don't need to schedule update ticks. I want to "update" my isProvidingRedstonePower every tick
  6. Please, I beg you. Stop asking me to upgrade. Yeah ok I am using the mechanics wrong. Could you help me?
  7. So guys im trying to make a block which emits redstone power based on tile entity data. The thing is that it works but doesn't keep updating every tick so its just stuck in the same redstone state. Even scheduling block updates doesn't help. Here's my code. TileEntityRedstoneTimer: package net.net23.aregsroom.mc.lotostuff.entities.tile; import net.minecraft.tileentity.TileEntity; import net.net23.aregsroom.mc.lotostuff.Constants; /** * Created by DeLL on 05/08/2016. */ public class TileEntityRedstoneTimer extends TileEntity{ public float tix = 0; public int side = 3; @Override public boolean canUpdate() { return true; } @Override public void updateEntity() { if(worldObj.isRemote) return; tix++; if(tix>20){ side++; if(side>6){ side=3; tix=0; } worldObj.scheduleBlockUpdate(xCoord,zCoord,yCoord, Constants.rTimer,Constants.rTimer.tickRate(worldObj)); } } } RedstoneTimer: package net.net23.aregsroom.mc.lotostuff.tools.blocks; import cpw.mods.fml.common.registry.GameRegistry; import net.minecraft.block.Block; import net.minecraft.block.ITileEntityProvider; import net.minecraft.block.material.Material; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.net23.aregsroom.mc.lotostuff.entities.tile.TileEntityRedstoneTimer; import static net.net23.aregsroom.mc.lotostuff.Constants.tabMetal; public class RedstoneTimer extends Block implements ITileEntityProvider { public RedstoneTimer() { super(Material.circuits); setCreativeTab(tabMetal); setBlockName("rtimer"); setHardness(5); setHarvestLevel("pickaxe", 1); setStepSound(Block.soundTypeMetal); setResistance(2); setLightOpacity(0); GameRegistry.registerBlock(this, getUnlocalizedName().substring(5)); } @Override public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) { return new TileEntityRedstoneTimer(); } @Override public int isProvidingWeakPower(IBlockAccess iba, int x, int y, int z, int side) { TileEntityRedstoneTimer t = (TileEntityRedstoneTimer) iba.getTileEntity(x, y, z); if (t.side == side) { return 15; } return 0; } @Override public boolean canProvidePower() { return true; } } Any help would be really appreciated
  8. Yeah I would like to upgrade but i can't (I hate the new renering system where you have to make a json file for every item/block. its annoying). Is there a way to get the UUID on the server? or sync them manually?
  9. Ok, I am making a "syringe" which holds the "DNA" of minecraft mobs using their UUID's, but when I try to get the entity based on its UUID, I don't get any entity with the same UUID, even if their chunks are loaded and the entities are not dead. Here's my code package me.Aregak2005.mc.lotostuff.tools.wtrap; import cpw.mods.fml.common.registry.GameRegistry; import me.Aregak2005.mc.lotostuff.Constants; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.IIcon; import net.minecraft.util.StatCollector; import java.util.List; /** * Created by DeLL on 30/07/2016. */ public class Syringe extends Item { public IIcon empty,full; @Override public IIcon getIconIndex(ItemStack stack) { return stack.hasTagCompound()?full:empty; } @Override public IIcon getIcon(ItemStack stack, int pass) { return stack.hasTagCompound()?full:empty; } @Override public void registerIcons(IIconRegister reg) { empty = reg.registerIcon("ltstf:syringe_empty"); full = reg.registerIcon("ltstf:syringe_full"); } public Syringe() { setUnlocalizedName("syringe"); setCreativeTab(Constants.tabMetal); setTextureName("ltstf:syringe_empty"); setMaxStackSize(1); GameRegistry.registerItem(this,this.getUnlocalizedName().substring(5)); } @Override public void addInformation(ItemStack s, EntityPlayer p, List l, boolean b) { if(s.hasTagCompound()){ Entity e = null; for(Entity en : (List<Entity>)p.worldObj.getLoadedEntityList()){ if(en.getUniqueID().toString().equals(s.getTagCompound().getString("uniqueID"))){ e = en; } } l.add(s.getTagCompound().getString("uniqueID")); if(e==null) l.add(EnumChatFormatting.DARK_RED + StatCollector.translateToLocal("lang.entitynotfound.txt")); else{ l.add(String.format("X: %d", e.posX)); l.add(String.format("Y: %d", e.posY)); l.add(String.format("Z: %d", e.posZ)); } } } @Override public boolean onLeftClickEntity(ItemStack stack, EntityPlayer player, Entity entity) { if(player.worldObj.isRemote) return false; if(!stack.hasTagCompound()) { if (entity.myEntitySize == Entity.EnumEntitySize.SIZE_2) { NBTTagCompound t = new NBTTagCompound(); t.setString("uniqueID",entity.getUniqueID().toString()); stack.setTagCompound(t); assert t.getString("uniqueID").equals(entity.getUniqueID().toString()); stack.setStackDisplayName(StatCollector.translateToLocal("item.syringe.full")); } } return false; } }
  10. Yeah ur right tried it. is there any other way to do this in 1.7.10?
  11. guys found a pretty easy way Item lavaNoContainer = Items.lava_bucket; lavaNoContainer.setContainerItem(null); Item waterNoContainer = Items.water_bucket; waterNoContainer.setContainerItem(null); Then use these to items to craft your stuff. This worked for me and shouldn't break other mods. The weird thing is that it worked without registering which is really great
  12. I didnt find any hooks so i couldnt even try anything
  13. Basically the title tells everything, I have an item (frag grenades more specifically) and they shoot EntityThrowables onItemRightclick I want them to shoot EntityThrowables when being dispensed. I saw this http://www.minecraftforge.net/forum/index.php?topic=9025.0 but couldn't figure out much. PS: Im kinda new to modding (not new to java) but can understand most of the stuff but this one is an exception.
×
×
  • Create New...

Important Information

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