Jump to content

[1.10.2] Wildly differing performance on comparable machines (possible AMD GPU issue?)


Recommended Posts

Posted

Hello, I've recently launched a private modded server for myself and a few friends to play on. I've got quite a bit of experience running heavily modded servers for friends, but this is my first foray into 1.10, and one friend is experiencing extremely low FPS; about 2-4 frames in game, which is obviously unplayable. Meanwhile, myself and two others can play at a near constant 60 fps with vsync. It seems improbably that, with his specs, we would see such a huge difference in performance, so I'm wondering if the issue may be that he's on an AMD card, which have been known to have issues with minecraft and/openGL in recent years. If so, I'm hoping there's a fix.

 

We are in fact playing on a HEAVILY modded server. Forge shows 352 mods loaded, which I know is on the very extreme end of things, but it's very much playable on my end, and with the machines we're all running, there shouldn't be such a massive difference in performance.

 

My system:

 

Intel Core i7-4790k @ 4.0 GHz

16.0 GB DDR3 RAM

Nvidia GeForce GTX 970

 

In-game 60 fps with vsync.

 

Friend's system:

 

Intel Core i3-4360 @ 3.70GHz

16.0 GB DDR3 RAM

AMD Radeon RX 470

 

In-game 2-4 fps with all settings minimum.

 

It seems likely to me that perhaps the GPU is not properly kicking in for minecraft, in this case. That's kind of a shot in the dark, but I've heard of similar issues. It seems unlikely that him running a same-gen i3 (as opposed to i7) would be the issue, since Minecraft hardly utilizes multiple cores anyway. It also shows his CPU and GPU utilization are extremely low when he runs the game, so something is up. We've checked that he's running 64 bit Java. We've checked his memory allocation. All are what they should be. We've also tried both with an without Optifine and BetterFPS to no avail, so I'm at a loss. He should definitely be able to get a playable 30 fps at the very least, on a system that has and can run Witcher 3 at max settings, 1920x1080 at 60fps.

 

A few notes:

We're running forge 1.10.2-12.18.3.2281

We're using MultiMC to run the mod pack, if that's important.

I'd post his latest fml client log, but there's no indication of anything hampering performance from what I can see. The file is 11 MB as well, so it's a pain. I can post it if need be.

I know full well we have more mods than would usually be considered reasonable. If it really is just that his system is running to its fullest potential and that we need to slim down, then I'll do so. I suspect that's not the case.

 

I've scoured the internet for similar issues, and only seen a few posts on various other forums, all unsolved. Additionally, I've seen "benchmark" type videos of people running the same hardware getting hundreds of frames with shaders, etc. I'm at a bit of a loss what his machine might be doing. I'm just hoping there's someone out there who's solved a similar issue before that might point us in the right direction. Thanks in advance!

 

List of mods loaded:

Spoiler

ModListGenerator Version1.0
Tue Apr 25 23:36:42 CST 2017
354 mods loaded.
ModID, ModName, Version
mcp, Minecraft Coder Pack, 9.19
FML, Forge Mod Loader, 8.0.99.99
Forge, Minecraft Forge, 12.18.3.2281
AdvancedRocketryCore, Advanced Rocketry, 1
appliedenergistics2-core, Applied Energistics 2 Core, rv4-alpha-11
creativecoredummy, CreativeCoreDummy, 1.0.0
NotEnoughItems, Not Enough Items, 2.1.3.206
OpenComputers|Core, OpenComputers (Core), 1.6.2.7
BetterFonts, BetterFonts, 1.5.2
<CoFH ASM>, CoFH ASM, 000
foamfixcore, FoamFixCore, 7.7.4
ccl-entityhook, ccl-entityhook, 1.0
movillages, Mo' Villages, 1.5.2
JEI, Just Enough Items, 3.14.7.417
abyssalcraft, AbyssalCraft, 1.9.4-pre-2
cofhcore, CoFH Core, 4.1.1
actuallyadditions, Actually Additions, 1.10.2-r105
additionalbanners, Additional Banners, 1.3.0.22
IC2, IndustrialCraft 2, 2.6.188-ex110
advanced_machines, Advanced Machines, 60.0.2
advancedcables, Advanced Cables, 2.1.0
aim, Advanced Inventory Managment, 1.2.0
libVulpes, libVulpes, 0.1.18.
advancedRocketry, Advanced Rocketry, 1.0.17
appliedenergistics2, Applied Energistics 2, rv4-alpha-11
bdlib, BD Lib, 1.12.4.24
ae2stuff, AE2 Stuff, 0.6.0.9
aether_legacy, Aether Legacy, v1.3.1-1.10.2
infinitylib, InfinityLib, 1.10.2-0.8.0
agricraft, AgriCraft, 2.0.0-0.8.0-a15
Baubles, Baubles, 1.3.8
extrautils2, Extra Utilities 2, 1.0
flyringbaublemod, AngelRing 2 Bauble, 0.2.3_1.10.2-d3100bf
guideapi, Guide-API, @VERSION@
BloodMagic, Blood Magic: Alchemical Wizardry, 1.10.2-2.1.9-78
Animus, Animus, 1
appleskin, AppleSkin, 1.0.5
aquacreeper, aquacreeper, 1.2.1
architecturecraft, ArchitectureCraft, 1.7.1
mantle, Mantle, 1.10.2-1.1.4.203
tconstruct, Tinkers' Construct, 1.10.2-2.6.3.500
tesla, TESLA, 1.2.1.50
thedragonlib, TheDragonLib, 1.10.2-1.3.1
armorplus, ArmorPlus, 1.10.2-8.5.4.5
arsmagica2, Ars Magica 2, 1.5.018
AnimationAPI, AnimationAPI, 1.2.4
astralsorcery, Astral Sorcery, 1.3.2-beta
atlcraft, ATLCraft Candles Mod, 1.10.2-Ver1.5
CD4017BE_lib, CD4017BE_lib, 4.4.3
Circuits, Automated Redstone, 4.4.1
Psi, Psi, r1.0-42
Quark, Quark, r1.1-70
AutoRegLib, AutoRegLib, 1.0-2
SimpleAutoRun, SimpleAutoRun, 1.8-1.1
Avaritia, Avaritia, 1.10.2-2.0.7
avaritiaadditions, Avaritia Additions, 1.6
baconators, Baconators, 3.0.6
mcmultipart, MCMultiPart, 2.0.0_88
bagelsmore, Bagelsmore: The Return, 1.0.1
bagginses, Bagginses, 2.4.2d
MineTweaker3, MineTweaker 3, 3.0.17
base, B.A.S.E, 1.10.2-1.3.0
betterbuilderswands, Better Builder's Wands, 0.11.1
betterthanmending, Better Than Mending, @VERSION@
BiblioCraft, BiblioCraft, 2.2.1
malisiscore, MalisisCore, 1.10.2-4.2.10
malisisdoors, MalisisDoors, 1.10.2-5.1.8
bigdoors, Big Doors, 1.10.2-1.3.0
hammercore, Hammer Core, 1.4.8
biomepainttools, Biome Paint Tools, 1.0.3
BiomeTweaker, BiomeTweaker, 2.1.230
BiomesOPlenty, Biomes O' Plenty, 5.0.0.2162
blocklings, WillR27's Blocklings, 4.1.5
blocksplus, Blocks Plus, 1.10.2-3.0.0-rc2
BloodArsenal, Blood Arsenal, 1.10.2-2.0.1-17
bookshelf, Bookshelf, 1.4.4.347
Botania, Botania, r1.9-341
BotaniaVisualizer, BotaniaVisualizer, 1.10.2-1.0
CodeChickenLib, CodeChicken Lib, 2.5.8.255
brandonscore, Brandon's Core, 2.1.6
BuildersGuides, Builder's Guides, 1.10.2-1.0.2
sonarcore, SonarCore, 3.2.7
calculator, Calculator, 3.2.2
cannibalism, Cannibalism, 3.1.0
cfm, MrCrayfish's Furniture Mod, 4.1.2
Chameleon, Chameleon, 1.10-2.2.2
CharsetLib, ‽, 0.3.0-pre15
CharsetAudio, ♫, 0.3.0-pre15
CharsetCarts, U, 0.3.0-pre15
CharsetDecoration, ⚿, 0.3.0-pre15
CharsetDrama, !, 0.3.0-pre15
CharsetFarming, ;, 0.3.0-pre15
CharsetGates, &, 0.3.0-pre15
CharsetPipes, |, 0.3.0-pre15
CharsetStorage, #, 0.3.0-pre15
CharsetTweaks, *, 0.3.0-pre15
CharsetWires, +, 0.3.0-pre15
CharsetWrench, /, 0.3.0-pre15
ChestTransporter, Chest Transporter, 2.5.14
chickens, Chickens, 4.3.2
chisel, Chisel, MC1.10.2-0.0.10.22
chiselsandbits, Chisels & Bits, 12.12
ChiselsBytes, Chisels & Bytes, 0.4
clumps, Clumps, 1.0.5
cm2, Compact Machines 2, 1.0
CodeChickenCore, CodeChicken Core, 2.4.0.101
cyclopscore, Cyclops Core, 0.10.0
colossalchests, Colossal Chests, 1.5.0
compactsolars, Compact Solar Arrays, 1.10.2-5.0.8.331
one_point_twelve_concrete, 1.12 Concrete, v 1.0
controlling, Controlling, 1.0.3
cookingforblockheads, Cooking for Blockheads, 4.2.35
coroutil, CoroUtil Library, 1.10.2-1.1.14
extendedrenderer, Extended Renderer, v1.0
configmod, Extended Mod Config, v1.0
cosmeticarmorreworked, CosmeticArmorReworked, 1.10.2-v2a
counter_guns, Counter Guns, 1.0.1
covers, Simple Covers, 0.4.1.16
ctgui, CT-GUI, 1.0.0
creativecore, CreativeCore, 1.5.0
creeperconfetti, Creeper Confetti, 1.3
ctdcore, CTD Core, 1.0.3
moglowstone, Mo' Glowstone, 1.2.4
ctdpaint, CTD Paint, 1.1.5
cyberware, Cyberware, beta-0.2.7
cyclicmagic, Cyclic, 1.10.20
dailies, Bailey's Dailies, 1.10.2-6
darkutils, Dark Utilities, 1.1.7.120
debris, Debris, 1.10.2-1.0.1.0
PTRModelLib, PTRModelLib, 1.0.0
props, Decocraft, 2.4.1
forestry, Forestry, 5.2.17.374
eleccore, ElecCore, 1.6.345
EnderStorage, EnderStorage, 2.2.1.106
OpenComputers, OpenComputers, 1.6.2.7
deepresonance, DeepResonance, 1.4.6
dirt2path, Dirt2Path, 1.6.1
draconicevolution, Draconic Evolution, 2.0.10
dragonrealm, DragonRealm, 2.0.1
StorageDrawers, Storage Drawers, 1.10.2-3.6.2
bitdrawers, Drawers & Bits, 0.36
dsurround, dzDynamic Surroundings, 3.3.6.1
earthworks, Earthworks, 1.2.1
endercore, EnderCore, 1.10.2-0.4.1.65-beta
EnderIO, Ender IO, 1.10.2-3.1.183
thermalfoundation, Thermal Foundation, 2.0.5
thermalexpansion, Thermal Expansion, 5.0.4
eiorteis, EIORecipesTEInductionSmelter, 1.10.2-2.1
elevatorid, Elevator Mod, 1.3.0
embers, Embers, 0.104
eplus, Enchanting Plus, 4.1.0.117
enderore, Ender Ore, 1.0
endercompass, Ender Compass, 1.2.3.2
enderutilities, Ender Utilities, 0.6.7
EnderZoo, Ender Zoo, 1.10-1.2.3.44
engineersworkshop, Engineer's Workshop, 1.2.1-1.10.2
valkyrielib, Valkyrie Lib, 1.10.2-0.10.6
environmentaltech, Environmental Tech, 1.10.2-0.10.6b
etlunar, ET Lunar, 1.10.2-0.10.6a
ExtraBitManipulation, Extra Bit Manipulation, 1.10.2-2.3.4
extrablocks, ExtraBlocks, 1.0.2
golems, Extra Golems, 6.02
shadowmc, ShadowMC, 3.6.1
ExtraRails, Extra Rails, 1.1.1
zerocore, Zero CORE, 1.10.2-0.1.0.5
bigreactors, Extreme Reactors, 1.10.2-0.4.5.28
fairylights, Fairy Lights, 2.1.1
ffs, Fancy Fluid Storage, 1.10.2-2.0.3-b11
fastleafdecay, Fast Leaf Decay, v11
immersiveengineering, Immersive Engineering, 0.10-54
harvestfestival, Harvest Festival, 0.5.27
harvestcraft, Pam's HarvestCraft, 1.9.4-1.10.2g
hfaddon, HF Addon, 0.5.5 Alpha
flatcoloredblocks, Flat Colored Blocks, mc1.10-v4.4
FloodLights, Flood Lights, 1.2.7-145
fluxnetworks, FluxNetworks, 1.2.3
foamfix, FoamFix, @VERSION@
ftbl, FTBLib, 0.0.0
ftbu, FTBUtilities, 0.0.0
limelib, LimeLib, 1.5.3
furnus, Furnus, 1.92
gendustry, GenDustry, 1.6.5.30
harvestchevsky, Gentle Harvest, b8
geographicraft, GeographiCraft, 0.8.7
gravestone, Gravestone, 1.5.10
ichunutil, iChunUtil, 6.3.2
gravitygun, GravityGun, 6.0.1
refinedstorage, Refined Storage, 1.2.25
growablecells, Growable Cells, 1.0.1
hatchery, Hatchery, 0.2.10
helpertools, HelperTools, v4.1
incense, Incense, 0.1
industrialwires, Industrial Wires, 1.3-7
InventoryPets, Inventory Pets, 1.4.9.4
inventorytweaks, Inventory Tweaks, 1.61-58-a1fd884
ironbackpacks, Iron Backpacks, 1.10.2-2.2.25
ironchest, Iron Chest, 1.10.2-7.0.11.797
itemscroller, Item Scroller, 0.8.0
jeibees, JEI Bees, 0.9.0.4
journeymap, JourneyMap, 1.10.2-5.4.6
buildingblocks, Just Build It, 1.2
jeresources, Just Enough Resources, 0.5.8.98
kleeslabs, KleeSlabs, 3.3.5
kc, Knob Control, 2.0.8
koresample, Kore Sample, 1.10.2-L1
livingfish, Living Fish, V3
llibrary, LLibrary, 1.7.4
login_shield, Login Shield, 1.10.2-19-gd16e7e0
boots, Long Fall Boots, 1.0
LunatriusCore, LunatriusCore, 1.1.2.38
magma_monsters, magma_monsters, 0.1.15
malisisblocks, Malisis Blocks, 1.10.2-4.1.3
materialfoundation, Material Foundation, 1.10.2-2.0.2
Mekanism, Mekanism, 9.2.1
MekanismGenerators, MekanismGenerators, 9.2.1
MekanismTools, MekanismTools, 9.2.1
teslacorelib, Tesla Core Lib, 0.7.0
mekfarm, MekFarm, 0.0.1
minecolonies, MineColonies, 1.10.2-0.6.112
mfs, Minecraft Flight Simulator, 7.1.2
missing_pieces, Missing Pieces, 4.1.1
testdummy, MmmMmmMmmMmm, 1.11
muchmorespiders, Much More Spiders V2, 0.7
natura, Natura, 1.10.2-4.1.0.53
railcraft, Railcraft, 10.1.1
randomthings, Random Things, 3.7.7.1
roots, Roots 2, 0.015
reborncore, RebornCore, 2.13.5.136
techreborn, TechReborn, 2.1.12.215
theoneprobe, The One Probe, 1.4.6
moarsigns, MoarSigns, 4.2.2.8
cancerplants, Mob Farm, dank01
mob_grinding_utils, mob_grinding_utils, 0.1.8.17
moboptions, MobOptions, 1.0
ModListGenerator, ModListGenerator, 1.0
ModNameTooltip, Mod Name Tooltip, 1.6.0
modularrouters, Modular Routers, 1.10.2-1.3.1
numina, numina, 1.4.0
powersuits, MachineMuse's Modular Powersuits, 1.10.2-1.2.111
morebees, More Bees, 1.10.2-1.3.1
morechickens, More Chickens, 1.0.11
morematerials, More Materials, 1.10.2-1.9.20160723.0
moreoverlays, MoreOverlays, 1.11
Morpheus, Morpheus, 1.10.2-3.1.13
mousetweaks, Mouse Tweaks, 2.6.4
mowziesmobs, Mowzie's Mobs, 1.3.1
multifarmcrops, Multifarm Crops, 1.1.0
shetiphiancore, ShetiPhian-Core, 3.3.8
multistorage, Multi-Storage, 1.2.12
mw, Modern Warfare, 1.9.1
mxtune, mxTune, 0.4.0-dev.23
MysteriousMiscellany, Mysterious Miscellany, 1.10.2-1.5.4
mysticalagriculture, Mystical Agriculture, 1.5.1
mysticalagradditions, Mystical Agradditions, 1.0.1
netheressence, Nether Essence, 7.1.0
netherportalfix, Nether Portal Fix, 1.0
nabb, New Age Bee Breeding, 1.0.0
nice, Nice, 0.1.0
recipehandler, NoMoreRecipeConflict, 0.6
neid, NotEnoughIDs, 1.5.3
notenoughwands, Not Enough Wands, 1.4.0
omlib, OMLib, 1.10.2-3.0.0-61
opframe, OnlinePictureFrame, 0.1
openglider, Open Glider, @VERSION@
openmodularturrets, Open Modular Turrets, 1.10.2-3.0.0-108
orespawn, Ore Spawn, 1.1.0
overlord, Overlord, 2.3.3
p455w0rdslib, p455w0rd's Library, 1.0.12
placeableitems, Placeable Items Mod, 3.0.4
plants, Plants, 0.8.5
platforms, Platforms, 1.2.10
substratum, Substratum, 1.8.2.1
plustic, PlusTiC, 4.3.0.3
portalgun, PortalGun, 6.0.1
practicallogistics2, Practical Logistics 2, 2.0.2
progressiveautomation, Progressive Automation, 1.7.4
psionup, PSIonic Upgrades, 15.1
quantumstorage, QuantumStorage, 3.3.2
rccosmetic, Railcraft Cosmetic Additions, 3.0.5
rangedpumps, Ranged Pumps, 0.3
realfilingcabinet, Real Filing Cabinet, 1.3.71
reborncore-mcmultipart, reborncore-MCMultiPart, 2.13.5.136
rebornstorage, RebornStorage, 1.0.0
redstonearsenal, Redstone Arsenal, 2.0.3
xreliquary, Reliquary, 1.10.2-1.3.3.659
rftl, Rotten Flesh to Leather, 1.0
rftools, RFTools, 6.00
rftoolscontrol, RFTools Control, 1.6.6
rftoolsdim, RFTools Dimensions, 4.55
rockhounding_rocks, Rockhounding: Rocks, v1.01
rockhounding_surface, Rockhounding: Surface, v1.10
roguelike, Roguelike Dungeons, 1.5.9
ropebridge, Rope Bridge, 1.10.2-2.1.0
roughMobs, Rough Mobs, 1.0
RTG, Realistic Terrain Generation, 4.1.2.4
SafeStones, SafeStones, 1.10.2-1.0a
sanguimancy, Sanguimancy, 1.10.2-2.0.2
sanlib, SanAndreasPs Mod Library, 1.0.1
sanplayermodel, SanAndreasPs Player Model, 1.0.0
santasdecor, Santa's Decor, 2.0.0
shearmadness, Shear Madness, 1.10.2
shootit, ShootIt, v0.3
silentboss, SilentBoss, 1.3.0
SimilsaxTranstructors, Similsax Transtructors, 1.10.2.18
simplebarrels, Simple Barrels, 1.25h
simplecobblegen, Simple Cobble Generator, 1.10.2 : 1.0.1
simplegenerators, Simple Generators, 1.10.2-0.10.6a
simpleretrogen, Simple Retrogen, 4.0.1+8
simplyconveyors, Simply Conveyors & More, 3.0.3
simplyjetpacks, Simply Jetpacks 2, 2.1.1.47
SleepingBag, Sleeping Bag, 1.4.0
solarfluxreborn, Solar Flux Reborn, 2.16r
soulshardstow, Soul Shards - The Old Ways, 1.10.2-2.6.7-48
soundfilters, Sound Filters, 0.9_for_1.9
Stackie, Stackie, 1.6.0.44
stevescarts, Steve's Carts 2, 2.1.4.83
storagedrawersextra, Storage Drawers Extras, 1.10-1.1.0
terrainCrystals, Terrain Crystals, 1.2.3
terrainCrystalsAddons, Terrain Crystals Addons, 1.1.1
TickProfiler, TickProfiler, 1.10.2.jenkins.27
tinker_io, Tinker I/O, release 2.4.3
TinkersAddons, Tinkers' Addons, 1.0.5
golems_tcon, Tinkers' Golems Addon, 6.02.1
tinkertoolleveling, Tinkers Tool Leveling, 1.10.2-1.0.1.DEV.f5def58
toolbelt, Tool Belt, 1.5.0
topaddons, TOP Addons, 1.10.2-0.10.0
torchmaster, TorchMaster, 1.0
totemic, Totemic, 1.10.2-0.8.3
sapturretmod, Turret Mod Rebirth, 4.0.0-beta.1.1
uncrafted, Uncrafted Mod, 2.1.3b
UndergroundOcean, Underground Ocean, ${version}
Unifier, Unifier, 2.0.1
usefulnullifiers, Useful Nullifiers, 1.3.4
VeinMiner, Vein Miner, 0.35.3_1.9-a46c1b0
VeinMinerModSupport, Mod Support, 0.35.3_1.9-a46c1b0
veinminermodintegration, Veinminer Mod Integration, 1.7.10-0.2.0
vc, ViesCraft, 4.27.21
villagebox, Village Box, 0.6.0
VillageNames, Village Names, 1.10.2-1.0
wallpapercraft, WallpaperCraft, 1.10.2
waystones, Waystones, 2.0.11
weaponcaseloot, WeaponCaseLoot, 4.0.3
wearables, Wearables, 1.0.2
weirdinggadget, The Weirding Gadget, 1.0
wired, WIRED: More Augs, 1.6.2
wcg, Wireless Crafting Grid, 1.0.0
wct, Wireless Crafting Terminal 2, 0.1.30
wmatm, WMATM Vehicles, 1.10.X-1.1.5.2
Woot, Woot, 1.10.2-1.4.0
xnet, XNet, 1.3.1
xtones, Xtones, 1.10.2-1.0.1-3
fluidity, Fluidity, 6.1.4
moofluids, Moo Fluids, 1.10.2-1.7.02.12b
BiomeTweakerCore, BiomeTweaker Core, 2.1.230

 

Posted

There isn't much we can do, with that load of mods it could be anything.He'll have to start tracking down which mod is causing issues.

Create a world that has issues, and start deleting mods till it goes way.

As for AMD, there shouldn't be any issues from Forge on AMDs, as I usually run on AMD.

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Consider supporting the team on Patreon

Posted (edited)

Turns out it's nothing to do with his GPU. GPU-Z puts usage at 80-90%. I've noticed he's allocated 12GB ram to Minecraft, but Minecraft/java refuses to use more than ~4.5 GB of it, no matter what. His f3 screen is showing Mem: 38% 4180/10923MB, with still a constant 2 fps, and 0 chunk updates in singleplayer. This definitely tells me his ram is bottlenecking, but I have no idea why. His windows resource monitor is also showing the proper allocation, with plenty to spare for system processes, etc.

 

Before anyone cries out: "DON'T allocate that much to Minecraft! It just bogs down your system!" In this case, with this many mods, it's necessary. And like I said, myself and others can run this setup without an issue, with the same ram in our machines.

 

Is there anything known to prevent minecraft/java from using the full amount of ram it's been allotted?

Edited by HappyBivouac
Posted

Hm... I had a similiar problem with FTB in 1.7.10. On my side the problem was caused by the Windows 10 Anniversary Update.

I don't know what exaclty went wrong, but after the update I had such problems like you describe above. After a clean install of Windows 10 [again]

(still the same Update etc., as I made the clean install shortly after the update) it worked again.

 

So it could be that Windows did something wrong there.

 

A friend of me had also similiar problems: We fixed it with updating his out of date drivers (CPU and GPU drivers).

Developer of Primeval Forest.

Posted

There's always SHIFT + F3 to show the pie chart to get a general idea of what is causing the performance issues. I was getting about 5 to 10 fps on my HD 7790 and ended up having to set mipmapLevels to 0. 

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Version 1.19 - Forge 41.0.63 I want to create a wolf entity that I can ride, so far it seems to be working, but the problem is that when I get on the wolf, I can’t control it. I then discovered that the issue is that the server doesn’t detect that I’m riding the wolf, so I’m struggling with synchronization. However, it seems to not be working properly. As I understand it, the server receives the packet but doesn’t register it correctly. I’m a bit new to Java, and I’ll try to provide all the relevant code and prints *The comments and prints are translated by chatgpt since they were originally in Spanish* Thank you very much in advance No player is mounted, or the passenger is not a player. No player is mounted, or the passenger is not a player. No player is mounted, or the passenger is not a player. No player is mounted, or the passenger is not a player. No player is mounted, or the passenger is not a player. MountableWolfEntity package com.vals.valscraft.entity; import com.vals.valscraft.network.MountSyncPacket; import com.vals.valscraft.network.NetworkHandler; import net.minecraft.client.Minecraft; import net.minecraft.network.syncher.EntityDataAccessor; import net.minecraft.network.syncher.EntityDataSerializers; import net.minecraft.network.syncher.SynchedEntityData; import net.minecraft.server.MinecraftServer; import net.minecraft.server.level.ServerPlayer; import net.minecraft.world.entity.EntityType; import net.minecraft.world.entity.Mob; import net.minecraft.world.entity.ai.attributes.AttributeSupplier; import net.minecraft.world.entity.ai.attributes.Attributes; import net.minecraft.world.entity.animal.Wolf; import net.minecraft.world.entity.player.Player; import net.minecraft.world.entity.Entity; import net.minecraft.world.InteractionHand; import net.minecraft.world.InteractionResult; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.Items; import net.minecraft.world.level.Level; import net.minecraft.world.phys.Vec3; import net.minecraftforge.event.TickEvent; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.network.PacketDistributor; public class MountableWolfEntity extends Wolf { private boolean hasSaddle; private static final EntityDataAccessor<Byte> DATA_ID_FLAGS = SynchedEntityData.defineId(MountableWolfEntity.class, EntityDataSerializers.BYTE); public MountableWolfEntity(EntityType<? extends Wolf> type, Level level) { super(type, level); this.hasSaddle = false; } @Override protected void defineSynchedData() { super.defineSynchedData(); this.entityData.define(DATA_ID_FLAGS, (byte)0); } public static AttributeSupplier.Builder createAttributes() { return Wolf.createAttributes() .add(Attributes.MAX_HEALTH, 20.0) .add(Attributes.MOVEMENT_SPEED, 0.3); } @Override public InteractionResult mobInteract(Player player, InteractionHand hand) { ItemStack itemstack = player.getItemInHand(hand); if (itemstack.getItem() == Items.SADDLE && !this.hasSaddle()) { if (!player.isCreative()) { itemstack.shrink(1); } this.setSaddle(true); return InteractionResult.SUCCESS; } else if (!level.isClientSide && this.hasSaddle()) { player.startRiding(this); MountSyncPacket packet = new MountSyncPacket(true); // 'true' means the player is mounted NetworkHandler.CHANNEL.sendToServer(packet); // Ensure the server handles the packet return InteractionResult.SUCCESS; } return InteractionResult.PASS; } @Override public void travel(Vec3 travelVector) { if (this.isVehicle() && this.getControllingPassenger() instanceof Player) { System.out.println("The wolf has a passenger."); System.out.println("The passenger is a player."); Player player = (Player) this.getControllingPassenger(); // Ensure the player is the controller this.setYRot(player.getYRot()); this.yRotO = this.getYRot(); this.setXRot(player.getXRot() * 0.5F); this.setRot(this.getYRot(), this.getXRot()); this.yBodyRot = this.getYRot(); this.yHeadRot = this.yBodyRot; float forward = player.zza; float strafe = player.xxa; if (forward <= 0.0F) { forward *= 0.25F; } this.flyingSpeed = this.getSpeed() * 0.1F; this.setSpeed((float) this.getAttributeValue(Attributes.MOVEMENT_SPEED) * 1.5F); this.setDeltaMovement(new Vec3(strafe, travelVector.y, forward).scale(this.getSpeed())); this.calculateEntityAnimation(this, false); } else { // The wolf does not have a passenger or the passenger is not a player System.out.println("No player is mounted, or the passenger is not a player."); super.travel(travelVector); } } public boolean hasSaddle() { return this.hasSaddle; } public void setSaddle(boolean hasSaddle) { this.hasSaddle = hasSaddle; } @Override protected void dropEquipment() { super.dropEquipment(); if (this.hasSaddle()) { this.spawnAtLocation(Items.SADDLE); this.setSaddle(false); } } @SubscribeEvent public static void onServerTick(TickEvent.ServerTickEvent event) { if (event.phase == TickEvent.Phase.START) { MinecraftServer server = net.minecraftforge.server.ServerLifecycleHooks.getCurrentServer(); if (server != null) { for (ServerPlayer player : server.getPlayerList().getPlayers()) { if (player.isPassenger() && player.getVehicle() instanceof MountableWolfEntity) { MountableWolfEntity wolf = (MountableWolfEntity) player.getVehicle(); System.out.println("Tick: " + player.getName().getString() + " is correctly mounted on " + wolf); } } } } } private boolean lastMountedState = false; @Override public void tick() { super.tick(); if (!this.level.isClientSide) { // Only on the server boolean isMounted = this.isVehicle() && this.getControllingPassenger() instanceof Player; // Only print if the state changed if (isMounted != lastMountedState) { if (isMounted) { Player player = (Player) this.getControllingPassenger(); // Verify the passenger is a player System.out.println("Server: Player " + player.getName().getString() + " is now mounted."); } else { System.out.println("Server: The wolf no longer has a passenger."); } lastMountedState = isMounted; } } } @Override public void addPassenger(Entity passenger) { super.addPassenger(passenger); if (passenger instanceof Player) { Player player = (Player) passenger; if (!this.level.isClientSide && player instanceof ServerPlayer) { // Send the packet to the server to indicate the player is mounted NetworkHandler.CHANNEL.send(PacketDistributor.PLAYER.with(() -> (ServerPlayer) player), new MountSyncPacket(true)); } } } @Override public void removePassenger(Entity passenger) { super.removePassenger(passenger); if (passenger instanceof Player) { Player player = (Player) passenger; if (!this.level.isClientSide && player instanceof ServerPlayer) { // Send the packet to the server to indicate the player is no longer mounted NetworkHandler.CHANNEL.send(PacketDistributor.PLAYER.with(() -> (ServerPlayer) player), new MountSyncPacket(false)); } } } @Override public boolean isControlledByLocalInstance() { Entity entity = this.getControllingPassenger(); return entity instanceof Player; } @Override public void positionRider(Entity passenger) { if (this.hasPassenger(passenger)) { double xOffset = Math.cos(Math.toRadians(this.getYRot() + 90)) * 0.4; double zOffset = Math.sin(Math.toRadians(this.getYRot() + 90)) * 0.4; passenger.setPos(this.getX() + xOffset, this.getY() + this.getPassengersRidingOffset() + passenger.getMyRidingOffset(), this.getZ() + zOffset); } } } MountSyncPacket package com.vals.valscraft.network; import com.vals.valscraft.entity.MountableWolfEntity; import net.minecraft.network.FriendlyByteBuf; import net.minecraft.server.level.ServerLevel; import net.minecraft.server.level.ServerPlayer; import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.player.Player; import net.minecraftforge.network.NetworkEvent; import java.util.function.Supplier; public class MountSyncPacket { private final boolean isMounted; public MountSyncPacket(boolean isMounted) { this.isMounted = isMounted; } public void encode(FriendlyByteBuf buffer) { buffer.writeBoolean(isMounted); } public static MountSyncPacket decode(FriendlyByteBuf buffer) { return new MountSyncPacket(buffer.readBoolean()); } public void handle(NetworkEvent.Context context) { context.enqueueWork(() -> { ServerPlayer player = context.getSender(); // Get the player from the context if (player != null) { // Verifies if the player has dismounted if (!isMounted) { Entity vehicle = player.getVehicle(); if (vehicle instanceof MountableWolfEntity wolf) { // Logic to remove the player as a passenger wolf.removePassenger(player); System.out.println("Server: Player " + player.getName().getString() + " is no longer mounted."); } } } }); context.setPacketHandled(true); // Marks the packet as handled } } networkHandler package com.vals.valscraft.network; import com.vals.valscraft.valscraft; import net.minecraft.resources.ResourceLocation; import net.minecraftforge.network.NetworkRegistry; import net.minecraftforge.network.simple.SimpleChannel; import net.minecraftforge.network.NetworkEvent; import java.util.function.Supplier; public class NetworkHandler { private static final String PROTOCOL_VERSION = "1"; public static final SimpleChannel CHANNEL = NetworkRegistry.newSimpleChannel( new ResourceLocation(valscraft.MODID, "main"), () -> PROTOCOL_VERSION, PROTOCOL_VERSION::equals, PROTOCOL_VERSION::equals ); public static void init() { int packetId = 0; // Register the mount synchronization packet CHANNEL.registerMessage( packetId++, MountSyncPacket.class, MountSyncPacket::encode, MountSyncPacket::decode, (msg, context) -> msg.handle(context.get()) // Get the context with context.get() ); } }  
    • Do you use features of inventory profiles next (ipnext) or is there a change without it?
    • Remove rubidium - you are already using embeddium, which is a fork of rubidium
  • Topics

×
×
  • Create New...

Important Information

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