Skip to content

Commit

Permalink
Add synchronized, hopefully fix #31
Browse files Browse the repository at this point in the history
  • Loading branch information
democat3457 committed Nov 26, 2021
1 parent a0257b7 commit 11203ef
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ out
*.iws
*.iml
.idea
.vscode

# gradle
build
Expand Down
3 changes: 2 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ ext {
'Implementation-Title' : project.name,
'Implementation-Version' : "${version}",
'Implementation-Vendor' : 'Rebirth of the Night',
'Implementation-Timestamp': new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
'Implementation-Timestamp': new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"),
'FMLAT' : "onslaught_at.cfg"
]
]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public void onConstructionEvent(FMLConstructionEvent event) {

// --- MODULES ---

this.moduleManager.registerModules(ModuleOnslaught.class);
registerModule(ModuleOnslaught.class);

// --- POST ---

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public boolean hasCapability(@Nonnull Capability<?> capability, @Nullable EnumFa
return (capability == CapabilityAntiAir.INSTANCE);
}

@SuppressWarnings("unchecked")
@Nullable
@Override
public <T> T getCapability(@Nonnull Capability<T> capability, @Nullable EnumFacing facing) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,10 @@ public void removeTasks(EntityAITasks tasks) {
}
}

for (EntityAIBase entityAIBase : tasksToRemove) {
tasks.removeTask(entityAIBase);
synchronized (tasks.executingTaskEntries) {
for (EntityAIBase entityAIBase : tasksToRemove) {
tasks.removeTask(entityAIBase);
}
}
}
}
1 change: 1 addition & 0 deletions src/main/resources/META-INF/onslaught_at.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
public net.minecraft.entity.ai.EntityAITasks field_75780_b # executingTaskEntries

0 comments on commit 11203ef

Please sign in to comment.