Everything posted by Terrails
-
[1.12.2] Logger not showing name
Just noticed to it shows the logger name when I launch a server, but it doesn't do it on a client
-
[1.12.2] IConditionFactory for Advancements
Is there an equivalent of IConditionFactory for advancements? I want to have an optional advancement so it can be disabled when an config value is false.
-
[1.12.2] Checking if advancement is complete
I've made some advancements and they're all loading and working (they're all in advancements folder in assets) but how would I check if an advancement has been complete in code? I found: player.getAdvancements().getProgress(Advancement).isDone() but I don't know how I would get an Advancement to put in getProgress(). I found to new Advancement() accepts couple of parameters, but I don't think I need to use that. Isn't there some method to get an advancement from the file name, something like Advancement.get("modid:advancement_file")
-
[1.12.2] Logger not showing name
Well I'm sometimes using a logger with a mix of objects and strings and sometimes only with string and its all the same
-
[1.12.2] Logger not showing name
There's a comment in that code block that I also tried FMLPreInitializationEvent#getModLog(), so that doesn't work too
-
Setting Block texture in Inventory (ItemBlock)
you can set the registry name with something like this in Item RegistryEvent event.getRegistry().register(new ItemBlock(saltore).setRegistryName(saltore.getRegistryName())); and for the models just use something like this: for (Block block : ModBlocks.getList()) { ModelResourceLocation location = new ModelResourceLocation(block.getRegistryName(), "inventory"); ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(block), 0, location); } for (Item item : ModItems.getList()) { ModelResourceLocation location = new ModelResourceLocation(item.getRegistryName(), "inventory"); ModelLoader.setCustomModelResourceLocation(item, 0, location); } I just iterate through each block/item I have in a list and set their model location
-
Setting Block texture in Inventory (ItemBlock)
The ModelLoader should go into a ModelRegistryEvent to register an event make the event method static and add @Mod.EventBusSubscriber annotation to the class or don't make it static and register it in your preInit with MinecraftForge.EVENT_BUS.register(Object theClassContainingTheEvent)
-
[1.12.2] Logger not showing name
I noticed this couple of days ago but chose to ignore it, but now when I need to find something that my mod printed in the log it isn't showing the mod name, it just uses standard "Server thread/INFO" logger import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; ... public static Logger LOGGER = LogManager.getLogger("NetherUtils"); // Also tried the FMLPreInitializationEvent#getModLog() public static void info(Object message) { LOGGER.info(message); } Did something change? Because I tried some other mods in my workspace and they too don't have a logger name.
-
[1.12.2] The best way to animate TESR
Looks like I was doing it the right way than.
-
[1.12.2] The best way to animate TESR
I'm making a block with a TESR that has some special effects, I was just wondering what would be the best way to use a counter in TESR because its a singleton. For now I have couple of counter fields in my TileEntity class. I need those counters because I'm translating and scaling and if I use System time it wouldn't start from the beginning, but I need it to start like that because its an activation sequence. Current TESR and Tile Am I doing it totally wrong and is there a better way to do it?
-
[1.12.2] Fluid tank slot and buckets
Never mind, looks like I made it work!
-
[1.12.2] Fluid tank slot and buckets
Here's the issue, I wanted to add a slot with which I fill my tank. When it comes to buckets it works when there's at least 1000 mB empty space left in the tank (then it empties the bucket and puts it in the slot which has empty fluid handlers), but when there is less then 1000 mB it fills the tank infinitely and doesn't drain the bucket (it doesn't do this with tanks from mekanism, thermal expansion etc...), what would be the best way to make sure it doesn't do this? code
-
[Solved][1.12.2] Properties and Blockstate json
Oh nvm, figured it out just added these two into variants: "has_water=false": [{}], "has_water=true": [{}],
-
[Solved][1.12.2] Properties and Blockstate json
I didn't want to post that in my old topic but how can I disable the variant search for a property because I get this error and because I have a multi-layer model and I'm not sure how I can put that variant in it and still use the model. Thats why I want to remove that variant exception.
-
[Solved][1.12.2] Tile and Block Material
Thank you for that explanation, I understand it now.
-
[Solved][1.12.2] Tile and Block Material
I removed getActualState and have these two, will that will work? (I'm sorry if I don't quite understand it but I never fully understood blockstates and metadata)
-
[Solved][1.12.2] Tile and Block Material
the thing with metadata is to if I have this: @Override public int getMetaFromState(IBlockState state) { return (state.getValue(HAS_WATER) ? 1 : 0); } @Override public IBlockState getStateFromMeta(int meta) { return this.getDefaultState().withProperty(HAS_WATER, meta == 1); } and if I use getMetaFromState in getMaterial it will always return 0 because the state in there has its property set to false. I got an idea by using the tile to change the blockstate and it works. https://gist.github.com/Terrails/1f569b51977fa72525a256b4fdd7a524 Is that good or can I improve it?
-
[Solved][1.12.2] Tile and Block Material
But how can I call it manually in getMaterial? I called it in onBlockActivated method and it worked, but I don't have World and BlockPos in getMaterial
-
[Solved][1.12.2] Tile and Block Material
Something similar to Flower Pots getActualState? It gets the tile and then sets the property. This works in F3 menu, but whenever I use IBlockState#getValue it returns false for that property.
-
[Solved][1.12.2] Tile and Block Material
what do you mean by that? I know I need to avoid class variables, but I couldn't find another way, since blockMaterial is protected and I couldn't access it from my tile because of that.
-
[Solved][1.12.2] Tile and Block Material
I have an fluid tank (with tile and everything), but I was wondering if there is an alternative to this, if getMaterial had a World object, it would be perfect, I could get the tile with it and I wouldn't need to override randomTick. I think its just not efficient, maybe there's another way but I couldn't find it.
-
Biomes in nether?
I tried looking at it but the code is too big as it uses custom GenLayers, WorldSettings, BiomeTypes and ChunkGenerators, I thought it would be just a matter of switching between the default and single biome provider, but I don't get it why there's need for custom GenLayers, BiomeTypes, ChunkGenerators and WorldSettings (I don't need custom world settings).
- Biomes in nether?
-
Biomes in nether?
I looked through some vanilla code and found out to WorldProviderHell uses BiomeProviderSingle, I tried to change it to BiomeProvider and unregister/register the custom WorldProvider in WorldEven.Load but I'm not sure how I would add the biomes to that world, the biome I made only works in overworld but I want it to be nether only.
-
[1.12] Water texture in block
Well it would be ideal if the water_still movement was there, but don't need it that much.
IPS spam blocked by CleanTalk.