• 0

    posted a message on Need help with onRightClick event

    Thanks, that works perfectly!

    Posted in: Modification Development
  • 0

    posted a message on Need help with onRightClick event

    I need help understanding what is going on with the event I am trying to make. I made an event to fire when a player right clicks on a custom log with a vanilla minecraft bowl, and have it return to the user 1 maple syrup.


    The event code:


    @SubscribeEvent
    	public void onItemRightClick(PlayerInteractEvent.RightClickBlock event)
    	{	
    		if(event.getEntityPlayer() instanceof EntityPlayer)
    		{
    			EntityPlayer player = event.getEntityPlayer();
    			
    			if(player.getHeldItemMainhand().getItem().equals(Items.BOWL))
    			{
    				EnumHand hand = event.getHand();
    				IBlockState iblockstate = event.getWorld().getBlockState(event.getPos());
    				Block block = iblockstate.getBlock();
    				ItemStack itemstack = player.getHeldItem(hand);
    				
    				player.sendMessage(new TextComponentTranslation(TextFormatting.DARK_RED + "Player Holding bowl!"));
    				
    				if(block == MoShizBlocks.mapleLog)
    		           {
    		        	   itemstack.shrink(1);
    		        	   player.inventory.addItemStackToInventory(new ItemStack(MoShizFoods.mapleSyrup));
    		        	   player.sendMessage(new TextComponentTranslation(TextFormatting.DARK_GREEN + "Block equals maple log!"));
    		           }
    			}
    		}
    	}

    I threw in some chat components to try to help me fix this, and from what I can see, the event fires 4 times.


    But for a reason of which I do not understand, it only takes 1 bowl away, while adding 2 maple syrups to my inventory. Any help in understanding why this isn't working would be very much appreciated.


    EDIT:

    So I started messing around and the came to the realization that the event fires anytime a player right clicks on a block, so it should be safe to assume that I may have absolutely no idea what I am doing with this method.

    Posted in: Modification Development
  • 0

    posted a message on Metadata Block registering help

    I recently tried adding a set of 16 metadata blocks into my mod, but the registering has changed since 1.8, and I can't seem to find any examples on how to register the blocks.


    This is the code I used in 1.8, which now no longer works in 1.11.2.

    GameRegistry.registerBlock(coloredPlanks, ItemColoredPlanks.class, coloredPlanks.getUnlocalizedName().substring(5));

    I have all of the other code completed, but when I'm in game, it only shows the white varient of the metadata blocks.

    Posted in: Modification Development
  • 0

    posted a message on Minor issue with slab placement

    I have just recently added a new slab into my mod, and everything works great except for the fact that i can't place slabs by right clicking with one under the top slab.

    Here is a link to a YouTube video of the problem, it might make more sense if the issue was shown rather than described.


    This is the main slab class:


    package com.ProfitOrange.moshiz.blocks;
    
    import java.util.Random;
    
    import com.ProfitOrange.moshiz.MoShizMain;
    import com.ProfitOrange.moshiz.init.MoShizBlocks;
    
    import net.minecraft.block.BlockSlab;
    import net.minecraft.block.material.Material;
    import net.minecraft.block.properties.IProperty;
    import net.minecraft.block.state.BlockStateContainer;
    import net.minecraft.block.state.IBlockState;
    import net.minecraft.entity.EntityLivingBase;
    import net.minecraft.item.Item;
    import net.minecraft.item.ItemStack;
    import net.minecraft.util.EnumFacing;
    import net.minecraft.util.math.BlockPos;
    import net.minecraft.world.World;
    
    public abstract class SlabBlock extends BlockSlab
    {
    
    	public SlabBlock(String name) 
    	{
    		super(Material.IRON);
    		this.setUnlocalizedName(name);
    		this.setRegistryName(name);
    		//this.setCreativeTab(MoShizMain.tabTest);
    		this.setHardness(3.0F);
    		this.setResistance(20.0F);
    		
    		
    		IBlockState state = this.blockState.getBaseState();
    		
    		if(!this.isDouble())
    		{
    			state.withProperty(HALF, EnumBlockHalf.BOTTOM);
    		}
    		
    		setDefaultState(state);
    		
    		this.useNeighborBrightness = true;
    		
    	}
    	
    	@Override
    	public String getUnlocalizedName(int meta)
    	{
    		return this.getUnlocalizedName();
    	}
    	
    	@Override
    	public IProperty<?> getVariantProperty()
    	{
    		return HALF;
    	}
    	
    	
    	@Override
    	public Comparable<?> getTypeForItem(ItemStack itemstack)
    	{
    		return EnumBlockHalf.BOTTOM;
    	}
    	
    	@Override
    	public int damageDropped(IBlockState state)
    	{
    		return 0;
    	}
    	
    	@Override
    	public IBlockState getStateFromMeta(int meta)
    	{
    		if(!this.isDouble())
    		{
    			return this.getDefaultState().withProperty(HALF, EnumBlockHalf.values()[meta % EnumBlockHalf.values().length]);
    		}
    		
    		return this.getDefaultState();
    	}
    	
    	@Override
    	public int getMetaFromState(IBlockState state)
    	{
    		if(this.isDouble())
    		{
    			return 0;
    		}
    		
    		return ((EnumBlockHalf)state.getValue(HALF)).ordinal() + 1;
    	}
    	
    	@Override
    	public Item getItemDropped(IBlockState state, Random rand, int fortune)
    	{
    		return Item.getItemFromBlock(MoShizBlocks.glowood_half);
    	}
    	
    	@Override
    	protected BlockStateContainer createBlockState()
    	{
    		return new BlockStateContainer(this, new IProperty[] {HALF});
    	}
    }




    This is the half slab class:

    package com.ProfitOrange.moshiz.blocks.slab;
    
    import com.ProfitOrange.moshiz.blocks.SlabBlock;
    
    import net.minecraft.block.material.Material;
    
    public class SlabHalf extends SlabBlock
    {
    
     public SlabHalf(String name) 
     {
     super(name);
     }
    
     @Override
     public boolean isDouble() 
     {
     return false;
     }
    
    }
    

    The double slab class:

    package com.ProfitOrange.moshiz.blocks.slab;
    
    import com.ProfitOrange.moshiz.blocks.SlabBlock;
    
    import net.minecraft.block.material.Material;
    
    public class SlabDouble extends SlabBlock
    {
    
     public SlabDouble(String name) 
     {
     super(name);
     }
    
     @Override
     public boolean isDouble() 
     {
     return true;
     }
    
    }
    

    And the block is registered as such:


    package com.ProfitOrange.moshiz.init;
    
    import com.ProfitOrange.moshiz.MoShizMain;
    import com.ProfitOrange.moshiz.Reference;
    import com.ProfitOrange.moshiz.blocks.MoShizBlock;
    import com.ProfitOrange.moshiz.blocks.MoShizOre;
    import com.ProfitOrange.moshiz.blocks.nether.MoShizSand;
    import com.ProfitOrange.moshiz.blocks.nether.NetherGlass;
    import com.ProfitOrange.moshiz.blocks.nether.NetherReed;
    import com.ProfitOrange.moshiz.blocks.slab.SlabDouble;
    import com.ProfitOrange.moshiz.blocks.slab.SlabHalf;
    
    import net.minecraft.block.Block;
    import net.minecraft.block.BlockGlass;
    import net.minecraft.block.BlockOldLog;
    import net.minecraft.block.BlockSand;
    import net.minecraft.block.SoundType;
    import net.minecraft.block.material.Material;
    import net.minecraft.client.Minecraft;
    import net.minecraft.client.renderer.block.model.ModelResourceLocation;
    import net.minecraft.init.Blocks;
    import net.minecraft.item.Item;
    import net.minecraft.item.ItemBlock;
    import net.minecraft.item.ItemSlab;
    import net.minecraft.item.ItemStack;
    import net.minecraftforge.fml.common.registry.GameRegistry;
    
    public class MoShizBlocks 
    {
     //Test Slabs
     public static SlabHalf glowood_half;
     public static SlabDouble glowood_double;
     
     
     public static void init()
     {
     
     //Slab test
     glowood_half = new SlabHalf("slab/glowood_half");
     glowood_double = new SlabDouble("slab/glowood_double");
     
     
     
     }
     
     
     
     public static void register()
     {
     //Slab
     registerBlock(glowood_half, new ItemSlab(glowood_half, glowood_half, glowood_double));
     GameRegistry.register(glowood_double);
     
     
     
     }
     
     
     private static void registerBlock(Block block)
     {
     GameRegistry.register(block);
     GameRegistry.register(new ItemBlock(block).setRegistryName(block.getRegistryName()));
     }
     
     public static void registerBlock(Block block, ItemBlock itemBlock) 
     {
     block.setCreativeTab(MoShizMain.tabTest);
     GameRegistry.register(block);
     GameRegistry.register(itemBlock.setRegistryName(block.getRegistryName()));
     }
     
     
     public static void registerRenders()
     {
     //Slab
     registerRender(glowood_half);
     }
     
     
     //Blockstates json files hnadles the texture when the block is placed
     
     
     public static void registerRender(Block block)
     {
     Item item = Item.getItemFromBlock(block);
     Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, 0, new ModelResourceLocation(Reference.MOD_ID + ":" + item.getUnlocalizedName().substring(5), "inventory"));
     }
    }
    

    I just want my custom slabs to as close to vanilla slabs as possible. Any help would be greatly appreciated!

    Posted in: Modification Development
  • 0

    posted a message on Server crashes everytime someone tries to join.

    Here is the crash report, I loaded up a backup map, and was able to connect, but then I disconnected, when I went to reconnect, It crashed, then restarted. But anytime someone tries to connect it crashes and restarts.


    ---- Minecraft Crash Report ----
    // Shall we play a game?

    Time: 8/9/15 6:14 PM
    Description: Loading NBT data

    java.io.UTFDataFormatException: malformed input around byte 434
    at java.io.DataInputStream.readUTF(DataInputStream.java:656)
    at java.io.DataInputStream.readUTF(DataInputStream.java:564)
    at net.minecraft.server.v1_8_R3.NBTTagCompound.b(SourceFile:399)
    at net.minecraft.server.v1_8_R3.NBTTagCompound.load(SourceFile:67)
    at net.minecraft.server.v1_8_R3.NBTTagList.load(NBTTagList.java:54)
    at net.minecraft.server.v1_8_R3.NBTTagCompound.a(SourceFile:406)
    at net.minecraft.server.v1_8_R3.NBTTagCompound.load(SourceFile:70)
    at net.minecraft.server.v1_8_R3.NBTTagCompound.a(SourceFile:406)
    at net.minecraft.server.v1_8_R3.NBTTagCompound.load(SourceFile:70)
    at net.minecraft.server.v1_8_R3.NBTCompressedStreamTools.a(NBTCompressedStreamTools.java:84)
    at net.minecraft.server.v1_8_R3.NBTCompressedStreamTools.a(NBTCompressedStreamTools.java:53)
    at net.minecraft.server.v1_8_R3.NBTCompressedStreamTools.a(NBTCompressedStreamTools.java:43)
    at net.minecraft.server.v1_8_R3.ChunkRegionLoader.loadChunk(ChunkRegionLoader.java:70)
    at org.bukkit.craftbukkit.v1_8_R3.chunkio.ChunkIOProvider.callStage1(ChunkIOProvider.java:25)
    at org.bukkit.craftbukkit.v1_8_R3.chunkio.ChunkIOProvider.callStage1(ChunkIOProvider.java:1)
    at org.bukkit.craftbukkit.v1_8_R3.util.AsynchronousExecutor$Task.init(AsynchronousExecutor.java:150)
    at org.bukkit.craftbukkit.v1_8_R3.util.AsynchronousExecutor$Task.initAsync(AsynchronousExecutor.java:95)
    at org.bukkit.craftbukkit.v1_8_R3.util.AsynchronousExecutor$Task.run(AsynchronousExecutor.java:85)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:745)


    A detailed walkthrough of the error, its code path and all known details is as follows:
    ---------------------------------------------------------------------------------------

    -- Head --
    Stacktrace:
    at java.io.DataInputStream.readUTF(DataInputStream.java:656)
    at java.io.DataInputStream.readUTF(DataInputStream.java:564)
    at net.minecraft.server.v1_8_R3.NBTTagCompound.b(SourceFile:399)
    at net.minecraft.server.v1_8_R3.NBTTagCompound.load(SourceFile:67)
    at net.minecraft.server.v1_8_R3.NBTTagList.load(NBTTagList.java:54)

    -- NBT Tag --
    Details:
    Tag name: Sections
    Tag type: 9
    Stacktrace:
    at net.minecraft.server.v1_8_R3.NBTTagCompound.a(SourceFile:406)
    at net.minecraft.server.v1_8_R3.NBTTagCompound.load(SourceFile:70)
    at net.minecraft.server.v1_8_R3.NBTTagCompound.a(SourceFile:406)
    at net.minecraft.server.v1_8_R3.NBTTagCompound.load(SourceFile:70)
    at net.minecraft.server.v1_8_R3.NBTCompressedStreamTools.a(NBTCompressedStreamTools.java:84)
    at net.minecraft.server.v1_8_R3.NBTCompressedStreamTools.a(NBTCompressedStreamTools.java:53)
    at net.minecraft.server.v1_8_R3.NBTCompressedStreamTools.a(NBTCompressedStreamTools.java:43)
    at net.minecraft.server.v1_8_R3.ChunkRegionLoader.loadChunk(ChunkRegionLoader.java:70)
    at org.bukkit.craftbukkit.v1_8_R3.chunkio.ChunkIOProvider.callStage1(ChunkIOProvider.java:25)
    at org.bukkit.craftbukkit.v1_8_R3.chunkio.ChunkIOProvider.callStage1(ChunkIOProvider.java:1)
    at org.bukkit.craftbukkit.v1_8_R3.util.AsynchronousExecutor$Task.init(AsynchronousExecutor.java:150)
    at org.bukkit.craftbukkit.v1_8_R3.util.AsynchronousExecutor$Task.initAsync(AsynchronousExecutor.java:95)
    at org.bukkit.craftbukkit.v1_8_R3.util.AsynchronousExecutor$Task.run(AsynchronousExecutor.java:85)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:745)

    -- System Details --
    Details:
    Minecraft Version: 1.8.8
    Operating System: Linux (amd64) version 2.6.32-431.29.2.el6.x86_64
    Java Version: 1.7.0_65, Oracle Corporation
    Java VM Version: OpenJDK 64-Bit Server VM (mixed mode), Oracle Corporation
    Memory: 57007008 bytes (54 MB) / 331378688 bytes (316 MB) up to 2075918336 bytes (1979 MB)
    JVM Flags: 4 total; -Xmx2048M -Xms128M -XX:MaxPermSize=128M -XX:+UseConcMarkSweepGC
    IntCache: cache: 0, tcache: 0, allocated: 12, tallocated: 94
    CraftBukkit Information:
    Running: CraftBukkit version git-Spigot-6c9b0a1-de5c261 (MC: 1.8.8) (Implementing API version 1.8.8-R0.1-SNAPSHOT) true
    Plugins: { ChairStairs v1.1 com.axeldios.ChairStairs.ChairStairs [AxelDios], PotionEditor v1.0.1 me.conarnar.potioneditor.PotionEditor [SeeTeeTT], WorldEdit v6.1;no_git_id com.sk89q.worldedit.bukkit.WorldEditPlugin [], MassiveCore v2.8.0 com.massivecraft.massivecore.MassiveCore [Cayorion], Lores v1.4.1 com.codisimus.plugins.lores.Lores [Codisimus], Vault v1.5.3-b37 net.milkbowl.vault.Vault [cereal, Sleaker, mung3r], ArcaneEnchants v5.2.3 me.dmhacker.enchanting.ArcaneEnchants [skyrimfan1], PermissionsEx v1.23.3 ru.tehkode.permissions.bukkit.PermissionsEx [[t3hk0d3, zml]], PlayerHeads v3.10-SNAPSHOT-jenkins-PlayerHeads-1-61-g39b94b4 org.shininet.bukkit.playerheads.PlayerHeads [meiskam, zand], AnvilColors v1.3.1 me.kylersmith7.anvilcolors.AnvilColors [kylersmith7], WorldGuard v6.1 com.sk89q.worldguard.bukkit.WorldGuardPlugin [], dynmap v2.2-1118 org.dynmap.bukkit.DynmapPlugin [mikeprimm], ItemFrameShops v3.0.4-BETA com.woutwoot.ItemFrameShops.Main [woutwoot], PirateCannon v1.0.7 me.bukkit.Nexu18.PirateCannon.PirateCannon [], OnTime v4.1.3 me.edge209.OnTime.OnTime [Edge209], SamistineSignFix v1.0 com.samistine.samistinesignfix.SamistineSignFix [Samistine], BuyRegion v1.1.7 com.region.BuyRegion [[luke199]], SuperPotions v2.6 flaminyogurt.plugins.superpotions.SuperPotions [Flaminyogurt], Modifyworld v1.19.7 ru.tehkode.modifyworld.bukkit.Modifyworld [t3hk0d3], EssentialsKitManager v1.0.2 com.faris.esskitmanager.Main [KingFaris10], Essentials vTeamCity com.earth2me.essentials.Essentials [Zenexer, ementalo, Aelux, Brettflan, KimKandor, snowleo, ceulemans, Xeology, KHobbits, md_5, Iaccidentally], EssentialsProtect vTeamCity com.earth2me.essentials.protect.EssentialsProtect [Zenexer, ementalo, Aelux, Brettflan, KimKandor, snowleo, ceulemans, Xeology, KHobbits], EssentialsSpawn vTeamCity com.earth2me.essentials.spawn.EssentialsSpawn [Zenexer, ementalo, Aelux, Brettflan, KimKandor, snowleo, ceulemans, Xeology, KHobbits], EssentialsAntiBuild vTeamCity com.earth2me.essentials.antibuild.EssentialsAntiBuild [Zenexer, ementalo, Aelux, Brettflan, KimKandor, snowleo, ceulemans, Xeology, KHobbits, Iaccidentally], EnjinMinecraftPlugin v2.7.2-bukkit com.enjin.officialplugin.EnjinMinecraftPlugin [www.Enjin.com], Movecraft v4.0.1 net.countercraft.movecraft.Movecraft [BaccaYarro], EssentialsChat vTeamCity com.earth2me.essentials.chat.EssentialsChat [Zenexer, ementalo, Aelux, Brettflan, KimKandor, snowleo, ceulemans, Xeology, KHobbits, md_5, Okamosy, Iaccidentally], Factions v2.8.0 com.massivecraft.factions.Factions [Cayorion, Brettflan],}
    Warnings: DEFAULT
    Reload Count: 0
    Threads: { RUNNABLE Server thread: [java.io.RandomAccessFile.seek(Native Method), net.minecraft.server.v1_8_R3.RegionFile.chunkExists(RegionFile.java:111), net.minecraft.server.v1_8_R3.ChunkRegionLoader.chunkExists(ChunkRegionLoader.java:39), net.minecraft.server.v1_8_R3.ChunkProviderServer.getChunkAt(ChunkProviderServer.java:110), net.minecraft.server.v1_8_R3.PlayerChunkMap$PlayerChunk.<init>(PlayerChunkMap.java:337), net.minecraft.server.v1_8_R3.PlayerChunkMap.a(PlayerChunkMap.java:93), net.minecraft.server.v1_8_R3.PlayerChunkMap.addPlayer(PlayerChunkMap.java:140), net.minecraft.server.v1_8_R3.PlayerList.a(PlayerList.java:256), net.minecraft.server.v1_8_R3.PlayerList.onPlayerJoin(PlayerList.java:332), net.minecraft.server.v1_8_R3.PlayerList.a(PlayerList.java:157), net.minecraft.server.v1_8_R3.LoginListener.b(LoginListener.java:144), net.minecraft.server.v1_8_R3.LoginListener.c(LoginListener.java:54), net.minecraft.server.v1_8_R3.NetworkManager.a(NetworkManager.java:231), net.minecraft.server.v1_8_R3.ServerConnection.c(ServerConnection.java:148), net.minecraft.server.v1_8_R3.MinecraftServer.B(MinecraftServer.java:813), net.minecraft.server.v1_8_R3.DedicatedServer.B(DedicatedServer.java:374), net.minecraft.server.v1_8_R3.MinecraftServer.A(MinecraftServer.java:653), net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:556), java.lang.Thread.run(Thread.java:745)], TIMED_WAITING Dynmap Render Thread: [sun.misc.Unsafe.park(Native Method), java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:226), java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2082), java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1090), java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:807), java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1068), java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130), java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615), java.lang.Thread.run(Thread.java:745)], WAITING Java2D Disposer: [java.lang.Object.wait(Native Method), java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:135), java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:151), sun.java2d.Disposer.run(Disposer.java:145), java.lang.Thread.run(Thread.java:745)], TIMED_WAITING Craft Scheduler Thread - 24: [sun.misc.Unsafe.park(Native Method), java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:226), java.util.concurrent.SynchronousQueue$TransferStack.awaitFulfill(SynchronousQueue.java:460), java.util.concurrent.SynchronousQueue$TransferStack.transfer(SynchronousQueue.java:359), java.util.concurrent.SynchronousQueue.poll(SynchronousQueue.java:942), java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1068), java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130), java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615), java.lang.Thread.run(Thread.java:745)], TIMED_WAITING pool-18-thread-4: [sun.misc.Unsafe.park(Native Method), java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:226), java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2082), java.util.concurrent.LinkedBlockingQueue.poll(LinkedBlockingQueue.java:467), java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1068), java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130), java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615), java.lang.Thread.run(Thread.java:745)], TIMED_WAITING HashSessionScavenger-0: [java.lang.Object.wait(Native Method), java.util.TimerThread.mainLoop(Timer.java:552), java.util.TimerThread.run(Timer.java:505)], RUNNABLE Netty Epoll Server IO #2: [io.netty.channel.epoll.Native.epollWait(Native Method), io.netty.channel.epoll.EpollEventLoop.epollWait(EpollEventLoop.java:194), io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:219), io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:116), java.lang.Thread.run(Thread.java:745)], TIMED_WAITING Craft Scheduler Thread - 23: [sun.misc.Unsafe.park(Native Method), java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:226), java.util.concurrent.SynchronousQueue$TransferStack.awaitFulfill(SynchronousQueue.java:460), java.util.concurrent.SynchronousQueue$TransferStack.transfer(SynchronousQueue.java:359), java.util.concurrent.SynchronousQueue.poll(SynchronousQueue.java:942), java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1068), java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130), java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615), java.lang.Thread.run(Thread.java:745)], RUNNABLE DestroyJavaVM: [], TIMED_WAITING Spigot Watchdog Thread: [java.lang.Thread.sleep(Native Method), org.spigotmc.WatchdogThread.run(WatchdogThread.java:92)], TIMED_WAITING Timer-1: [java.lang.Object.wait(Native Method), java.util.TimerThread.mainLoop(Timer.java:552), java.util.TimerThread.run(Timer.java:505)], TIMED_WAITING Thread-14: [java.lang.Thread.sleep(Native Method), org.dynmap.AsynchronousQueue.sleep(AsynchronousQueue.java:148), org.dynmap.AsynchronousQueue.running(AsynchronousQueue.java:136), org.dynmap.AsynchronousQueue.access$000(AsynchronousQueue.java:9), org.dynmap.AsynchronousQueue$1.run(AsynchronousQueue.java:83), java.lang.Thread.run(Thread.java:745)], TIMED_WAITING Server Infinisleeper: [java.lang.Thread.sleep(Native Method), net.minecraft.server.v1_8_R3.DedicatedServer$1.run(DedicatedServer.java:54)], WAITING Dynmap Render Thread: [sun.misc.Unsafe.park(Native Method), java.util.concurrent.locks.LockSupport.park(LockSupport.java:186), java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2043), java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1085), java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:807), java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1068), java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130), java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615), java.lang.Thread.run(Thread.java:745)], RUNNABLE pool-18-thread-2 Acceptor0 [email protected]:8505: [sun.nio.ch.ServerSocketChannelImpl.accept0(Native Method), sun.nio.ch.ServerSocketChannelImpl.accept(ServerSocketChannelImpl.java:241), org.dynmap.jetty.server.nio.SelectChannelConnector.accept(SelectChannelConnector.java:109), org.dynmap.jetty.server.AbstractConnector$Acceptor.run(AbstractConnector.java:938), java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145), java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615), java.lang.Thread.run(Thread.java:745)], TIMED_WAITING File IO Thread: [java.util.zip.Deflater.deflateBytes(Native Method), java.util.zip.Deflater.deflate(Deflater.java:430), java.util.zip.Deflater.deflate(Deflater.java:352), java.util.zip.DeflaterOutputStream.deflate(DeflaterOutputStream.java:251), java.util.zip.DeflaterOutputStream.write(DeflaterOutputStream.java:211), java.io.DataOutputStream.write(DataOutputStream.java:107), java.io.FilterOutputStream.write(FilterOutputStream.java:97), net.minecraft.server.v1_8_R3.NBTTagByteArray.write(NBTTagByteArray.java:20), net.minecraft.server.v1_8_R3.NBTTagCompound.a(SourceFile:391), net.minecraft.server.v1_8_R3.NBTTagCompound.write(SourceFile:52), net.minecraft.server.v1_8_R3.NBTTagList.write(NBTTagList.java:31), net.minecraft.server.v1_8_R3.NBTTagCompound.a(SourceFile:391), net.minecraft.server.v1_8_R3.NBTTagCompound.write(SourceFile:52), net.minecraft.server.v1_8_R3.NBTTagCompound.a(SourceFile:391), net.minecraft.server.v1_8_R3.NBTTagCompound.write(SourceFile:52), net.minecraft.server.v1_8_R3.NBTCompressedStreamTools.a(NBTCompressedStreamTools.java:70), net.minecraft.server.v1_8_R3.NBTCompressedStreamTools.a(NBTCompressedStreamTools.java:63), net.minecraft.server.v1_8_R3.ChunkRegionLoader.b(ChunkRegionLoader.java:179), net.minecraft.server.v1_8_R3.ChunkRegionLoader.c(ChunkRegionLoader.java:161), net.minecraft.server.v1_8_R3.FileIOThread.c(SourceFile:37), net.minecraft.server.v1_8_R3.FileIOThread.run(SourceFile:30), java.lang.Thread.run(Thread.java:745)], RUNNABLE Server console handler: [java.io.FileInputStream.readBytes(Native Method), java.io.FileInputStream.read(FileInputStream.java:272), java.io.BufferedInputStream.fill(BufferedInputStream.java:235), java.io.BufferedInputStream.read(BufferedInputStream.java:254), org.bukkit.craftbukkit.libs.jline.internal.NonBlockingInputStream.read(NonBlockingInputStream.java:248), org.bukkit.craftbukkit.libs.jline.internal.InputStreamReader.read(InputStreamReader.java:261), org.bukkit.craftbukkit.libs.jline.internal.InputStreamReader.read(InputStreamReader.java:198), org.bukkit.craftbukkit.libs.jline.console.ConsoleReader.readCharacter(ConsoleReader.java:2145), org.bukkit.craftbukkit.libs.jline.console.ConsoleReader.readLineSimple(ConsoleReader.java:3183), org.bukkit.craftbukkit.libs.jline.console.ConsoleReader.readLine(ConsoleReader.java:2333), org.bukkit.craftbukkit.libs.jline.console.ConsoleReader.readLine(ConsoleReader.java:2269), org.bukkit.craftbukkit.libs.jline.console.ConsoleReader.readLine(ConsoleReader.java:2257), net.minecraft.server.v1_8_R3.DedicatedServer$2.run(DedicatedServer.java:81)], TIMED_WAITING pool-18-thread-3: [sun.misc.Unsafe.park(Native Method), java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:226), java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSync
    hronizer.java:2082), java.util.concurrent.LinkedBlockingQueue.poll(LinkedBlockingQueue.java:467), java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1068), java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130), java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615), java.lang.Thread.run(Thread.java:745)], RUNNABLE Netty Epoll Server IO #0: [io.netty.channel.epoll.Native.epollWait(Native Method), io.netty.channel.epoll.EpollEventLoop.epollWait(EpollEventLoop.java:194), io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:219), io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:116), java.lang.Thread.run(Thread.java:745)], RUNNABLE Signal Dispatcher: [], WAITING Reference Handler: [java.lang.Object.wait(Native Method), java.lang.Object.wait(Object.java:503), java.lang.ref.Reference$ReferenceHandler.run(Reference.java:133)], TIMED_WAITING Spigot Metrics Thread: [java.lang.Object.wait(Native Method), java.util.TimerThread.mainLoop(Timer.java:552), java.util.TimerThread.run(Timer.java:505)], RUNNABLE Dynmap Render Thread: [org.dynmap.hdmap.TexturePack.readColor(TexturePack.java:2585), org.dynmap.hdmap.TexturePackHDShader$ShaderState.processBlock(TexturePackHDShader.java:191), org.dynmap.hdmap.IsoHDPerspective$OurPerspectiveState.visit_block(IsoHDPerspective.java:554), org.dynmap.hdmap.IsoHDPerspective$OurPerspectiveState.raytrace(IsoHDPerspective.java:648), org.dynmap.hdmap.IsoHDPerspective$OurPerspectiveState.access$300(IsoHDPerspective.java:84), org.dynmap.hdmap.IsoHDPerspective.render(IsoHDPerspective.java:1155), org.dynmap.hdmap.HDMapTile.render(HDMapTile.java:79), org.dynmap.MapManager$FullWorldRenderState.processTile(MapManager.java:700), org.dynmap.MapManager$FullWorldRenderState.run(MapManager.java:641), org.dynmap.MapManager$DynmapScheduledThreadPoolExecutor$1.run(MapManager.java:190), org.dynmap.MapManager$DynmapScheduledThreadPoolExecutor$2.run(MapManager.java:206), java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471), java.util.concurrent.FutureTask.run(FutureTask.java:262), java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:178), java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:292), java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145), java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615), java.lang.Thread.run(Thread.java:745)], WAITING Thread-4: [sun.misc.Unsafe.park(Native Method), java.util.concurrent.locks.LockSupport.park(LockSupport.java:186), java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2043), java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442), com.mojang.util.QueueLogAppender.getNextLogEvent(QueueLogAppender.java:77), org.bukkit.craftbukkit.v1_8_R3.util.TerminalConsoleWriterThread.run(TerminalConsoleWriterThread.java:25), java.lang.Thread.run(Thread.java:745)], TIMED_WAITING Timer-0: [java.lang.Object.wait(Native Method), java.util.TimerThread.mainLoop(Timer.java:552), java.util.TimerThread.run(Timer.java:505)], TIMED_WAITING Keep-Alive-Timer: [java.lang.Thread.sleep(Native Method), sun.net.www.http.KeepAliveCache.run(KeepAliveCache.java:172), java.lang.Thread.run(Thread.java:745)], TIMED_WAITING Craft Scheduler Thread - 21: [sun.misc.Unsafe.park(Native Method), java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:226), java.util.concurrent.SynchronousQueue$TransferStack.awaitFulfill(SynchronousQueue.java:460), java.util.concurrent.SynchronousQueue$TransferStack.transfer(SynchronousQueue.java:359), java.util.concurrent.SynchronousQueue.poll(SynchronousQueue.java:942), java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1068), java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130), java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615), java.lang.Thread.run(Thread.java:745)], RUNNABLE pool-18-thread-1 Selector0: [sun.nio.ch.EPollArrayWrapper.epollWait(Native Method), sun.nio.ch.EPollArrayWrapper.poll(EPollArrayWrapper.java:269), sun.nio.ch.EPollSelectorImpl.doSelect(EPollSelectorImpl.java:79), sun.nio.ch.SelectorImpl.lockAndDoSelect(SelectorImpl.java:87), sun.nio.ch.SelectorImpl.select(SelectorImpl.java:98), org.dynmap.jetty.io.nio.SelectorManager$SelectSet.doSelect(SelectorManager.java:569), org.dynmap.jetty.io.nio.SelectorManager$1.run(SelectorManager.java:290), java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145), java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615), java.lang.Thread.run(Thread.java:745)], TIMED_WAITING Snooper Timer: [java.lang.Object.wait(Native Method), java.util.TimerThread.mainLoop(Timer.java:552), java.util.TimerThread.run(Timer.java:505)], WAITING Finalizer: [java.lang.Object.wait(Native Method), java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:135), java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:151), java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:209)], TIMED_WAITING MStore ExamineThread: [java.lang.Thread.sleep(Native Method), com.massivecraft.massivecore.store.ExamineThread.run(ExamineThread.java:55)], RUNNABLE Chunk I/O Executor Thread-1: [java.lang.Thread.dumpThreads(Native Method), java.lang.Thread.getAllStackTraces(Thread.java:1640), org.bukkit.craftbukkit.v1_8_R3.CraftCrashReport.call(CraftCrashReport.java:29), net.minecraft.server.v1_8_R3.CrashReportSystemDetails.a(SourceFile:78), net.minecraft.server.v1_8_R3.CrashReport.h(CrashReport.java:127), net.minecraft.server.v1_8_R3.CrashReport.<init>(CrashReport.java:34), net.minecraft.server.v1_8_R3.CrashReport.a(CrashReport.java:312), net.minecraft.server.v1_8_R3.NBTTagCompound.a(SourceFile:408), net.minecraft.server.v1_8_R3.NBTTagCompound.load(SourceFile:70), net.minecraft.server.v1_8_R3.NBTTagCompound.a(SourceFile:406), net.minecraft.server.v1_8_R3.NBTTagCompound.load(SourceFile:70), net.minecraft.server.v1_8_R3.NBTCompressedStreamTools.a(NBTCompressedStreamTools.java:84), net.minecraft.server.v1_8_R3.NBTCompressedStreamTools.a(NBTCompressedStreamTools.java:53), net.minecraft.server.v1_8_R3.NBTCompressedStreamTools.a(NBTCompressedStreamTools.java:43), net.minecraft.server.v1_8_R3.ChunkRegionLoader.loadChunk(ChunkRegionLoader.java:70), org.bukkit.craftbukkit.v1_8_R3.chunkio.ChunkIOProvider.callStage1(ChunkIOProvider.java:25), org.bukkit.craftbukkit.v1_8_R3.chunkio.ChunkIOProvider.callStage1(ChunkIOProvider.java:1), org.bukkit.craftbukkit.v1_8_R3.util.AsynchronousExecutor$Task.init(AsynchronousExecutor.java:150), org.bukkit.craftbukkit.v1_8_R3.util.AsynchronousExecutor$Task.initAsync(AsynchronousExecutor.java:95), org.bukkit.craftbukkit.v1_8_R3.util.AsynchronousExecutor$Task.run(AsynchronousExecutor.java:85), java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145), java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615), java.lang.Thread.run(Thread.java:745)], WAITING pool-19-thread-1: [sun.misc.Unsafe.park(Native Method), java.util.concurrent.locks.LockSupport.park(LockSupport.java:186), java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2043), java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442), java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1068), java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130), java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615), java.lang.Thread.run(Thread.java:745)], TIMED_WAITING pool-13-thread-2: [sun.misc.Unsafe.park(Native Method), java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:226), java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2082), java.util.concurrent.LinkedBlockingDeque.pollFirst(LinkedBlockingDeque.java:519), java.util.concurrent.LinkedBlockingDeque.poll(LinkedBlockingDeque.java:682), java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1068), java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130), java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615), java.lang.Thread.run(Thread.java:745)], RUNNABLE Netty Epoll Server IO #3: [io.netty.channel.epoll.Native.epollWait(Native Method), io.netty.channel.epoll.EpollEventLoop.epollWait(EpollEventLoop.java:194), io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:219), io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:116), java.lang.Thread.run(Thread.java:745)], RUNNABLE Netty Epoll Server IO #1: [io.netty.channel.epoll.Native.epollWait(Native Method), io.netty.channel.epoll.EpollEventLoop.epollWait(EpollEventLoop.java:194), io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:219), io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:116), java.lang.Thread.run(Thread.java:745)],}
    Recent tasks from 6762-6792{EnjinMinecraftPlugin:[email protected],}
    Profiler Position: N/A (disabled)
    Player Count: 1 / 50; [EntityPlayer['Jtom2015'/27521, l='PlsWork', x=65.98, y=114.00, z=503.00](Jtom2015 at 65.97736161507603,114.0,502.99833666425155)]
    Is Modded: Definitely; Server brand changed to 'Spigot'
    Type: Dedicated Server (map_server.txt)

    Posted in: Server Support and Administration
  • 0

    posted a message on 1.8 Metadata Help

    I was able to get my meta data colored planks to work fine, but I seem to be having trouble getting the textures to work.

    Colored Plank class:


    package com.ProfitOrange.moshiz.blocks.MoShizMetaBlock;

    import java.util.List;

    import com.ProfitOrange.moshiz.MoShizMain;

    import net.minecraft.block.Block;
    import net.minecraft.block.material.MapColor;
    import net.minecraft.block.material.Material;
    import net.minecraft.block.properties.IProperty;
    import net.minecraft.block.properties.PropertyEnum;
    import net.minecraft.block.state.BlockState;
    import net.minecraft.block.state.IBlockState;
    import net.minecraft.creativetab.CreativeTabs;
    import net.minecraft.item.EnumDyeColor;
    import net.minecraft.item.Item;
    import net.minecraft.item.ItemStack;
    import net.minecraftforge.fml.relauncher.Side;
    import net.minecraftforge.fml.relauncher.SideOnly;

    public class ColoredPlanks extends Block
    {
    public static final PropertyEnum COLOR = PropertyEnum.create("", EnumDyeColor.class);


    public ColoredPlanks(Material material)
    {
    super(material);
    this.setDefaultState(this.blockState.getBaseState().withProperty(COLOR, EnumDyeColor.WHITE));
    this.setCreativeTab(MoShizMain.tabTest);
    }

    /**
    * Get the damage value that this Block should drop
    */
    public int damageDropped(IBlockState state)
    {
    return ((EnumDyeColor)state.getValue(COLOR)).getMetadata();
    }

    /**
    * returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks)
    */
    @SideOnly(Side.CLIENT)
    public void getSubBlocks(Item itemIn, CreativeTabs tab, List list)
    {
    EnumDyeColor[] aenumdyecolor = EnumDyeColor.values();
    int i = aenumdyecolor.length;

    for (int j = 0; j < i; ++j)
    {
    EnumDyeColor enumdyecolor = aenumdyecolor[j];
    list.add(new ItemStack(itemIn, 1, enumdyecolor.getMetadata()));
    }
    }

    /**
    * Get the MapColor for this Block and the given BlockState
    */
    public MapColor getMapColor(IBlockState state)
    {
    return ((EnumDyeColor)state.getValue(COLOR)).getMapColor();
    }

    /**
    * Convert the given metadata into a BlockState for this Block
    */
    public IBlockState getStateFromMeta(int meta)
    {
    return this.getDefaultState().withProperty(COLOR, EnumDyeColor.byMetadata(meta));
    }

    /**
    * Convert the BlockState into the correct metadata value
    */
    public int getMetaFromState(IBlockState state)
    {
    return ((EnumDyeColor)state.getValue(COLOR)).getMetadata();
    }

    protected BlockState createBlockState()
    {
    return new BlockState(this, new IProperty[] {COLOR});
    }
    }


    Item Colored Planks:


    package com.ProfitOrange.moshiz.items.MoShizMetaItem;

    import net.minecraft.block.Block;
    import net.minecraft.item.ItemBlock;
    import net.minecraft.item.ItemStack;

    public class ItemColoredPlanks extends ItemBlock
    {

    public static final String[] subBlocks = new String[] {"black", "red", "green", "brown", "blue", "purple", "cyan", "lightgrey", "grey", "pink", "limegreen", "yellow", "lightblue", "magenta", "orange", "white"};

    public ItemColoredPlanks(Block block)
    {
    super(block);
    this.setHasSubtypes(true);
    }

    public String getUnlocalizedName(ItemStack itemstack)
    {
    int i = itemstack.getItemDamage();
    if (i < 0 || i >= subBlocks.length)
    {
    i = 0;
    }
    return super.getUnlocalizedName() + "." + subBlocks return super.getUnlocalizedName() + "." + subBlocks return super.getUnlocalizedName() + "." + subBlocks;
    }
    public int getMetadata(int meta){
    return meta;
    }
    }


    And my block is registered as such:


    public static Block coloredPlanks;



    In the preinit:


    coloredPlanks = new
    ColoredPlanks(Material.wood).setHardness(2.0F).setResistance(5.0F).setStepSound(Block.soundTypeWood).setUnlocalizedName("meta/coloredPlanks");




    The GameRegistry:


    GameRegistry.registerBlock(coloredPlanks, ItemColoredPlanks.class, coloredPlanks.getUnlocalizedName().substring(5));



    The RegisterRender:


    registerRender(coloredPlanks);



    The RegisterRender method:


    public static void registerRender(Block block)
    {
    Item item = Item.getItemFromBlock(block);
    Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, 0, new ModelResourceLocation(Reference.MOD_ID + ":" + item.getUnlocalizedName().substring(5), "inventory"));;
    }

    I should have also said; I am looking for a away so I only need 1 .JSON file in the blockstates, but I just can't seem to get it to want to find the .JSON I created.

    Posted in: Modification Development
  • 0

    posted a message on Ore Dictionary

    I seem to be having issues with adding my mods ores to the ore dictionary. Is there a certain way they need to be named?

    I have never used the ore dictionary before since I do not normally use mods with my mod that require lots of different ores. I'm only asking since I have gotten a few request for adding ore dictionary support.

    Posted in: Modification Development
  • 0

    posted a message on Referencing .JSON files in another folder

    I only realized that a few days later. Major fail on my behalf. I tried added foods/ after the ":" but it didn't want to work for me, then I realized that the folder name didn't have an "s" after "food".

    Posted in: Modification Development
  • 0

    posted a message on Referencing .JSON files in another folder

    Figured it out while messing around with adding items, if I add "food/beefSandwich" in the .getUnlocalizedName(), it finds it in the corresponding folder.

    Posted in: Modification Development
  • 0

    posted a message on Referencing .JSON files in another folder

    This is my food class as of now:

    package com.ProfitOrange.moshiz.init;
    
    import com.ProfitOrange.moshiz.MoShizMain;
    import com.ProfitOrange.moshiz.Reference;
    
    import net.minecraft.client.Minecraft;
    import net.minecraft.client.resources.model.ModelResourceLocation;
    import net.minecraft.item.Item;
    import net.minecraft.item.ItemFood;
    import net.minecraftforge.fml.common.registry.GameRegistry;
    
    public class MoShizFoods {
        
        
        
        public static Item beefSandwich;
    
        
        
        public static void init()
        {
            beefSandwich = new ItemFood(8, 0.8F, false).setUnlocalizedName("beefSandwich").setCreativeTab(MoShizMain.tabGems);
            
            
            
        }
        
        public static void register()
        {
            GameRegistry.registerItem(beefSandwich, beefSandwich.getUnlocalizedName().substring(5));
            
            
        }
        
        public static void registerRenders()
        {
            registerRender(beefSandwich);
            
            
        }
        
        public static void registerRender(Item item)
        {
            Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, 0, new ModelResourceLocation(Reference.MOD_ID + ":" + item.getUnlocalizedName().substring(5), "inventory"));;
        }
    }


    I tried changing things on the resource location thing, but I was unable to get it to work.

    Posted in: Modification Development
  • 0

    posted a message on Referencing .JSON files in another folder

    I have searched the internet yet I can't find any information on this topic. I want to be able to reference item json files from another folder.


    Right now they are referenced in the models/item folder, which is great and all, but it will get very crowded when I have to add in my 800+ things my mod adds. I was wondering if and/or how to set it to find them in a folder like this for example: models/item/food

    If I can figure that out, I could make the item folder for json files much cleaner and easier to search for the correct file if I need to alter it later on.

    Posted in: Modification Development
  • 0

    posted a message on Need help with .setHarvestLevel

    Thanks for the information, just tested it out and everything works perfectly.

    Posted in: Modification Development
  • 0

    posted a message on Getting the world save folder

    What do you mean more specifically, getting it from the forge workspace?

    Posted in: Modification Development
  • 0

    posted a message on Need help with .setHarvestLevel

    In my mod I have 39 new ores, so since I was rewriting my mod for 1.8, I would use minecraft's BlockOre class as an example to compress everything into a simple class file. Everything else works just fine, my only problem is the .setHarvestLevel.

    If I use it here:

    amazoniteOre = new MoShizOre().setUnlocalizedName("amazoniteOre").setHarvestLevel("pickaxe", 1);

    it throws an error: cannot convert void to block

    If I try to declare it in the MoShizOre class with some if statements, it doesn't work and all pickaxes can break it.

    Posted in: Modification Development
  • 0

    posted a message on Changing where my mod references .JSON files

    In 1.8, you do not set the texture with the java code, you have to create a .JSON file for every single item to handle the rendering of the texture.

    Posted in: Modification Development
  • To post a comment, please or register a new account.