Add Travel Anchor and Staff of Travelling #103
No reviewers
Labels
No labels
Area-Assets
Area-Backend
Area-Conduits
Area-Datapacks
Area-Lang
Area-Mod Compat
Area-Parity
Area-Rendering
Good first issue
MC-1.19.2
MC-1.20.1
MC-1.20.4
MC-1.20.6
MC-1.21
MC-1.21.1
Modtoberfest
P-0-High
P-1-Medium
P-2-Low
Status-Awaiting Response
Status-Behind-Flag
Status-Blocked
Status-Cannot Reproduce
Status-Duplicate
Status-Help Wanted
Status-Incomplete Report
Status-Invalid
Status-Needs LTS Backport
Status-Needs Updating
Status-Stale
Status-To Implement
Status-Triage
Status-Wontfix
Status-Wontmerge
Type-Backport
Type-Bug
Type-Documentation
Type-Enhancement
Type-Question
Type-RFC
Type-Suggestion
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: Team-EnderIO/EnderIO#103
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "dev/travel-staff"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Co-authored-by: agnor99 36055315+agnor99@users.noreply.github.com
Description
Supersedes #18
Todo
Security Systemwill be implemented in a future PRChecklist:
Do you reckon you will manage to finish this before the 1.19.4 merge? I know you're currently occupied by #108. If not I'd be happy to help you bring this back up to speed once #116 is merged :)
@ -0,0 +1,21 @@package com.enderio.api.travel;tbh, not really needed, api is still in alpha and we will probably go over it all before we release a beta
@ -0,0 +1,62 @@package com.enderio.machines.common.block;is this todo still accurate?
is this todo still accurate
a helper for this sneakcache to hide the complexity of the condition behind a nice method name would be nice
don't set the field type to weakhashmap, impl detail isn't important here, maybe have a better record instead of this pair would be nice for better documentation of what both fields do
@ -0,0 +1,131 @@package com.enderio.machines.common.blockentity;is this visibility correct?
don't inline this one method call, this shouldn't have to be called from TravelAnchorBlock#onRemove, as both will do that
@ -0,0 +1,116 @@package com.enderio.machines.common.travel;use CoreNBTKeys and other static final String fields so you don't repeat the same Strings everywhere
@ -7,2 +7,3 @@"core": "enderio:block/vacuum_portal""core": "enderio:block/vacuum_portal","particle": "enderio:block/machine_side"},fix spacing
@ -70,2 +68,4 @@// event.register(EIOItems.DARK_STEEL_AXE.get(), EnergyBarDecorator.INSTANCE);// event.register(EIOItems.DARK_STEEL_PICKAXE.get(), EnergyBarDecorator.INSTANCE);// Register all glass blocksremove these lines all together if you want to change them
@ -0,0 +1,50 @@package com.enderio.base.client.renderer.travel;make 25 a public static final field and call it something like MIN_TELEPORTATION_DISTANCE_SQUARED in TravelHandler
maybe make this field nullable, and resolve the optional with orElse(null), so comparisons later are nicer
@ -0,0 +1,64 @@package com.enderio.base.client.renderer.travel;reorder checks so that TravelHandler#canItemTeleport is called last as that might be the slowest operation
directly call ifPresent on this optional
@ -0,0 +1,169 @@package com.enderio.base.common.handler;this one should be private
make the 25 a public static final field and use it in the RenderTravelTargets, as soon as you do this, remove comment as then it becomes obvious
@ -128,3 +128,3 @@public static final ItemEntry<MaterialItem> POWDERED_GOLD = materialItem("powdered_gold").tag(EIOTags.Items.DUSTS_GOLD).register();public static final ItemEntry<MaterialItem> POWDERED_COPPER = materialItem("powdered_copper").tag(EIOTags.Items.DUSTS_COPPER).register();public static final ItemEntry<MaterialItem> POWDERED_TIN = materialItem("powdered_tin").tag(EIOTags.Items.DUSTS_TIN).register(); // TODO: hide if tin isn't presentpublic static final ItemEntry<MaterialItem> POWDERED_TIN = materialItem("powdered_tin")undo this massive formatting change
@ -22,6 +23,7 @@ public class EmpoweredUpgrade extends TieredUpgrade<EmpoweredUpgradeTier> {nullable on line before the field declaration
functional wise this works, once the requested changes have been made this can be merged
@ -0,0 +1,62 @@package com.enderio.machines.common.block;I don't remember why I added that. Removing it
@ -0,0 +1,62 @@package com.enderio.machines.common.block;Correct me if I am wrong (since this is not my code, carried over from your old PR), This piece of code maintains a sneak cache to ensure that teleport only happens on button down (not on pressed/released). Right ?
@ -7,2 +7,3 @@"core": "enderio:block/vacuum_portal""core": "enderio:block/vacuum_portal","particle": "enderio:block/machine_side"},That looks like a github issue. the file on my side/branch looks fine to me
@ -0,0 +1,62 @@package com.enderio.machines.common.block;it's stores the last time the player was found above a travel anchor and if the player was sneaking and this ensures, that the teleport happens on sneak down, not when continously sneaking or when teleporting from a travel anchor to another travelanchor, so that the second anchor doesn't try to teleport again
@ -22,6 +23,7 @@ public class EmpoweredUpgrade extends TieredUpgrade<EmpoweredUpgradeTier> {This file is not a part of my PR. I have not touched it at all. The field is nullable on my side. Probably a residue of so many Merges
@ -22,6 +23,7 @@ public class EmpoweredUpgrade extends TieredUpgrade<EmpoweredUpgradeTier> {Nevermind. I don't remember editing that file ever but it does have changes from my side (its a change from 7 months ago lol ). I will make the required changes
@ -31,4 +31,12 @@ public class CoreNBTKeys {public static final String SYNC_DATA = "Data";you don't really need a new name for BlockPositions, just use BLOCK_POS
Happy for this to go in, ignoring the formatting changes :)
Lookin good chonky, thanks for all of you hard work getting this to the finish line!
And sorry agnor for the re-requested review. I butterfingered it 😅