Terrails
Members-
Posts
186 -
Joined
-
Last visited
-
Days Won
1
Everything posted by Terrails
-
[1.13.2] Custom player capability not working after changing dimension
Terrails replied to xerca's topic in Modder Support
There's an issue on this matter already. We're just waiting for someone to make a PR for it. It will probably take some time since it needs quite a bit of patches. -
META-INF file is used for ATs, doesn't have to do anything with Maven. If you're using IntelliJ just add the .jar files to the libs folder and it will work, you will probably have to refresh gradle by using that button in gradle module, If you're using Eclipse you have to add something to your gradle.build file for it to work dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) // For all .jar files in folder compile files('libs/file_name.jar') // For one .jar file in folder } The mod will be ran with the client too, adding it again to the mods folder will just cause a duplicate mods error. NOTE: Make sure to use deobfuscated jar files.
-
1.12.2 How to make a life steal enchantment by percentage [SOLVED]
Terrails replied to Enderlook's topic in Modder Support
If you use @EventBusSubscriber you have to make the event method static -
What even... 1. your modid is "fm" out of the sudden now? Don't use a short modid like that, use "fishoverload" like you used before. 2. Your whole assets folder is a mess. The json is pointing at something entirely different. Why is "assets:" inside the resource location, you should only use the modid as the resource domain, in your case "fishoverload:texture_location", and lastly you're missing the texture.
-
I'm guessing its the json, since its missing a bracket at the start and the end
-
Your file is fishoverload:models/item/FishBowl.json With that we have problematic code #13 The name is wrong and its not lower case. It has to be like the exception says Caused by: java.io.FileNotFoundException: fishoverload:models/item/fish_bowl.json
-
I meant when you override a method for your custom block/item... some of them have World as parameter
-
using Minecraft will only work on client, you'll crash when you run a dedicated server... you should probably use world instance from the parameters of a method in case of Block/Item, Events.... and from the class in case of TileEntity... etc. Look at sides for more info
-
To see if the server is dedicated or integrated just use MinecraftServer#isDedicatedServer... for LAN world I think maybe checking if the server is integrated and MinecraftServer#getPlayerList has 2 or more players. I think you will have to use packets to do something on the client for the change dimension and respawn events. For checking the minecraft version use ForgeVersion.mcVersion (I use that but you can also use MinecraftForge.MC_VERSION or Loader.MC_VERSION since it connects to the same thing)
-
Would anyone help on a crash with block state storage?
Terrails replied to Ice2670's topic in Modder Support
You should learn more about sides... for example you're using server side in onBlockAdded for TileEntityPlasmaCannon#getstate which means that data isn't stored on the client, if you need it on the client you have to send a packet to the client or just get rid of if (!worldIn.isRemote) and make TileEntityPlasmaCannon#getstate be started on both sides. You're also updating the TileEntityPlasmaCannon.powerfactor on server side only... thats why there's nothing on client side (its always 0)... also you're just making your code 4 times bigger because you're not using I know this is gonna be kind of annoying but you should learn more java... trust me I've been where you are now 2 years ago but now I'm a lot better. -
Would anyone help on a crash with block state storage?
Terrails replied to Ice2670's topic in Modder Support
its something with your fireplasma method then... need a crash report. Tile gets created together with the block. what you’re doing with World#getTileEntity is just getting the tile entity that is on that pos -
You're not calling this method anywhere. The tile wasn't even registered, also you should probably update forge since that GameRegistry#registerTileEntity method was deprecated... you should use the one with ResourceLocation parameter instead of string... or just make the string be like this "modid:tilename"
-
Would anyone help on a crash with block state storage?
Terrails replied to Ice2670's topic in Modder Support
it will not crash the game... you're just getting the tile from that location, the tile was already created before onBlockAdded, onBlockActivated... etc -
Would anyone help on a crash with block state storage?
Terrails replied to Ice2670's topic in Modder Support
You are still using instance fields... you need something like this... all local variables TileEntityPlasmaCannon tile = (TileEntityPlasmaCannon) worldIn.getTileEntity(pos); tile.getstate(state); I'll try to explain singletons a bit... I don't know if everything will be correct but basically... a singleton is only one instance of a class, which means that all blocks only use that one instance instead of a new instance for each block, so all instance fields (the variables of the class) are shared between blocks, for example in your code... you're assigning the tile entity of only one block to the field... which means all the other blocks would use that same tile entity since they share all instance fields, thats why you have to do everything in the methods you override. So when you place another block, that tile entity field would be changed and the block placed before wouldn't function correctly. -
Would anyone help on a crash with block state storage?
Terrails replied to Ice2670's topic in Modder Support
Use World#getTileEntity in onBlockActivated... don't use instance fields -
Would anyone help on a crash with block state storage?
Terrails replied to Ice2670's topic in Modder Support
Don't use fields like these TileEntity tileentity; TileEntityPlasmaCannon plasmacannon; in your block to assign a tile.... blocks are singletons so all blocks will use the same tile then... just use World#getTileEntity and cast it to TileEntityPlasmaCannon... -
[SOLVED][1.12.2] Trouble with a translucent block
Terrails replied to Riss_Crew's topic in Modder Support
Look into BlockBreakable class (BlockSlime extends it)... you have to override isOpaqueCube to not see the air -
You're trying to load a class that contains CLIENT only code on SERVER which is why you're getting this crash. I think annotating your ModKeys class with SideOnly should fix it but make sure to not access that class from anywhere else except your ClientProxy
-
1.12.2 | Custom dimension and portal causing a crash.
Terrails replied to Daring Do's topic in Modder Support
This is all you need... like for real: @SubscribeEvent public static void hurtEvent(LivingHurtEvent event) { if (event.getEntityLiving() instanceof EntityPlayerMP) { EntityPlayerMP player = (EntityPlayerMP) event.getEntityLiving(); PlayerList playerList = player.getEntityWorld().getMinecraftServer().getPlayerList(); playerList.transferPlayerToDimension(player, <dimension>, new TeleporterVoid((WorldServer) player.getEntityWorld())); } } -
1.12.2 | Custom dimension and portal causing a crash.
Terrails replied to Daring Do's topic in Modder Support
You shouldn't be using that world in your class (what are you even doing with it).... Use the world you get from the event event.getEntityLiving().getEntityWorld() also make sure to check this if (event.getEntityLiving() instanceof EntityPlayerMP) { } you don't need world.isRemote then since you already know its on server since its the server player. -
1.12.2 | Custom dimension and portal causing a crash.
Terrails replied to Daring Do's topic in Modder Support
Make sure to the the world is on server... if (!world.isRemote) { // Code } If that doesn't still do it (which it should) try something like this: if (!world.isRemote) { ((WorldServer) world).getMinecraftServer().getPlayerList().transferPlayerToDimension( (EntityPlayerMP) player.getEntity(), 100, new TeleporterVoid(world.getMinecraftServer().getWorld(100))); } Also you should probably use the entity world for the teleporter -
1.12.2 | Custom dimension and portal causing a crash.
Terrails replied to Daring Do's topic in Modder Support
the portal doesn't get created actually, it only just teleports the player if you use my example of placeInPortal. -
1.12.2 | Custom dimension and portal causing a crash.
Terrails replied to Daring Do's topic in Modder Support
Just tried it myself and it crashes me when it starts placeInExistingPortal(Entity entityIn, float rotationYaw); in placeInPortal method. If you want to use that you need to override it and make it work for you... also I suggest adding BlockPos to the constructor and then accessing it in placeInPortal(Entity entity, float rotationYaw); I do something like this (You could also use Entity#setLocationAndAngles, but I prefer it this way): @Override public void placeInPortal(Entity entity, float rotationYaw) { entity.setPosition(this.pos.getX() + 0.5, this.pos.getY(), this.pos.getZ() + 0.5); entity.motionX = 0.0f; entity.motionY = 0.0f; entity.motionZ = 0.0f; } Also don't forget to add @Override to your methods