Skip to content

Commit

Permalink
Removed HADS, was a pretty useless feature.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeryn99 committed Dec 19, 2023
1 parent d990e50 commit 760709a
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 115 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,23 +73,6 @@ public BlockEntity newBlockEntity(BlockPos blockPos, BlockState blockState) {
return new GlobalShellBlockEntity(blockPos, blockState);
}

@Override
public void onProjectileHit(Level level, BlockState blockState, BlockHitResult blockHitResult, Projectile projectile) {
super.onProjectileHit(level, blockState, blockHitResult, projectile);
if(level instanceof ServerLevel serverLevel){
TardisLevelOperator.get(serverLevel).ifPresent(tardisLevelOperator -> tardisLevelOperator.getTardisHADSManager().activateHads(serverLevel, blockHitResult.getBlockPos()));
}
}


@Override
public void wasExploded(Level level, BlockPos blockPos, Explosion explosion) {
if (level instanceof ServerLevel serverLevel) {
TardisLevelOperator.get(serverLevel).ifPresent(tardisLevelOperator -> tardisLevelOperator.getTardisHADSManager().activateHads(serverLevel, blockPos));
}
super.wasExploded(level, blockPos, explosion);
}

@Override
public InteractionResult use(BlockState blockState, Level level, BlockPos blockPos, Player player, InteractionHand interactionHand, BlockHitResult blockHitResult) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ public class TardisLevelOperator {
private final TardisFlightEventManager tardisFlightEventManager;
private final TardisClientData tardisClientData;
private final UpgradeHandler upgradeHandler;
private final TardisHADSManager tardisHADSManager;
private final AestheticHandler aestheticHandler;


public TardisLevelOperator(Level level) {
this.level = level;
this.exteriorManager = new TardisExteriorManager(this);
Expand All @@ -53,7 +53,6 @@ public TardisLevelOperator(Level level) {
this.tardisFlightEventManager = new TardisFlightEventManager(this);
this.tardisClientData = new TardisClientData(level.dimension());
this.upgradeHandler = new UpgradeHandler(this);
this.tardisHADSManager = new TardisHADSManager(this);
this.aestheticHandler = new AestheticHandler(this);
}

Expand All @@ -65,10 +64,6 @@ public TardisClientData tardisClientData() {
return tardisClientData;
}

public TardisHADSManager getTardisHADSManager() {
return tardisHADSManager;
}

public AestheticHandler getAestheticHandler() {
return aestheticHandler;
}
Expand All @@ -93,7 +88,6 @@ public CompoundTag serializeNBT() {
compoundTag = this.tardisWaypointManager.saveData(compoundTag);
compoundTag = this.tardisFlightEventManager.saveData(compoundTag);
compoundTag = this.upgradeHandler.saveData(compoundTag);
compoundTag = this.tardisHADSManager.saveData(compoundTag);
compoundTag = this.aestheticHandler.saveData(compoundTag);

return compoundTag;
Expand All @@ -116,7 +110,6 @@ public void deserializeNBT(CompoundTag tag) {
this.tardisFlightEventManager.loadData(tag);
this.tardisWaypointManager.loadData(tag);
this.upgradeHandler.loadData(tag);
this.tardisHADSManager.loadData(tag);
this.aestheticHandler.loadData(tag);
tardisClientData.sync();
}
Expand All @@ -129,7 +122,6 @@ public void tick(ServerLevel level) {
interiorManager.tick(level);
pilotingManager.tick(level);
tardisFlightEventManager.tick();
tardisHADSManager.tick();

var shouldSync = level.getGameTime() % 40 == 0;
if (shouldSync) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package whocraft.tardis_refined.common.notification;

import net.minecraft.resources.ResourceKey;
import net.minecraft.world.entity.player.Inventory;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.ItemStack;

import java.util.logging.Level;

public class NotifcationService {

This comment has been minimized.

Copy link
@50ap5ud5

50ap5ud5 Dec 20, 2023

Member

Typo of “Notification"


public static boolean canPlayerBeNotified(Player player, ResourceKey<Level> tardis) {
Inventory inventory = player.getInventory();
for (ItemStack item : inventory.items) {
if (item.getItem() instanceof NotifiableItem notifiableItem) {
if (notifiableItem.containsIntendedTardis(item, tardis)) {
return true;
}
}
}
return false;
}



}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package whocraft.tardis_refined.common.notification;

import net.minecraft.resources.ResourceKey;
import net.minecraft.server.MinecraftServer;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.ItemStack;

import java.util.logging.Level;

public interface NotifiableItem {

boolean containsIntendedTardis(ItemStack stack, ResourceKey<Level> tardis);

}

This file was deleted.

0 comments on commit 760709a

Please sign in to comment.