Code Monkey home page Code Monkey logo

demagnetize's Introduction

Demagnetize Demagnetize CurseForge Badge

This is the 1.16 branch, see the 1.12 version here!

Item magnets are very helpful when mining, however they can disrupt item-based automation, such as the Atomic Reconstructor from Actually Additions. The Demagnetizer is a solution to this, which prevents item magnets from functioning within an area around them.

Demagnetizers can also be filtered or redstone controlled, so that they only activate when necessary. The Advanced Demagnetizer has a larger range and more filter slots.

Demagnetizer demo gif

For mod developers:

If your mod has an Item Magnet, do not pick up items if the PreventRemoteMovement NBT tag exists on the EntityItem. If your mod has a item collector block (e.g. the Ranged Collector or the Vacuum Chest), do not pick up items if the PreventRemoteMovement NBT tag exists on the EntityItem, but if the AllowMachineRemoteMovement NBT tag exists, ignore the previous NBT tag. This is to ensure that Item Magnets do not pick up items on conveyors or demagnetized items, while also ensuring that item collector blocks are not restricted by the Demagnetizer.

For more information, see this github issue.

demagnetize's People

Contributors

blueagent avatar comp500 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

demagnetize's Issues

[1.12.2] Demagnetizers stop working and reset their filters on world load

Most of my demagnetizers, but not all of them, stop working the next time I enter my world after leaving it. They have to be broken and re-placed. The filters reset as well. Similar to #14 but also resets the filter, happens in 1.12.2, and occurs with the regular demagnetizer, not just the advanced one.

A bunch of errors relating to Demagnetize also appear in the log, which is most likely related.

Versions

Error loading on dedicated server

Trying to load the mod on a dedicated server results in a crash because it tries to load a client only class.

[19Oct2019 10:50:27.601] [Server thread/FATAL] [net.minecraftforge.fml.ModLoader/LOADING]: Failed to complete lifecycle event CONSTRUCT, 1 errors found
[19Oct2019 10:50:27.602] [Server thread/ERROR] [net.minecraft.server.MinecraftServer/]: Encountered an unexpected exception
net.minecraftforge.fml.LoadingFailedException: Loading errors encountered: [
	Demagnetize (demagnetize) has failed to load correctly
§7Attempted to load class net/minecraft/client/world/ClientWorld for invalid dist DEDICATED_SERVER
]
	at net.minecraftforge.fml.ModLoader.dispatchAndHandleError(ModLoader.java:199) ~[?:?]
	at net.minecraftforge.fml.ModLoader.gatherAndInitializeMods(ModLoader.java:181) ~[?:?]
	at net.minecraftforge.fml.server.ServerModLoader.begin(ServerModLoader.java:45) ~[?:?]
	at net.minecraft.server.dedicated.DedicatedServer.func_71197_b(DedicatedServer.java:121) ~[?:?]
	at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:598) [?:?]
	at java.lang.Thread.run(Unknown Source) [?:1.8.0_201]

Forge version: 1.14.4-28.1.61
Demagnetize version: 1.14.4-1.2.0

Crash log
Debug log

Check whitelist/blacklist properly on clientside

The current event I am using to detect when an item spawns cannot see what the item is on the clientside. Therefore the item will appear to be magnetised on the clientside but will not be picked up and will teleport back when the client and server synchronise.

To fix this, I need to attempt to find a way to get this item on the clientside, for example by queueing an update a tick later, or when another event fires (find the event that is triggered when the client gets the item of the item entity?) so that the tag is applied correctly.

Items being moved into filter of Adv. Demagnetizer when sorting with Inventory Tweaks Renewed

Relayed from: EnigmaticaModpacks/Enigmatica6#3373

When sorting using Inventory Tweaks Renewed while inside the Advanced Demagnetizer GUI, items are moved into the filter, effectively voiding them.

Inventory Tweaks Renewed has a config that allows blacklisting certain inventories for sorting, but for some reason blacklisting link.infra.demagnetize.blocks.DemagnetizerGui does not prevent me from sorting.

[1.14.4] Change in Forge API

The method getEntityData() is undefined for the type ItemEntity

Thought I would give you a heads up on this.

Using the latest Forge: 1.14.4 - 28.0.92

[CRASH] Null pointer crash

Just crafted and placed an advanced demagnetizer and (somehow) it caused a spider to crash the game

-- Entity being ticked --
Entity Type: minecraft:spider (net.minecraft.entity.monster.EntitySpider)

Description: Ticking entity

java.lang.NullPointerException
at link.infra.demagnetize.blocks.DemagnetizerEventHandler.itemSpawned(DemagnetizerEventHandler.java:53)
at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_628_DemagnetizerEventHandler_itemSpawned_EntityJoinWorldEvent.invoke(.dynamic)
at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:90)
at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:182)
at net.minecraft.world.World.spawnEntity(World.java:1206)
at net.minecraft.world.WorldServer.spawnEntity(WorldServer.java:1058)
at net.minecraft.entity.EntityLivingBase.onDeath(EntityLivingBase.java:1199)
at net.minecraft.entity.EntityLivingBase.attackEntityFrom(EntityLivingBase.java:1016)
at net.minecraft.entity.monster.EntityMob.attackEntityFrom(EntityMob.java:70)
at net.minecraft.entity.EntityLivingBase.fall(EntityLivingBase.java:1318)
at net.minecraft.block.Block.onFallenUpon(Block.java:821)
at net.minecraft.entity.Entity.updateFallState(Entity.java:1132)
at net.minecraft.entity.EntityLivingBase.updateFallState(EntityLivingBase.java:215)
at net.minecraft.entity.Entity.move(Entity.java:896)
at net.minecraft.entity.EntityLivingBase.travel(EntityLivingBase.java:1951)
at net.minecraft.entity.EntityLivingBase.onLivingUpdate(EntityLivingBase.java:2386)
at net.minecraft.entity.EntityLiving.onLivingUpdate(EntityLiving.java:678)
at net.minecraft.entity.monster.EntityMob.onLivingUpdate(EntityMob.java:45)
at net.minecraft.entity.EntityLivingBase.onUpdate(EntityLivingBase.java:2172)
at net.minecraft.entity.EntityLiving.onUpdate(EntityLiving.java:377)
at net.minecraft.entity.monster.EntityMob.onUpdate(EntityMob.java:50)
at net.minecraft.entity.monster.EntitySpider.onUpdate(SourceFile:87)
at net.minecraft.world.World.updateEntityWithOptionalForce(World.java:1993)
at net.minecraft.world.WorldServer.updateEntityWithOptionalForce(WorldServer.java:832)
at net.minecraft.world.World.updateEntity(World.java:1955)
at net.minecraft.world.World.redirect$updateEntity$zcg000(World.java:5117)
at net.minecraft.world.World.updateEntities(World.java:1759)
at net.minecraft.world.WorldServer.updateEntities(WorldServer.java:613)
at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:767)
at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:668)
at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:252)
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:526)
at java.lang.Thread.run(Thread.java:745)

A detailed walkthrough of the error, its code path and all known details is as follows:

-- Entity being ticked --
Entity Type: minecraft:spider (net.minecraft.entity.monster.EntitySpider)
Entity ID: 62903
Entity Name: Spider
Entity's Exact location: -617.30, 95.63, 352.17
Entity's Block location: World: (-618,95,352), Chunk: (at 6,5,0 in -39,22; contains blocks -624,0,352 to -609,255,367), Region: (-2,0; contains chunks -64,0 to -33,31, blocks -1024,0,0 to -513,255,511)
Entity's Momentum: -8.15, -1.55, 0.03
Entity's Passengers: []
Entity's Vehicle: ERROR NullPointerException: null
Entity NBT: {HurtByTimestamp:0,ForgeData:{Hats_hatInfo:"",CursedEarth:57,excompressum:{NoCompress:1b}},Attributes:[{Base:-2.0d,Modifiers:[{UUIDMost:2189974539282499591L,UUIDLeast:-6477178668949725305L,Amount:1.0d,Operation:0,Name:"normal"}],Name:"tc.mobmod"},{Base:0.0d,Name:"tc.mobmodtaint"},{Base:16.0d,Name:"generic.maxHealth"},{Base:0.0d,Name:"generic.knockbackResistance"},{Base:0.30000001192092896d,Modifiers:[{UUIDMost:-1928099995943284879L,UUIDLeast:-7424676046943233794L,Amount:1.2d,Operation:1,Name:"CursedEarth"}],Name:"generic.movementSpeed"},{Base:0.0d,Name:"generic.armor"},{Base:0.0d,Name:"generic.armorToughness"},{Base:1.0d,Name:"forge.swimSpeed"},{Base:16.0d,Modifiers:[{UUIDMost:6451205988273767315L,UUIDLeast:-9199561264936245099L,Amount:-0.03173931209583872d,Operation:1,Name:"Random spawn bonus"}],Name:"generic.followRange"},{Base:2.0d,Modifiers:[{UUIDMost:-1928099995943284879L,UUIDLeast:-7424676046943233794L,Amount:1.5d,Operation:1,Name:"CursedEarth"}],Name:"generic.attackDamage"}],Invulnerable:0b,FallFlying:0b,PortalCooldown:0,AbsorptionAmount:0.0f,FallDistance:20.680437f,DeathTime:0s,ForgeCaps:{"nuclearcraft:capability_entity_rads":{radiationResistance:0.0d,totalRads:0.0d,radiationLevel:0.0d,radXCooldown:0.0d,radXWoreOff:0b,radawayCooldown:0.0d},"tinkertoolleveling:entityxp":[],"dsurround:emojidata":{as:1,es:0,et:0},"thebetweenlands:entity_gems":{gems:[]},"thebetweenlands:custom_step_sound":{},"llibrary:extendedentitydatacapability":{},"thebetweenlands:puppet":{ticks:0},"twilightforest:cap_shield":{permshields:0,tempshields:0},"everlastingabilities:org.cyclops.everlastingabilities.api.capability.imutableabilitystore":[],"thebetweenlands:equipment":{amuletSlots:1}},HandDropChances:[0.085f,0.085f],PersistenceRequired:0b,Motion:[-8.151707947919403d,-1.551131103621314d,0.025650084714350672d],Leashed:0b,UUIDLeast:-5634626572217315992L,Health:0.0f,LeftHanded:0b,Air:300s,OnGround:1b,Dimension:0,Rotation:[323.70844f,0.0f],UpdateBlocked:0b,HandItems:[{},{}],ArmorDropChances:[0.085f,0.085f,0.085f,0.085f],UUIDMost:-6018120370437535186L,Pos:[-617.3000000119209d,95.625d,352.165054201575d],Fire:-1s,ArmorItems:[{},{},{},{}],CanPickUpLoot:0b,HurtTime:10s}

[1.16.5] Pickletweaks Magnet

I saw that #2 added support for pickletweaks however this no longer seems to be the case as its magnet still grabs items and XP. Changing range or redstone has no effect. For testing purposes the thermal magnet is affected (but that magnet is subpar). I also tried placing the demagnetizer at different height levels to see if that had any impact but it did not. For verbosity I added demagnetize to skyfactory one pack. I also tried it in a separate instance with only PT and DM but still same results.

Demagnetize: 1.16.2-1.2.2
Pickletweaks: 5.2.6

If this requires a change to picketweaks itself please feel free to close this issue and I'll ask them for support.

Happy holidays.

Req: Update to 1.18.1

First let me thank you for creating this mod, Secondly I'm being a pest and asking if you might update this mod.
That's all I have, thank you once again.

ConcurrentModificationException on World Load [1.12.2]

Hello,
I've been playing a modified version of DDnSS additional to a few others i have added Demagnetize as well.
Everything was working super smooth until i restarted my game after updating the pack today, which has updated the Forge version to forge-14.23.5.2847.
After attempting to load up my save the Internal Single-player Server crashed (crash-log attached below).

Creating a completely new world was working without any issues.
After some trial runs i found out that Demagnetize was causing the Issue, after removing the mod the save loaded without any issues.
Now, since i didn't want to play without it i attempted to save the world without Demagnetized installed and load it again installed. To remove any remains of it i was blessed with success!

So further testing was necessary to find when exactly the error would occur.
Next was restarting the whole game without any changes which also crashed the server.
So it was not that mods are being added, which i had originally suspected.

Then i remembered that i had white-list filters set in both of my Demagnetizers, so after restarting the game 3 more times to remove -> re-add without filters -> and restart again to check, my 3rd time loading the world greeted me with the same error again.

Some things i noticed when i created new instance with just bare bones setup of the modpack so i don't have to wait 5-min between each restart:

  • it doesn't crash...
  • it resets the Demagnetizers settings (filter and whitelist back to blacklist)
  • console logs errors instead of crashing in the small version
20:19:12.347 | net.minecraft.tileentity.TileEntity | Server thread | Failed to create block entity demagnetize:demagnetizertile
20:19:12.348 | FML                                 | Server thread | A TileEntity demagnetize:demagnetizertile(link.infra.demagnetize.blocks.DemagnetizerTileEntity) has thrown an exception during loading, its state cannot be restored. Report this to the mod author
20:19:12.348 | net.minecraft.tileentity.TileEntity | Server thread | Skipping BlockEntity with id demagnetize:demagnetizertile
  • Errors appear on World reload not just Game restart
  • This does not happen with the Advanced Demagnetizer

After restarting my main game and placing Advanced Demganetizers instead of the Base version and reloading the World worked without any problems. So i'll just be using the advanced ones for the time being :)

I hope this helps with finding the root of the problem.

mc-verison: 1.12.2
crash-log: crash-2019-11-29_19.31.44-server
forge: forge-14.23.5.2847

Whitelist and blacklist not working when using Botania’s ring of magnetization

I want the demagnetizer to only prevent me from picking up canola seeds, crystallized canola seeds, and empowered canola seeds from Actually Additions. I’m using an advanced demagnetizer. I’m not sure whether to put it on whitelist or blacklist (for instance, does “whitelist” mean “only stop magnetizing for the selected items” or “keep these items from being affected from the demagnetization”? I assume it’s the former), but I’ve tried both whitelist and blacklist, and I’ve configured it to only affect these three types of canola seeds, but the demagnetizer keeps any items from being magnetized in its vicinity regardless.

Demagnetizer bug

  • Modpack: Enigmatica 2 (version 1.63a)
  • Minecraft: 1.12.2 (duh)
  • Forge: 14.23.5.2781
  • Demagnetize: 1.0.1 (latest)

Ender IO / Reliquary filtering broken when Botania compat enabled

The Botania compatability works by imitating a Solegnolia. Ender IO and Reliquary support both the PreventRemoteMovement NBT tag and Solegnolias. Solegnolias don't have an item filter, so if both the Solegnolia check and PreventRemoteMovement are used, the item filter in my Demagnetizers is ignored.

For Ender IO and Reliquary to work as intended, the Botania compat config option must be set to false, or Botania must not be installed.

[1.14.4] REQUEST: Mods tested and confirmed

Hi,

I tested your demagnetize mod with both my Gobber 2 and Ring of Attraction mods and can confirm they work as intended.

Can you add these mods to the list so others know?

Thank you.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.