Everything posted by Alexiy
- 
	
		
		[1.12.2]How does one use Item.getBurnTime on a Block
		
		It isn't that bad compared to what was a couple of years ago. Now there is plenty of open source code to look at if you can't find documentation. People contribute to Forge for free, so don't expect it to be professional-grade project.
 - 
	
		
		[1.12.2]How does one use Item.getBurnTime on a Block
		
		Use FurnaceFuelBurnTimeEvent.
 - 
	
		
		[1.12.2] World.setBlockState() work in physical server side and not show correctly in client
		
		Oh, I've noticed you haven't overridden getStateFromMeta method. You have to override it and return appropriate state from the given metadata. And in getMetaFromState you have to return appropriate metadata, I guess in your case it will be just state.getValue(STAGE).
 - 
	
		
		[1.12.2] World.setBlockState() work in physical server side and not show correctly in client
		
		Ok, let's try this - after the line worldIn.setBlockState(pos, state.cycleProperty(STAGE), 4) add following: IBlockState blockState=worldIn.getBlockState(pos); worldIn.notifyBlockUpdate(pos,blockState,blockState,2);
 - 
	
		
		[1.12.2] World.setBlockState() work in physical server side and not show correctly in client
		
		Try 'setBlockState' without a flag or with a flag 2.
 - 
	
		
		Can't create a world anymore (1.12.2)
		
		I don't know what I've done with my project, by I am unable to create any world anymore. It stucks on world loading screen. Here is the log: https://pastebin.com/V2bKUvcq
 - 
	
		
		1.12 Tool enchantments won't work
		
		Override 'getItemEnchantability' and return respective tool material enchantability.
 - 
	
		
		[1.12.2]Container questions
		
		It is intented to send changes to client, so it's effective on server only.
 - 
	
		
		[1.12.2]Non world placeable fluid
		
		I believe you still have to create a block for your fluid, because for texture to render you have to use ModelLoader.registerItemVariants and ModelLoader.setCustomMeshDefinition. They both accept Item, in your case, it will be an ItemBlock with your fluid block instance.
 - 
	
		
		Proportional gui scale and position
		
		Have you tried setting xSize, ySize, guiLeft and guiTop? For example: @Override public void initGui() { super.initGui(); xSize=width-10; ySize=height-10; guiLeft=(width-xSize)/2; guiTop=(height-ySize)/2; } "width" and "height" fields are the ones that scale when screen size changes.
 - 
	
		
		Event to close GUI if clicked outside?
		
		I know that if you click outside gui borders, a slot index of -999 will be passed to Container#slotClick method, so you might want to make use of that.
 - 
	
		
		Regarding ItemStackHandler
		
		Well, I implemented that in my custom handler. But I suppose it wouldn't be accepted in a pull request to Forge? I don't like that when, say, there is a stack in slot 12 with size 24, and a hopper inserts a stack with same item into empty slot 3 just because this slot happened to be found first.
 - 
	
		
		Set stackTagCompound in creative menu?
		
		I suppose you can do this in Item#getSubItems function.
 - 
	
		
		Regarding ItemStackHandler
		
		Is there a reason that Forge's item handler doesn't merge incoming stacks with existing stacks first, but inserts into empty slot first instead? Is it performance?
 - 
	
		
		Directional Blocks w/ Blockstates
		
		Are your json files' names lowercase?
 - 
	
		
		Need A ItemPickup Event For Achievements [1.11.2]
		
		ItemPickupEvent is currently broken.
 - 
	
		
		[SOLVED] [1.12.2] Item Rendering Fail
		
		ItemChease.json must be lowercase
 - 
	
		
		[1.11] GuiScreen rendering Block in GUI is very dark compared to other items
		
		Try things with lighting, like: GlStateManager.disableLighting(); Minecraft.getMinecraft().getRenderItem().renderItemIntoGUI(icon3, 0, 0); GlStateManager.enableLighting();
 - 
	
		
		[1.11] @SubscribeEvents inside Block class not running
		
		You can't. What you can do is utilize the position from the event, create an AA-bounding box of desired range and check for presence of your block within that box.
 - 
	
		
		[1.10.2] [SOLVED] Errors that don't crash the game or do anything?
		
		Ignore them, it throws this exception because you aren't using registered username ("Player700" and alike). Or you can specify your username and password in run configuration so it actually logs in.
 - 
	
		
		DataParameter value set based on position [1.12.2]
		
		I have a little mod which adds one creature (dragon). It has four variations. The variation is registered in data manager. When the creature is spawned, it's variation is set based on the biome where it spawns. Parameters of the dragon: public static final DataParameter<Integer> dragonType = EntityDataManager.createKey(EntityDragon.class, DataSerializers.VARINT); private static final DataParameter<Optional<UUID>> ownerID = EntityDataManager.createKey(EntityDragon.class,DataSerializers.OPTIONAL_UNIQUE_ID); private Entity owner; public static final DataParameter<Boolean> sitting = EntityDataManager.createKey(EntityDragon.class,DataSerializers.BOOLEAN); @Override protected void entityInit() { super.entityInit(); setSize(0.7f,0.85f); dataManager.register(dragonType,0); dataManager.register(ownerID, Optional.absent()); dataManager.register(sitting,false); } Setting the dragon type: @SubscribeEvent public void setDragonType(LivingSpawnEvent.SpecialSpawn livingSpawnEvent) { EntityLivingBase entityLivingBase=livingSpawnEvent.getEntityLiving(); if(entityLivingBase instanceof EntityDragon) { BlockPos blockPos=new BlockPos(livingSpawnEvent.getX(),livingSpawnEvent.getY(),livingSpawnEvent.getZ()); Biome biome=livingSpawnEvent.getWorld().getBiome(blockPos); int type=0; if(biome instanceof BiomeJungle) type=EntityDragon.GREEN; else if(biome instanceof BiomeDesert) type=EntityDragon.GOLD; else if(biome instanceof BiomeForest) type=EntityDragon.EBONY; else if(biome instanceof BiomeHills) type=EntityDragon.SILVER; entityLivingBase.getDataManager().set(EntityDragon.dragonType,type); } } The question is, is it possible to set the type without using the event? I couldn't find a suitable method to override that would have the dragon's position set.
 - 
	
		
		[1.12.1] Custom ItemStackhandler.insertItem being called twice per item inserted
		
		If i'm right, you must deal with item handlers only on server side.
 - 
	
		
		'LivingDropsEvent'Problem ,How to set the drops twice as long?
		
		You can copy the itemstacks from the entity items in the list, then create new entity items for copied drops, then add those to the list.
 - 
	
		
		'LivingDropsEvent'Problem ,How to set the drops twice as long?
		
		e.drops.addAll(e.drops); I don't think this will have any effect.
 - 
	
		
		Problem with item rotation
		
		Take a look at one of preset item models - assets/minecraft/models/item/handheld.json and ~generated.json. There are various sections. You should use one that corresponds to hotbar display in your json file and change the rotation, scale and translation as you like.
 
IPS spam blocked by CleanTalk.