Jump to content

Chixen

Members
  • Posts

    12
  • Joined

  • Last visited

Everything posted by Chixen

  1. yes, but I don't know how to do this. I tried looking up what a camera rendering matrix is but I couldn't find anything I understood.
  2. I want to change how large things are relative to how far they are. Like usually the scale of things are 1/sqrt(changeX^2+changeY^2+changeZ^2) but instead I would want the equations to be 1/(changeX+changeY+changeZ) for a taxicab distance view or just 1 for an isometric view. I have no idea how I would even start making this. I know there are some mods out there that allow isometric view, but the only one I found that worked with first person (immersive portals) was made in fabric.
  3. When I tried to load my new mod and create a new world, it loads correctly, but when I join the world, everything is just void, and no commands or chat messages work. This doesn't happen on worlds that have already been loaded. After I save and quit, it just gets suck on the "saving world" screen and can't close without use of the task manager or terminating the program directly. Code is below and console log below that. package chixen.linemod.core.event; import chixen.linemod.LineMod; import net.minecraft.util.math.vector.Vector3d; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.event.TickEvent.PlayerTickEvent; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.Mod.EventBusSubscriber.Bus; @Mod.EventBusSubscriber(modid = LineMod.MOD_ID, bus = Bus.FORGE, value = Dist.CLIENT) public class EventHandler { public static double rotSpeed = 0; public static Vector3d lastPos = new Vector3d(5779821.64151,7919321.64151,7987841.64151); public static double lineRotation = 0; @SubscribeEvent public static void onMove(final PlayerTickEvent event) { if(lastPos == new Vector3d(5779821.64151,7919321.64151,7987841.64151)) { lastPos = event.player.position(); } if(event.player.position().z - lastPos.z != (event.player.position().x - lastPos.x) * Math.tan(lineRotation)) { final double cd = Math.cos(lineRotation); final double sd = Math.sin(lineRotation); final double td = (event.player.position().x - lastPos.x) * cd + (event.player.position().z - lastPos.z) * sd; event.player.setPos(td * cd + lastPos.x, event.player.position().y, td * sd + lastPos.z); } lastPos = event.player.position(); lineRotation += rotSpeed * Math.PI / 20; } } Console log starting from world generation: [23:08:34] [Server thread/INFO] [minecraft/IntegratedServer]: Starting integrated minecraft server version 1.16.5 [23:08:34] [Server thread/INFO] [minecraft/MinecraftServer]: Generating keypair [23:08:34] [Server thread/DEBUG] [ne.mi.fm.lo.FileUtils/CORE]: Found existing serverconfig directory : .\saves\Showcase\serverconfig [23:08:34] [Server thread/DEBUG] [ne.mi.fm.co.ConfigTracker/CONFIG]: Loading configs type SERVER [23:08:34] [Server thread/DEBUG] [ne.mi.fm.co.ConfigFileTypeHandler/CONFIG]: Built TOML config for .\saves\Showcase\serverconfig\forge-server.toml [23:08:34] [Server thread/DEBUG] [ne.mi.fm.co.ConfigFileTypeHandler/CONFIG]: Loaded TOML config file .\saves\Showcase\serverconfig\forge-server.toml [23:08:34] [Server thread/DEBUG] [ne.mi.fm.co.ConfigFileTypeHandler/CONFIG]: Watching TOML config file .\saves\Showcase\serverconfig\forge-server.toml for changes [23:08:34] [Server thread/DEBUG] [ne.mi.co.ForgeConfig/FORGEMOD]: Loaded forge config file forge-server.toml [23:08:38] [Server thread/INFO] [minecraft/MinecraftServer]: Preparing start region for dimension minecraft:overworld [23:08:38] [Render thread/INFO] [minecraft/LoggingChunkStatusListener]: Preparing spawn area: 0% [23:08:38] [Render thread/INFO] [minecraft/LoggingChunkStatusListener]: Preparing spawn area: 0% [23:08:39] [Render thread/INFO] [minecraft/LoggingChunkStatusListener]: Preparing spawn area: 0% [23:08:39] [Render thread/INFO] [minecraft/LoggingChunkStatusListener]: Preparing spawn area: 0% [23:08:40] [Render thread/INFO] [minecraft/LoggingChunkStatusListener]: Preparing spawn area: 2% [23:08:41] [Render thread/INFO] [minecraft/LoggingChunkStatusListener]: Preparing spawn area: 6% [23:08:41] [Render thread/INFO] [minecraft/LoggingChunkStatusListener]: Preparing spawn area: 6% [23:08:41] [Render thread/INFO] [minecraft/LoggingChunkStatusListener]: Preparing spawn area: 9% [23:08:42] [Render thread/INFO] [minecraft/LoggingChunkStatusListener]: Preparing spawn area: 9% [23:08:42] [Render thread/INFO] [minecraft/LoggingChunkStatusListener]: Preparing spawn area: 15% [23:08:43] [Render thread/INFO] [minecraft/LoggingChunkStatusListener]: Preparing spawn area: 17% [23:08:43] [Render thread/INFO] [minecraft/LoggingChunkStatusListener]: Preparing spawn area: 17% [23:08:44] [Render thread/INFO] [minecraft/LoggingChunkStatusListener]: Preparing spawn area: 23% [23:08:44] [Render thread/INFO] [minecraft/LoggingChunkStatusListener]: Preparing spawn area: 26% [23:08:45] [Render thread/INFO] [minecraft/LoggingChunkStatusListener]: Preparing spawn area: 26% [23:08:45] [Render thread/INFO] [minecraft/LoggingChunkStatusListener]: Preparing spawn area: 32% [23:08:46] [Render thread/INFO] [minecraft/LoggingChunkStatusListener]: Preparing spawn area: 35% [23:08:47] [Render thread/INFO] [minecraft/LoggingChunkStatusListener]: Preparing spawn area: 39% [23:08:47] [Render thread/INFO] [minecraft/LoggingChunkStatusListener]: Preparing spawn area: 39% [23:08:48] [Render thread/INFO] [minecraft/LoggingChunkStatusListener]: Preparing spawn area: 47% [23:08:48] [Render thread/INFO] [minecraft/LoggingChunkStatusListener]: Preparing spawn area: 47% [23:08:48] [Render thread/INFO] [minecraft/LoggingChunkStatusListener]: Preparing spawn area: 55% [23:08:49] [Render thread/INFO] [minecraft/LoggingChunkStatusListener]: Preparing spawn area: 58% [23:08:50] [Render thread/INFO] [minecraft/LoggingChunkStatusListener]: Preparing spawn area: 60% [23:08:50] [Render thread/INFO] [minecraft/LoggingChunkStatusListener]: Preparing spawn area: 60% [23:08:50] [Render thread/INFO] [minecraft/LoggingChunkStatusListener]: Preparing spawn area: 70% [23:08:51] [Render thread/INFO] [minecraft/LoggingChunkStatusListener]: Preparing spawn area: 73% [23:08:51] [Render thread/INFO] [minecraft/LoggingChunkStatusListener]: Preparing spawn area: 76% [23:08:52] [Render thread/INFO] [minecraft/LoggingChunkStatusListener]: Preparing spawn area: 79% [23:08:52] [Render thread/INFO] [minecraft/LoggingChunkStatusListener]: Preparing spawn area: 86% [23:08:53] [Render thread/INFO] [minecraft/LoggingChunkStatusListener]: Preparing spawn area: 89% [23:08:53] [Render thread/INFO] [minecraft/LoggingChunkStatusListener]: Preparing spawn area: 89% [23:08:54] [Render thread/INFO] [minecraft/LoggingChunkStatusListener]: Time elapsed: 15961 ms [23:08:54] [Server thread/INFO] [minecraft/IntegratedServer]: Changing view distance to 11, from 10 [23:08:56] [Netty Local Client IO #0/DEBUG] [ne.mi.fm.ne.FMLHandshakeHandler/FMLHANDSHAKE]: Starting local connection. [23:08:56] [Netty Server IO #1/DEBUG] [ne.mi.co.tr.CoreModBaseTransformer/COREMOD]: Transforming net/minecraft/network/play/client/CClientSettingsPacket [23:08:56] [Netty Server IO #1/DEBUG] [ne.mi.fm.ne.FMLHandshakeHandler/FMLHANDSHAKE]: Starting local connection. [23:08:56] [Server thread/DEBUG] [ne.mi.fm.ne.FMLHandshakeHandler/FMLHANDSHAKE]: Sending ticking packet info 'net.minecraftforge.fml.network.FMLHandshakeMessages$S2CModList' to 'fml:handshake' sequence 0 [23:08:56] [Netty Local Client IO #0/DEBUG] [ne.mi.fm.ne.FMLLoginWrapper/FMLHANDSHAKE]: Recieved login wrapper packet event for channel fml:handshake with index 0 [23:08:56] [Netty Local Client IO #0/DEBUG] [ne.mi.fm.ne.FMLHandshakeHandler/FMLHANDSHAKE]: Logging into server with mod list [minecraft, chixenlinerotmod, forge] [23:08:56] [Netty Local Client IO #0/DEBUG] [ne.mi.fm.ne.NetworkRegistry/NETREGISTRY]: Channel 'fml:loginwrapper' : Version test of 'FML2' from server : ACCEPTED [23:08:56] [Netty Local Client IO #0/DEBUG] [ne.mi.fm.ne.NetworkRegistry/NETREGISTRY]: Channel 'fml:handshake' : Version test of 'FML2' from server : ACCEPTED [23:08:56] [Netty Local Client IO #0/DEBUG] [ne.mi.fm.ne.NetworkRegistry/NETREGISTRY]: Channel 'minecraft:unregister' : Version test of 'FML2' from server : ACCEPTED [23:08:56] [Netty Local Client IO #0/DEBUG] [ne.mi.fm.ne.NetworkRegistry/NETREGISTRY]: Channel 'fml:play' : Version test of 'FML2' from server : ACCEPTED [23:08:56] [Netty Local Client IO #0/DEBUG] [ne.mi.fm.ne.NetworkRegistry/NETREGISTRY]: Channel 'minecraft:register' : Version test of 'FML2' from server : ACCEPTED [23:08:56] [Netty Local Client IO #0/DEBUG] [ne.mi.fm.ne.NetworkRegistry/NETREGISTRY]: Channel 'forge:split' : Version test of '1.0' from server : ACCEPTED [23:08:56] [Netty Local Client IO #0/DEBUG] [ne.mi.fm.ne.NetworkRegistry/NETREGISTRY]: Accepting channel list from server [23:08:56] [Netty Local Client IO #0/DEBUG] [ne.mi.fm.ne.FMLLoginWrapper/FMLHANDSHAKE]: Dispatching wrapped packet reply for channel fml:handshake with index 0 [23:08:56] [Netty Local Client IO #0/DEBUG] [ne.mi.fm.ne.FMLHandshakeHandler/FMLHANDSHAKE]: Accepted server connection [23:08:56] [Netty Server IO #1/DEBUG] [ne.mi.fm.ne.FMLLoginWrapper/FMLHANDSHAKE]: Recieved login wrapper packet event for channel fml:handshake with index 0 [23:08:56] [Netty Server IO #1/DEBUG] [ne.mi.fm.ne.FMLHandshakeHandler/FMLHANDSHAKE]: Received client indexed reply 0 of type net.minecraftforge.fml.network.FMLHandshakeMessages$C2SModListReply [23:08:56] [Netty Server IO #1/DEBUG] [ne.mi.fm.ne.FMLHandshakeHandler/FMLHANDSHAKE]: Received client connection with modlist [minecraft, chixenlinerotmod, forge] [23:08:56] [Netty Server IO #1/DEBUG] [ne.mi.fm.ne.NetworkRegistry/NETREGISTRY]: Channel 'fml:loginwrapper' : Version test of 'FML2' from client : ACCEPTED [23:08:56] [Netty Server IO #1/DEBUG] [ne.mi.fm.ne.NetworkRegistry/NETREGISTRY]: Channel 'fml:handshake' : Version test of 'FML2' from client : ACCEPTED [23:08:56] [Netty Server IO #1/DEBUG] [ne.mi.fm.ne.NetworkRegistry/NETREGISTRY]: Channel 'minecraft:unregister' : Version test of 'FML2' from client : ACCEPTED [23:08:56] [Netty Server IO #1/DEBUG] [ne.mi.fm.ne.NetworkRegistry/NETREGISTRY]: Channel 'fml:play' : Version test of 'FML2' from client : ACCEPTED [23:08:56] [Netty Server IO #1/DEBUG] [ne.mi.fm.ne.NetworkRegistry/NETREGISTRY]: Channel 'minecraft:register' : Version test of 'FML2' from client : ACCEPTED [23:08:56] [Netty Server IO #1/DEBUG] [ne.mi.fm.ne.NetworkRegistry/NETREGISTRY]: Channel 'forge:split' : Version test of '1.0' from client : ACCEPTED [23:08:56] [Netty Server IO #1/DEBUG] [ne.mi.fm.ne.NetworkRegistry/NETREGISTRY]: Accepting channel list from client [23:08:56] [Netty Server IO #1/DEBUG] [ne.mi.fm.ne.FMLHandshakeHandler/FMLHANDSHAKE]: Accepted client connection mod list [23:08:56] [Netty Local Client IO #0/DEBUG] [ne.mi.fm.ne.FMLHandshakeHandler/REGISTRIES]: Expecting 16 registries: [minecraft:recipe_serializer, minecraft:sound_event, minecraft:particle_type, minecraft:villager_profession, minecraft:item, minecraft:potion, minecraft:block_entity_type, minecraft:block, minecraft:data_serializers, minecraft:mob_effect, minecraft:stat_type, minecraft:menu, minecraft:enchantment, minecraft:motive, minecraft:fluid, minecraft:entity_type] [23:08:56] [Server thread/DEBUG] [ne.mi.fm.ne.FMLHandshakeHandler/FMLHANDSHAKE]: Sending ticking packet info 'Config forge-server.toml' to 'fml:handshake' sequence 1 [23:08:56] [Netty Local Client IO #0/DEBUG] [ne.mi.fm.ne.FMLLoginWrapper/FMLHANDSHAKE]: Recieved login wrapper packet event for channel fml:handshake with index 1 [23:08:56] [Netty Local Client IO #0/DEBUG] [ne.mi.fm.ne.FMLHandshakeHandler/FMLHANDSHAKE]: Received config sync from server [23:08:56] [Netty Local Client IO #0/DEBUG] [ne.mi.fm.ne.FMLLoginWrapper/FMLHANDSHAKE]: Dispatching wrapped packet reply for channel fml:handshake with index 1 [23:08:56] [Netty Server IO #1/DEBUG] [ne.mi.fm.ne.FMLLoginWrapper/FMLHANDSHAKE]: Recieved login wrapper packet event for channel fml:handshake with index 1 [23:08:56] [Netty Server IO #1/DEBUG] [ne.mi.fm.ne.FMLHandshakeHandler/FMLHANDSHAKE]: Received client indexed reply 1 of type net.minecraftforge.fml.network.FMLHandshakeMessages$C2SAcknowledge [23:08:56] [Netty Server IO #1/DEBUG] [ne.mi.fm.ne.FMLHandshakeHandler/FMLHANDSHAKE]: Received acknowledgement from client [23:08:56] [Server thread/DEBUG] [ne.mi.fm.ne.FMLHandshakeHandler/FMLHANDSHAKE]: Handshake complete! [23:08:56] [Netty Local Client IO #0/INFO] [ne.mi.fm.ne.NetworkHooks/]: Connected to a modded server. [23:08:56] [Server thread/INFO] [ne.mi.co.AdvancementLoadFix/]: Using new advancement loading for net.minecraft.advancements.PlayerAdvancements@245955ed [23:08:56] [Server thread/INFO] [minecraft/PlayerList]: Dev[local:E:be1d02f3] logged in with entity id 121 at (217.5, 63.0, 180.5) [23:08:56] [Server thread/INFO] [minecraft/MinecraftServer]: Dev joined the game [23:08:58] [Server thread/WARN] [minecraft/ServerPlayNetHandler]: Dev moved wrongly! [23:08:58] [Server thread/WARN] [minecraft/ServerPlayNetHandler]: Dev moved wrongly! [23:08:58] [Render thread/INFO] [minecraft/AdvancementList]: Loaded 0 advancements EDIT: I got it to work by changing the long random numbers from the lastPos initialization to null, and it worked for some reason. I suspect it had to do with lag, but I got it to work now.
  4. That is the exact problem that I am facing. I want the speed in that direction to be 0. Watch the video I sent for a visual.
  5. I'm not sure I understand what you mean, What exactly do i change? Do I set the event to PlayerTickEvent? Is the issue with the if statement? I tried changing the event to PlayerTickEvent but nothing changed. I also tried some tests to see if the game isn't recognizing the velocity changes, but the player velocity never exceeds over 0 for over a tick even though the player is clearly moving. (Im using a version that sets all horizontal velocity to 0 for bugtesting purposes)
  6. I'm trying to force the player onto one specific line along their Minecraft world by setting their velocity to always follow that line, but the player can still walk off of it with very reduced speed, but still enough to get anywhere. My code is below but it has some complicated math to set the line, so I'll also leave a simplified version of the code with the same problem below it. public class EventHandler { @SubscribeEvent public static void onMove(final LivingUpdateEvent event) { if(event.getEntity() instanceof PlayerEntity) { final double d = 1; final double cd = Math.cos(d); final double sd = Math.sin(d); final double td = event.getEntity().getDeltaMovement().x * cd + event.getEntity().getDeltaMovement().z * sd; if(event.getEntity().getDeltaMovement().z != event.getEntity().getDeltaMovement().x * Math.tan(d)) { event.getEntity().setDeltaMovement(td * cd, event.getEntity().getDeltaMovement().y, td * sd); } } } } public class EventHandler { @SubscribeEvent public static void onMove(final LivingUpdateEvent event) { if(event.getEntity() instanceof PlayerEntity) { if(event.getEntity().getDeltaMovement().x != 0) { event.getEntity().setDeltaMovement(0, event.getEntity().getDeltaMovement().y, event.getEntity().getDeltaMovement().z); } } } }
  7. bump because I really need help with this.
  8. I tried this, but now it's making me only go up a little bit, instead of the regular amount. new code below: public class EventHandler { @SubscribeEvent public static void land(final LivingFallEvent event) { if(!event.getEntity().isSuppressingBounce()) { Vector3d vel = event.getEntity().getDeltaMovement(); System.out.printf("%-11s %-11s %-11s\n", vel.x, vel.y, vel.z); if (vel.y < 0.0) { double d = event.getEntity() instanceof LivingEntity ? 1.0 : 0.8; System.out.printf("%7.3f\n",d); event.getEntity().setDeltaMovement(vel.x, -vel.y * d, vel.z); event.getEntity().hurtMarked = false; event.getEntity().hurtMarked = true; } event.setDamageMultiplier(0); vel = event.getEntity().getDeltaMovement(); System.out.printf("%-11s %-11s %-11s\n------------\n", vel.x, vel.y, vel.z); } } } here's the result after jumping a few times (and flinging myself into the air) ------------ 0.0 -1.137319364784352 0.0 1.000 0.0 1.137319364784352 0.0 ------------ 0.0 -0.9889821903010232 0.0 1.000 0.0 0.9889821903010232 0.0 ------------ 0.0 -0.0784000015258789 0.0 1.000 0.0 0.0784000015258789 0.0 ------------ 0.0 -0.4448259643949201 0.0 1.000 0.0 0.4448259643949201 0.0 ------------ 0.0 -0.1552320045166016 0.0 1.000 0.0 0.1552320045166016 0.0 ------------ 0.0 -0.16123445549844412 0.0 1.000 0.0 0.16123445549844412 0.0 ------------ 0.0 -0.0784000015258789 0.0 1.000 0.0 0.0784000015258789 0.0 ------------ It also seems like sometimes it's bouncing me multiple times but still not the normal amount. EDIT: I should clarify that this is very close to the vanilla minecraft code of the bounceUp() method of the SlimeBlock class. private void bounceUp(Entity entity) { Vec3 vec3 = entity.getDeltaMovement(); if (vec3.y < 0.0) { double d = entity instanceof LivingEntity ? 1.0 : 0.8; entity.setDeltaMovement(vec3.x, -vec3.y * d, vec3.z); } }
  9. I've been looking at this for a while and still can't get a fix for it? can someone help me on the right track?
  10. public class EventHandler { @SubscribeEvent public static void land(final LivingFallEvent event) { if(!event.getEntity().isSuppressingBounce()) { event.getEntity().setDeltaMovement(event.getEntity().getDeltaMovement().multiply(0.0, -1.0, 0.0)); event.setDamageMultiplier(0); } } } Here's my code, but It's not doing anything.
  11. I'm trying to set the player y velocity to 1 whenever the player hits the ground, but for some reason it's only working when the player takes damage. Anyone know how to combat this? I did some debug testing and found out that the LivingFallEvent is activating twice or more when I hit the ground, for some reason.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.