Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] version/main from ldtteam:version/main #163

Open
wants to merge 1,336 commits into
base: version/main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
1336 commits
Select commit Hold shift + click to select a range
b6987ad
Minecolonies Original fixes and Colonial adjustments, fixes and addit…
MotionlessTrain Dec 16, 2023
49966e0
Prevent entities from pathfinding too far (#9629)
someaddons Dec 18, 2023
53f7895
Herder improvements (#9625)
someaddons Dec 18, 2023
7a0a277
Research costs based on multiple items/tags [1.20] (#9491)
Thodor12 Dec 18, 2023
d9db860
Prevent building upgrade fireworks from damaging nearby entities (#9448)
Thodor12 Dec 18, 2023
f1074c8
Rework delete command so it's less complex to use (#9540)
Raycoms Dec 18, 2023
fc3694d
fix pathing (#9627)
Raycoms Dec 17, 2023
ebec64d
add colonial, fix waypoint spawning in incan (#9612)
Raycoms Dec 17, 2023
fd6160f
fix compile errors
Raycoms Dec 18, 2023
3d8c4dc
solve 9553
Raycoms Dec 18, 2023
f44e418
Fix research cost list serialization in network buffers [1.20] (#9635)
Thodor12 Dec 19, 2023
af30b1b
Cap data fixes (#9534)
Raycoms Dec 8, 2023
9f19ea5
Fortress and medieval spruce fixes in 1.20 (#9641)
MotionlessTrain Dec 22, 2023
9ca11ce
Fix invisible tag ignored (#9637)
uecasm Dec 22, 2023
b3b027d
Change surnames and firstnames to Chinese characters (1.20.1) (#9564)
mc-kaishixiaxue Dec 22, 2023
302dcfc
Port work overlays (#9652)
uecasm Dec 27, 2023
814809c
Fix stream reuse (#9643)
uecasm Dec 27, 2023
464a536
Copy github templates from old main branch (#9655)
uecasm Dec 28, 2023
5701afd
fix entity list message failing to handle (#9657)
someaddons Dec 28, 2023
a51d6c1
Add building stats (#9650)
Raycoms Dec 29, 2023
1854170
Window Hire Worker Reworked (#9658)
Raycoms Jan 2, 2024
e466a02
Duplicate building error pos (#9667)
someaddons Jan 2, 2024
d3b4f00
Fix all compile issues (#9659)
Nightenom Jan 2, 2024
b03252d
Respect minimum animal count (#9663)
uecasm Jan 2, 2024
eedd141
make mangrove roots compostable (#9666)
IchHabeHunger54 Jan 2, 2024
7f344a9
Fix bread dough incorrect minimum building level tooltip requirement …
Thodor12 Jan 2, 2024
f61e2a2
Add new brick blocks to path tag (#9669)
Raycoms Jan 2, 2024
0541ca6
Fix correct tool checks (#9674)
Thodor12 Jan 5, 2024
ad496be
Update WorkerUtil.java (#9676)
Thodor12 Jan 6, 2024
e1088e6
Make miner/quarrier/nether miner immune to magma block damage (#9688)
Thodor12 Jan 7, 2024
066f0bb
Make tool/armor names translatable and include netherite (#9684)
uecasm Jan 7, 2024
0801558
Fix deco controller crash (#9681)
someaddons Jan 7, 2024
c0018eb
Change base rate of AI updates to 5 ticks, to reduce overhead, AI act…
someaddons Jan 7, 2024
62bd683
Multi-research (and crusher) (#9670)
uecasm Jan 7, 2024
9e736d7
Bayou player houses, Medieval, Minecolonies Original and Shire fixes …
MotionlessTrain Jan 8, 2024
ed3051a
Rescan of Minecolonies Original and Colonial and Medieval Spruce and …
MotionlessTrain Jan 10, 2024
a715acb
Switch free-form style in message utils to priority presets (#9662)
Thodor12 Jan 10, 2024
2239446
Fix mending logic being applied correctly to all worn items (#9673)
Thodor12 Jan 11, 2024
c364003
Better hire window sorting (#9691)
someaddons Jan 11, 2024
f64b53d
debug zero raider pathing (#9692)
someaddons Jan 11, 2024
cad1fc3
Update fields list visuals (#9693)
Thodor12 Jan 11, 2024
901d8b5
Dedicated buildings 1.20 (#9653)
uecasm Jan 11, 2024
1c5b4b5
Fix snowy graveyard (#9671)
uecasm Jan 11, 2024
6b49dae
Introduce placement handler for copper variants (#9648)
Thodor12 Jan 11, 2024
4b46229
Fix crash when selecting warehouse in another colony using resource s…
Thodor12 Jan 11, 2024
eac1047
Fix composted dirt not dropping [1.20] (#9632)
Thodor12 Jan 12, 2024
e1870c7
Feature/intro quests (#9690)
Raycoms Jan 12, 2024
c2a5529
Fix resource scroll crash (#9701)
Thodor12 Jan 12, 2024
8b5f980
add undead visitor
Raycoms Jan 12, 2024
aa22d42
add null check (#9704)
Raycoms Jan 13, 2024
571e36a
some chat handling (#9705)
Raycoms Jan 13, 2024
5371487
Config settings rework/cleanup (#9699)
someaddons Jan 14, 2024
d7feeca
refactor colony chunk cap access (#9700)
Raycoms Jan 14, 2024
b31aad4
hotfix construction tape
someaddons Jan 14, 2024
417a263
Refactor/coremod to core (#9707)
Raycoms Jan 16, 2024
010035a
optimize imports
Raycoms Jan 16, 2024
ea14cda
fix raiders walking to zero (#9715)
someaddons Jan 16, 2024
135a220
new assignment window for housing (#9722)
Raycoms Jan 20, 2024
820bbb1
Fix config (#9721)
Raycoms Jan 20, 2024
16379a4
Fix concurrency derp (#9720)
uecasm Jan 20, 2024
b612c97
Feature/UI message (#9714)
Raycoms Jan 20, 2024
bc49bda
Refactor/entity folders (#9718)
Raycoms Jan 20, 2024
8766949
Fix dangerous blocks (#9719)
uecasm Jan 21, 2024
6f6676c
Fix some missing items (#9710)
uecasm Jan 21, 2024
d4eaa91
Fixes/quest UI sifter (#9730)
Raycoms Jan 21, 2024
5ba5b0b
hotfix
Raycoms Jan 21, 2024
2b91d98
minor fixes (#9732)
Raycoms Jan 22, 2024
d06bf94
Pathing/rally fixes (#9731)
someaddons Jan 22, 2024
3fb5be1
hotfix
Raycoms Jan 22, 2024
8f08b09
small assignment fixes
Raycoms Jan 23, 2024
dd568f8
Improve statistics sync (#9734)
someaddons Jan 24, 2024
2166780
hotfix 9739
Raycoms Jan 25, 2024
2891c7b
Pathing fixes (#9738)
Raycoms Jan 25, 2024
df1bb8a
Pathingfixes (#9741)
someaddons Jan 28, 2024
69555d8
Prevent crash (#9744)
Raycoms Jan 28, 2024
60012ee
not needed anymore (#9746)
Raycoms Jan 28, 2024
8117474
Adjust skins (#9742)
Raycoms Jan 28, 2024
d7533fd
Improve builder logic (#9735)
someaddons Jan 28, 2024
df42a47
small guard armor changes (#9748)
Raycoms Jan 28, 2024
f180c76
move api module to api folder (#9749)
Raycoms Jan 28, 2024
35cf358
Refactor #2 (#9750)
Raycoms Jan 28, 2024
c1f99c5
Kill old proxies (#9752)
Raycoms Jan 28, 2024
983a581
Shire fixes, additions and revisions (#9753)
MotionlessTrain Jan 28, 2024
2cfacd5
fix 9740 (#9756)
Raycoms Jan 29, 2024
8461d4b
Shire, Cavern and Minecolonies Original fixes in 1.20 (#9754)
MotionlessTrain Feb 4, 2024
4bf0a7c
More quests (#9767)
Raycoms Feb 4, 2024
b24d3b8
adjust nether colony spawn (#9765)
Raycoms Feb 4, 2024
9237933
Add block diversity stat to schematic analyzer (#9763)
someaddons Feb 4, 2024
8b52253
Fakeplayer safety measure (#9760)
someaddons Feb 4, 2024
f4901a5
Correct some blueprint packs' descriptions (#9759)
mc-kaishixiaxue Feb 4, 2024
b0e0d74
Patreon additions (#9757)
Raycoms Feb 4, 2024
c6f7d07
[ImgBot] Optimize images (#9751)
imgbot[bot] Feb 4, 2024
59b54a3
prevent crash when quest gets removed (#9768)
Raycoms Feb 4, 2024
aca4444
Remove legacy code (#9770)
Raycoms Feb 5, 2024
3173e31
fix 9774 (#9775)
Raycoms Feb 11, 2024
c5c133d
fix entity kill stat display and fix break event cancel (#9780)
Raycoms Feb 12, 2024
9134c62
Update jpegs to pngs (#9783)
Thodor12 Feb 15, 2024
d6f9b6b
Urban Savannah and Colonial fixes in 1.20.1 (#9777)
MotionlessTrain Feb 15, 2024
4580840
Fix double feeding confusion (#9784)
someaddons Feb 18, 2024
9b66d89
Supply camp and ship enhancement (#9779)
MotionlessTrain Feb 18, 2024
c8cd2f9
fix wayyyyy too large pngs
Raycoms Feb 19, 2024
b8cda28
add water clearing step, use spawn entity step, fix msg (#9790)
Raycoms Feb 20, 2024
066501d
Some fixes (#9796)
Raycoms Feb 25, 2024
806b13f
Add set rank command (#9789)
someaddons Feb 25, 2024
0f68afc
Fix rotation of decoration controllers (#9792)
uecasm Feb 25, 2024
fb8e5a5
Fix armor level checking (#9786)
Thodor12 Feb 25, 2024
f582cf4
Medieval Oak and Minecolonies Original fixes (#9797)
MotionlessTrain Feb 25, 2024
aef941f
pathfinding adjustments (#9798)
someaddons Feb 25, 2024
0b158c7
Fix 9804 (#9806)
Raycoms Feb 28, 2024
a5d3cd2
Fix backups not loading from all dimensions (#9807)
someaddons Feb 28, 2024
5159e7b
Fix the Stalactite Caves barracks having an end stone block at levels…
MotionlessTrain Feb 29, 2024
dd78fec
Fix visitor sitting position being off at large coordinates (#9813)
someaddons Mar 2, 2024
1e6df92
Bunch o fixes (#9815)
Raycoms Mar 3, 2024
79c1652
[ImgBot] Optimize images (#9799)
imgbot[bot] Mar 3, 2024
9e357ae
Improve raider entity spawn position (#9802)
someaddons Mar 3, 2024
f090644
fix 9822
Raycoms Mar 9, 2024
081e376
Fix second crash in townhall map GUI (#9823)
Thodor12 Mar 9, 2024
2ab911c
Minecolonies Original and Stalactite Caves fix (#9818)
MotionlessTrain Mar 9, 2024
aa61e2c
add new way to detect DO mining (#9825)
Raycoms Mar 10, 2024
c977e1d
Immersive colony start (#9826)
Raycoms Mar 10, 2024
650b48e
Fix stonemason not being able to craft decorated pots, remove dyeing …
Thodor12 Mar 10, 2024
984f182
hotfix 9828
Raycoms Mar 10, 2024
59ece85
Update issue templates (#9838)
Thodor12 Mar 14, 2024
54273f4
Pathfinding restructuring & Fixes (#9837)
someaddons Mar 14, 2024
7822e1b
bunch of fixes (#9832)
Raycoms Mar 14, 2024
34155ca
Update housing2.json (#9834)
Talyda Mar 14, 2024
8db2a17
fix path reaching value (#9840)
someaddons Mar 14, 2024
9d339a3
Hotfix lumberjack pathfinding
someaddons Mar 16, 2024
7a37fcc
Fix citizen references (#9844)
someaddons Mar 17, 2024
ca9a711
Several fixes (#9833)
Thodor12 Mar 17, 2024
d8fd97c
couple of fixes (#9845)
Raycoms Mar 17, 2024
811f2d4
Shire fix and Medieval adjustments (#9846)
MotionlessTrain Mar 18, 2024
870b2c2
Refactor stories system (#9841)
uecasm Mar 18, 2024
90b7106
fix to map sync (#9853)
Raycoms Mar 19, 2024
f243223
Fix infinite debugging (#9856)
uecasm Mar 20, 2024
b73e46d
Several fixes (#9857)
Raycoms Mar 20, 2024
0711e70
Merge branch 'name-fixes' into version/1.19.2 (#9862)
Raycoms Mar 23, 2024
ab52125
Fix tooltip appearing on settings where it shouldn't (#9848)
Thodor12 Mar 24, 2024
60970f5
pathfinding heuristics (#9863)
someaddons Mar 24, 2024
d2056a6
Fix missing null checks
someaddons Mar 24, 2024
e00689e
Fix npe
someaddons Mar 24, 2024
9d2f51e
Fix pathing exception with extra nodes
someaddons Mar 24, 2024
a8992c7
Fix npe
someaddons Mar 24, 2024
457965d
Fix citizens loaded from chunks replacing active citizen (#9869)
someaddons Mar 27, 2024
ae3aa63
Builder pathfinding (#9872)
someaddons Mar 27, 2024
6a5bd37
Change shepherd ITEM_USED statistics to ITEM_OBTAINED (#9874)
Thodor12 Mar 27, 2024
6c0cda1
Dynamic gate tooltip (#9873)
uecasm Mar 27, 2024
ec67330
Because (#9852)
uecasm Mar 27, 2024
a513e70
Move quests to colony/quests (#9850)
uecasm Mar 27, 2024
1968130
Several fixes (#9879)
Raycoms Mar 31, 2024
4779325
miner liquid handling fixes (#9880)
Raycoms Mar 31, 2024
6075d21
Multi fixes (#9882)
Raycoms Apr 2, 2024
12c926f
Fix random pathing getting stuck (#9886)
someaddons Apr 2, 2024
8006e82
Fortress addition, Desert Oasis change and fixes in Colonial, Fortres…
MotionlessTrain Apr 2, 2024
251f655
Citizenfixes (#9891)
someaddons Apr 4, 2024
403fad3
Add more compatible entity creation (#9893)
someaddons Apr 5, 2024
1324c00
Allow tree chopping inside buildings when in a box again (#9888)
uecasm Apr 5, 2024
d74fe96
hotfix
Raycoms Apr 6, 2024
bccc1ab
Merge branch 'version/main' of https://github.com/ldtteam/minecolonie…
Raycoms Apr 6, 2024
c0c30a7
Fix pathing over blocks over water (#9897)
someaddons Apr 6, 2024
4f6b05b
Jungle Treehouse, Fortress and Minecolonies Original fixes (#9896)
MotionlessTrain Apr 6, 2024
9791479
Fix crafters walking outside their hut area (#9900)
someaddons Apr 8, 2024
7f71920
Fix uuid conflicts (#9901)
someaddons Apr 8, 2024
ef121cb
Fix uuid conflicts (#9902)
someaddons Apr 8, 2024
9cb9e59
Small fixes (#9903)
Raycoms Apr 8, 2024
e20c6fa
Small wander adjustment (#9918)
someaddons Apr 14, 2024
ec199d7
Stepped walls, roads and rails (#9913)
MotionlessTrain Apr 14, 2024
0c6d56d
Avoid error messages/mod compat on duplicate entities (#9914)
someaddons Apr 14, 2024
5099aba
Fix random bias (#9919)
someaddons Apr 14, 2024
526bbf8
make quests more uncommon, move research (#9906)
Raycoms Apr 14, 2024
6432c50
Visitor changes (#9917)
Raycoms Apr 14, 2024
96753b8
Feature/underwater raiders (#9899)
Raycoms Apr 14, 2024
d4be05f
Polymorph-like support for teaching crafting (#9907)
uecasm Apr 14, 2024
0c98ec1
[ImgBot] Optimize images (#9920)
imgbot[bot] Apr 14, 2024
0312aa9
add null check
Raycoms Apr 15, 2024
07c72ec
Rebalance baker foods (#9895)
uecasm Apr 21, 2024
baced51
Builder etc fixes (#9928)
Raycoms Apr 21, 2024
37ff2d6
ship raid changes (#9927)
Raycoms Apr 21, 2024
438a86c
Improvements for free blocks management (#9911)
uecasm Apr 21, 2024
3695b9f
Support for overworld mushroom trees in forester (#9924)
uecasm Apr 21, 2024
4f91361
Pathfinding fixes (#9930)
someaddons Apr 22, 2024
f08e8cb
new visitor and visitor changes
Raycoms Apr 26, 2024
e6de624
Merge branch 'version/main' of https://github.com/ldtteam/minecolonie…
Raycoms Apr 26, 2024
4698dcc
Refactor packages (#9935)
someaddons Apr 27, 2024
d38ea47
Fix compile (#9941)
someaddons May 3, 2024
2671796
sound manager rework (#9949)
Raycoms May 12, 2024
e4afdd6
Fix 9947 (#9948)
Raycoms May 12, 2024
e34e7a7
Message fixes (#9945)
someaddons May 12, 2024
d8cb5db
Update EntityAIWorkFarmer.java (#9940)
Thodor12 May 12, 2024
efad520
Fix food recipes (#9937)
uecasm May 12, 2024
be67e4b
Reworked fisher pond search (#9938)
someaddons May 12, 2024
07c24c0
add builder mode tooltips (#9951)
Raycoms May 12, 2024
20f7613
Fix farmer not tilling (#9952)
Thodor12 May 12, 2024
cc490f1
Add safeguard to mods messing with follow range (#9955)
someaddons May 15, 2024
ea66498
add null check (#9956)
Raycoms May 15, 2024
1bafff8
Miner ylevels (#9936)
someaddons May 15, 2024
8408316
Small performance improvements (#9953)
someaddons May 15, 2024
add1a46
Prevent crash on damaging unregistered citizen (#9957)
someaddons May 15, 2024
afe9722
Ancient greece (#9958)
Raycoms May 19, 2024
79d4f7b
Fix: quarrier's interaction with the zigzag iterator (#9959)
MotionlessTrain May 21, 2024
94eaa29
Fix fisher depth to vanilla like (#9961)
someaddons May 23, 2024
7ececda
Fixes (#9964)
someaddons May 26, 2024
a924cd7
fix john exploit (#9962)
Raycoms May 26, 2024
391b6eb
Only hit at line of sight (#9966)
Raycoms May 29, 2024
6c8b62c
Minecolonies Original fix and Jungle Treehouse tweak (#9960)
MotionlessTrain May 29, 2024
f2f87d3
Central Courier Task Assignment (#9969)
Raycoms Jun 2, 2024
2916429
New patreon pattern + name (#9978)
Raycoms Jun 8, 2024
46f0b03
Fix the tags in the Nordic Spruce vine plantation field (#9971)
MotionlessTrain Jun 8, 2024
cadb39a
[ImgBot] Optimize images (#9979)
imgbot[bot] Jun 9, 2024
758292b
avoid nearby colony lookup on each frame (#9972)
someaddons Jun 9, 2024
b5be09c
Prevent builder from standing where hes mining below (#9981)
someaddons Jun 10, 2024
3bd2f2c
Further quest progress (#9980)
Raycoms Jun 11, 2024
1ac11d4
Improve fisher (#9986)
Raycoms Jun 16, 2024
04a4bed
Caledonia and Pagoda updates (#9984)
MotionlessTrain Jun 16, 2024
4b36e23
Mark the Fortress mine guard as invisible (#9983)
MotionlessTrain Jun 16, 2024
ddd0e0e
Some perm changes (#9989)
Raycoms Jun 16, 2024
81506ec
Update greek texture style to include all (#9998)
Raycoms Jun 23, 2024
1a53fd5
Rack fixes (#9997)
someaddons Jun 23, 2024
4dc8f6d
Fix enum naming for direction for raids (#9995)
Thodor12 Jun 23, 2024
aa99e63
Rework the quarrier to support other builder modes in the future (#9967)
MotionlessTrain Jun 23, 2024
4f0b3b8
[ImgBot] Optimize images (#10000)
imgbot[bot] Jun 23, 2024
b7e329e
Medieval and Ancient Athens fixes (#10002)
MotionlessTrain Jun 23, 2024
b56452e
Some pickup changes & UI include warehouse list (#9992)
Raycoms Jun 23, 2024
0c36610
Add kitchen placeholder (#10001)
Raycoms Jun 24, 2024
8c202cc
courier adjutment + sleep adjustments (#10004)
Raycoms Jun 28, 2024
b46a5e4
blame sam, hotfix
Raycoms Jun 28, 2024
37ebfac
TeamCity change in 'Let's Dev Together / Minecolonies / Branches' pro…
Jun 29, 2024
c5bc785
fix npe (#10014)
Raycoms Jul 5, 2024
f1b460a
Fortress, Shire and Medieval Birch fixes (#10007)
MotionlessTrain Jul 7, 2024
2805241
Fix workers not displaying request when converting an async request t…
someaddons Jul 7, 2024
52916bc
fix #10010 (#10017)
Raycoms Jul 7, 2024
ea3b39c
Migrate to new structure operations in favor of ticked world operatio…
Thodor12 Jul 7, 2024
446ca3a
Minecolonies food (#10018)
Raycoms Jul 14, 2024
772448f
Cavern and Ancient Athens fixes (#10027)
MotionlessTrain Jul 14, 2024
72dedc7
Schematic kitchen preparations (#10005)
MotionlessTrain Jul 14, 2024
2c8e3c8
fix 10035 & 10036 (#10040)
Raycoms Jul 15, 2024
2c235d9
Cookery fixes (#10041)
Raycoms Jul 16, 2024
a32b96c
Allow teaching crafting recipes to kitchen at levels 1-2 (#10048)
uecasm Jul 17, 2024
4c5aba7
Allow rice to actually drop :D (#10058)
uecasm Jul 20, 2024
981f0b4
Food related fixe (#10054)
Raycoms Jul 20, 2024
a53091c
Medieval, Desert Oasis, Minecolonies and Colonial additions, Medieval…
MotionlessTrain Jul 20, 2024
fb5a4b3
Fixes crash if rack next to hut (#10056)
uecasm Jul 21, 2024
76a34d5
Quarrier tweaks (#10052)
MotionlessTrain Jul 21, 2024
a3058a4
Don't treat domum items as equivalent when reporting resource deliver…
uecasm Jul 21, 2024
a0fb1bc
fix 10047 (#10064)
Raycoms Jul 21, 2024
71ef82f
Tool handling (#10051)
Raycoms Jul 21, 2024
2300eae
Fix food auditor for new food system (#10059)
uecasm Jul 21, 2024
e7b566b
Fix clicking on arrow to get possible recipes (#10067)
uecasm Jul 22, 2024
d66392a
John's cookeries (#10065)
MotionlessTrain Jul 22, 2024
5e7798a
Whoops (#10070)
uecasm Jul 23, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Some perm changes (ldtteam#9989)
Add levitation effect after too many times breaking colony perms
Add entity right click whitelist
Add new toggleable permission that defaults to true
  • Loading branch information
Raycoms committed Jun 16, 2024
commit ddd0e0e9b455ea5651377e2ead3b89bf9534e137
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ public enum Action
HURT_CITIZEN(26),
HURT_VISITOR(27),
MAP_BORDER(28),
MAP_DEATHS(29);
MAP_DEATHS(29),
ACCESS_TOGGLEABLES(30);

// remember to update permissionsVersion and add some upgrade logic in upgradePermissions if you
// add new actions that shouldn't just be off by default for everyone
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/com/minecolonies/api/items/ModTags.java
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ public class ModTags

public static final TagKey<EntityType<?>> raiders = TagKey.create(Registries.ENTITY_TYPE, TagConstants.RAIDERS);

public static final TagKey<EntityType<?>> freeToInteractWith = TagKey.create(Registries.ENTITY_TYPE, TagConstants.ALLOW_INTERACT);


public static final TagKey<Item> ignoreNBT = ItemTags.create(TagConstants.IGNORE_NBT);

public static final Map<String, TagKey<Item>> crafterProduct = new HashMap<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ public final class TagConstants
public static final ResourceLocation MOB_ATTACK_BLACKLIST = new ResourceLocation(MOD_ID, "mob_attack_blacklist");
public static final ResourceLocation RAIDERS = new ResourceLocation(MOD_ID, "raiders");
public static final ResourceLocation IGNORE_NBT = new ResourceLocation(MOD_ID, "ignore_nbt");
public static final ResourceLocation ALLOW_INTERACT = new ResourceLocation(MOD_ID, "allowinteract");

public static final String CRAFTING_BAKER = ModJobs.BAKER_ID.getPath();
public static final String CRAFTING_BLACKSMITH = ModJobs.BLACKSMITH_ID.getPath();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,21 @@
import com.minecolonies.api.util.EntityUtils;
import com.minecolonies.api.util.ItemStackUtils;
import com.minecolonies.api.util.MessageUtils;
import com.minecolonies.api.util.constant.Constants;
import com.minecolonies.core.MineColonies;
import com.minecolonies.core.blocks.BlockDecorationController;
import com.minecolonies.core.blocks.huts.BlockHutTownHall;
import com.minecolonies.core.colony.Colony;
import com.minecolonies.core.colony.jobs.AbstractJobGuard;
import com.minecolonies.core.entity.citizen.EntityCitizen;
import it.unimi.dsi.fastutil.objects.Object2IntMap;
import it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap;
import net.minecraft.core.BlockPos;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.tags.BlockTags;
import net.minecraft.world.effect.MobEffectInstance;
import net.minecraft.world.effect.MobEffects;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.animal.horse.Llama;
import net.minecraft.world.entity.monster.Enemy;
import net.minecraft.world.entity.monster.Monster;
Expand Down Expand Up @@ -55,6 +60,7 @@
import java.util.function.Predicate;
import java.util.stream.Collectors;

import static com.minecolonies.api.util.constant.Constants.TICKS_SECOND;
import static com.minecolonies.api.util.constant.TranslationConstants.PERMISSION_DENIED;

/**
Expand All @@ -70,7 +76,12 @@ public class ColonyPermissionEventHandler
/**
* The last time the player was notified about not having permission.
*/
private Map<UUID, Long> lastPlayerNotificationTick = new HashMap<>();
private final Map<UUID, Long> lastPlayerNotificationTick = new HashMap<>();

/**
* Number of attempts within a notif tick.
*/
private final Object2IntMap<UUID> playerAttempts = new Object2IntOpenHashMap<>();

/**
* Create this EventHandler.
Expand Down Expand Up @@ -173,11 +184,23 @@ private void cancelEvent(final Event event, @Nullable final Entity entity, final

final long worldTime = entity.level.getGameTime();
if (!lastPlayerNotificationTick.containsKey(entity.getUUID())
|| lastPlayerNotificationTick.get(entity.getUUID()) + (Constants.TICKS_SECOND * 10)
|| lastPlayerNotificationTick.get(entity.getUUID()) + (TICKS_SECOND * 10)
< worldTime)
{
MessageUtils.format(PERMISSION_DENIED).sendTo((Player) entity);
lastPlayerNotificationTick.put(entity.getUUID(), worldTime);
playerAttempts.put(entity.getUUID(), 0);
}
else
{
if (playerAttempts.compute(entity.getUUID(), (uuid, count) -> count == null ? 1 : count + 1) > 10)
{
if (entity instanceof LivingEntity living)
{
playerAttempts.put(entity.getUUID(), 0);
living.addEffect(new MobEffectInstance(MobEffects.LEVITATION, TICKS_SECOND * 10));
}
}
}
}
}
Expand Down Expand Up @@ -318,7 +341,8 @@ public void on(final PlayerInteractEvent event)
if (colony.isCoordInColony(event.getLevel(), event.getPos())
&& !(event instanceof PlayerInteractEvent.EntityInteract || event instanceof PlayerInteractEvent.EntityInteractSpecific))
{
final Block block = event.getLevel().getBlockState(event.getPos()).getBlock();
final BlockState state = event.getLevel().getBlockState(event.getPos());
final Block block = state.getBlock();

// Huts
if (event instanceof PlayerInteractEvent.RightClickBlock && block instanceof AbstractBlockHut
Expand All @@ -336,6 +360,11 @@ public void on(final PlayerInteractEvent event)
return;
}

if ((state.is(BlockTags.DOORS) || state.is(BlockTags.FENCE_GATES)) && perms.hasPermission(event.getEntity(), Action.ACCESS_TOGGLEABLES))
{
return;
}

if (MineColonies.getConfig().getServer().enableColonyProtection.get())
{
if (!perms.hasPermission(event.getEntity(), Action.RIGHTCLICK_BLOCK) && !(block instanceof AirBlock))
Expand Down Expand Up @@ -407,6 +436,11 @@ public void on(final PlayerInteractEvent.EntityInteract event)
return;
}

if (event.getEntity().getType().is(ModTags.freeToInteractWith))
{
return;
}

checkEventCancelation(Action.RIGHTCLICK_ENTITY, event.getEntity(), event.getLevel(), event, event.getPos());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ public class Permissions implements IPermissions
/**
* The current version of the permissions, increase upon changes to the preset permissions
*/
private static final int permissionsVersion = 4;
private static final int permissionsVersion = 5;

/**
* Saves the permissionMap with allowed actions.
Expand Down Expand Up @@ -172,9 +172,11 @@ private void loadRanks()
rank.addPermission(Action.ATTACK_CITIZEN);
rank.addPermission(Action.ATTACK_ENTITY);
rank.addPermission(Action.TELEPORT_TO_COLONY);
rank.addPermission(Action.ACCESS_TOGGLEABLES);
rank.addPermission(Action.MAP_BORDER);
case NEUTRAL:
rank.addPermission(Action.ACCESS_FREE_BLOCKS);
rank.addPermission(Action.ACCESS_TOGGLEABLES);
rank.addPermission(Action.MAP_BORDER);
break;
case HOSTILE:
Expand Down Expand Up @@ -216,7 +218,13 @@ private void upgradePermissions(final int version, final Rank rank)
this.setPermission(rank, Action.MAP_BORDER, true);
}

// if (version < 5) ...
if (version < 5)
{
if (!rank.isHostile())
{
this.setPermission(rank, Action.ACCESS_TOGGLEABLES, true);
}
}

// Fix bad saved values
if (rank == getRankOwner())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -718,6 +718,7 @@
"com.minecolonies.coremod.permission.attack_citizen": "Attack Citizens",
"com.minecolonies.coremod.permission.attack_entity": "Attack Entities",
"com.minecolonies.coremod.permission.access_free_blocks": "Access Free-Blocks",
"com.minecolonies.coremod.permission.access_toggleables": "Access Doors/Gates",
"com.minecolonies.coremod.permission.explode": "Explode",
"com.minecolonies.coremod.permission.hurt_citizen": "Hurt Citizen",
"com.minecolonies.coremod.permission.hurt_visitor": "Hurt Visitor",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"values": [
{
"id": "corpse:corpse",
"required": false
}
]
}