-
Rendering texture fullbright in entity render
Hey all, I am trying to render a texture I am drawing on fullbright but I cannot figure it out. Fullbright meaning that it is as light in the day as in the night. This gives it the glowing effect. Right now whenever it turns night the texture also seems to darken which is not what I want. Only I have no sufficient knowledge on how to do this. Is someone willing to help me? This is the code for texture drawing. https://pastebin.com/aQnUU5M6 Thanks in advance!
-
Cancel opening the trade container to open my own GUI
I added a villager, and when that villager is right clicked it should open a custom gui instead of the villager trading gui. I got as far as using AT to get the IMerchant value and now I know when its the villager I added. But the event is uncancelable and if I open my GUI first then the container of the tradegui will just open after it. Is there a way I can do this? I have already looked into GuiOpenEvent but that way I cannot get the container. If I grab either container variable from the player its a ContainerPlayer which is the inventory. Code: @SubscribeEvent public static void onOpenVillagerGUI(PlayerContainerEvent.Open event){ if(event.getContainer() instanceof ContainerMerchant){ ContainerMerchant merchantContainer = (ContainerMerchant) event.getContainer(); InventoryMerchant merchant = merchantContainer.getMerchantInventory(); if(!(merchant.merchant instanceof EntityVillager)){ return; } EntityVillager villager = (EntityVillager) merchant.merchant; if(villager.getProfessionForge().getRegistryName().toString() .equalsIgnoreCase(ModVillage.OLD_PRIEST_PROFESSION.getRegistryName().toString())){ Minecraft.getMinecraft().player.openGui(Solar.instance, GuiHandler.GUIDE_BOOK_ID_GUI, event.getEntityPlayer().getEntityWorld(), 0, 0, 0); } } } How would I stop the opening, or close it and then open my own GUI?
-
[1.12.2] Load a chunk
So, either I am blind. But I can not find the method to load a chunk. I am trying to get a block on the onLoad in an tileEntity, but thats in an unloaded chunk. How would I load that chunk first so i can get the block?
-
Property Direction not found in block
I think i kind of figured it out. It was always creating a BlockStateContainer without the Facing property. I overrid the method createStateContainer and added both Properties. Right now it seems to ask me for an updated json with all the faces so it might have worked.
-
Property Direction not found in block
I am getting an error when I try to make a block one which can have rotating sides. This is the error: java.lang.IllegalArgumentException: Cannot get property PropertyDirection{name=facing, clazz=class net.minecraft.util.EnumFacing, values=[north, south, west, east]} as it does not exist in BlockStateContainer{block=null, properties=[type]} at net.minecraft.block.state.BlockStateContainer$StateImplementation.getValue(BlockStateContainer.java:204) at com.mart.solar.common.blocks.BlockMenhir.getMetaFromState(BlockMenhir.java:139) at net.minecraft.block.Block.setHarvestLevel(Block.java:2267) at net.minecraft.block.Block.setHarvestLevel(Block.java:2249) at com.mart.solar.common.blocks.BlockMenhir.<init>(BlockMenhir.java:44) at com.mart.solar.common.registry.ModBlocks.registerBlocks(ModBlocks.java:63) at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_15_ModBlocks_registerBlocks_Register.invoke(.dynamic) at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:90) at net.minecraftforge.fml.common.eventhandler.EventBus$1.invoke(EventBus.java:143) at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:179) at net.minecraftforge.registries.GameData.fireRegistryEvents(GameData.java:736) at net.minecraftforge.fml.common.Loader.preinitializeMods(Loader.java:603) at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:270) at net.minecraft.client.Minecraft.init(Minecraft.java:513) at net.minecraft.client.Minecraft.run(Minecraft.java:421) at net.minecraft.client.main.Main.main(Main.java:118) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) at net.minecraft.launchwrapper.Launch.main(Launch.java:28) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) at GradleStart.main(GradleStart.java:26) This is the class: https://pastebin.com/L7aVvS3U And this is my BlockEnum https://pastebin.com/2MZpsqwz If there is more info needed. My project: https://github.com/Martacus/Solar I hope someone can help me. I know what lines errors. I just cant figure out how I can give the blockstates the properties it needs before that happens.
-
Giving motion from EntityItem to custom EntityItem
I rewrote that post 3 times, saw it, then didnt, then finally did. Thanks
-
Giving motion from EntityItem to custom EntityItem
Goddamnit I see... The location variable is the Entity. Thats weird aint it >.> Shouldnt it just be named entity then?
-
Giving motion from EntityItem to custom EntityItem
What are the values (the actual integers) i need to set on motionX motionY and motionZ for the items to drop normal like any other item would and not space out like a chicken. Or how do I get those values or where can I find those values.
-
Giving motion from EntityItem to custom EntityItem
Hey diesieben, Yeah I know: > I can't find a way to give it motion other than setting it myself. What I am asking is how would I get the value's for the motion. The x y and z. To make it fall like normal items do when they get dropped. Or even, what are they.
-
Giving motion from EntityItem to custom EntityItem
For an item I have I create a custom EntityItem like so: @Nullable @Override public Entity createEntity(World world, Entity location, ItemStack itemstack) { return new RuneEntity(world, location.posX, location.posY, location.posZ, itemstack); } But when it spawns it falls to the ground like nothing happens. I can't find a way to give it motion other than setting it myself. But i want the player that has thrown it its direction ofcourse. How would I set the motion so it fals like a normal item. If I look in the EntityPlayer class it sets the thrower and then the motion but it makes no sense to me why it won't do that for my custom item.
-
[Solved] Item added/removed ItemHandler Capabilty check
I would like to check if an item has been added to the capability or removed from the capability by something. Like an hopper for exactly . Is there an event for it? Or do I have to manually check every tick if they slot has changed. This is my class: Thanks!
-
[Solved]How to stop fence from connecting to my block
Works like a charm! Thanks for pointing out the issue too
-
[Solved]How to stop fence from connecting to my block
I want fences to stop connecting to my blocks. So I override this method: Override public boolean canBeConnectedTo(IBlockAccess world, BlockPos pos, EnumFacing facing) { return false; } But that didnt work. Now I tried this: @Override public boolean isFullCube(IBlockState state) { return false; } Because it was in the glass block class, but that doesnt seem to work either.. This is my whole block class: Hastebin: https://hastebin.com/ugunowidax.java Thanks
-
Problem with ItemAxe
Your registry name of the item is null. You have not set it. or at least that it was the error tells us. It seems you are doing registration wrong for 1.12. Look at this: https://mcforge.readthedocs.io/en/latest/concepts/registries/
-
[Solved] [1.7.2] Is there a ender pearl throw event?
Damn. I grew a lot in 4 years. Thanks for the help guyz, you helped me become what I am today haha Marked as SOLVED.
IPS spam blocked by CleanTalk.