Skip to content

Commit

Permalink
- Fixed the game breaking itself over Maven dates??
Browse files Browse the repository at this point in the history
- Bulkhead Doors can no longer be used to nuke walls
  • Loading branch information
Jeryn99 committed Dec 18, 2023
1 parent a9383b0 commit 8761933
Show file tree
Hide file tree
Showing 8 changed files with 50 additions and 46 deletions.
18 changes: 10 additions & 8 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,21 @@ subprojects {
minecraft "com.mojang:minecraft:${rootProject.minecraft_version}"
mappings loom.layered() {
officialMojangMappings()
// parchment("org.parchmentmc.data:parchment-${rootProject.mappings}")
// parchment("org.parchmentmc.data:parchment-${rootProject.mappings}")
}
implementation group: 'com.google.code.findbugs', name: 'jsr305', version: '3.0.2'
}
}

def getTimestamp() {
def timestamp = java.time.Instant.now()
def formatter = java.time.format.DateTimeFormatter.ofPattern("dd_MM_yy_HHmm")
return "[" + timestamp.atZone(java.time.ZoneId.systemDefault()).format(formatter) + "]"
def gitHash = { ->
def stdout = new ByteArrayOutputStream()
exec {
commandLine 'git', 'rev-parse', '--short', 'HEAD'
standardOutput = stdout
}
return stdout.toString().trim()
}


def gitBranch() {
def branch = ""
def proc = "git rev-parse --abbrev-ref HEAD".execute()
Expand All @@ -48,7 +50,7 @@ allprojects {
apply plugin: "maven-publish"

archivesBaseName = rootProject.jar_name
version = "${rootProject.minecraft_version}-${rootProject.mod_version}-${getTimestamp()}-${gitBranch()}"
version = "${rootProject.minecraft_version}-${rootProject.mod_version}-${gitHash()}-${gitBranch()}"
group = rootProject.maven_group

repositories {
Expand Down Expand Up @@ -78,4 +80,4 @@ allprojects {
java {
withSourcesJar()
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.context.BlockPlaceContext;
import net.minecraft.world.level.BlockGetter;
Expand Down Expand Up @@ -30,7 +31,7 @@ public class BulkHeadDoorBlock extends BaseEntityBlock {
public static final BooleanProperty LOCKED = BooleanProperty.create("locked");

public BulkHeadDoorBlock(Properties properties) {
super(properties.sound(SoundType.ANVIL).offsetType(OffsetType.XZ));
super(properties.sound(SoundType.ANVIL));

this.registerDefaultState(this.stateDefinition.any().setValue(FACING, Direction.NORTH).setValue(OPEN, false).setValue(LOCKED, true));
}
Expand Down Expand Up @@ -66,8 +67,6 @@ public BlockEntity newBlockEntity(BlockPos blockPos, BlockState blockState) {
public void onPlace(BlockState blockState, Level level, BlockPos blockPos, BlockState blockState2, boolean bl) {
super.onPlace(blockState, level, blockPos, blockState2, bl);

if(!canSurvive(blockState, level, blockPos)) return;

if (blockState.getValue(OPEN)) {
changeBlockStates(level, blockPos, blockState, Blocks.AIR.defaultBlockState());
} else {
Expand All @@ -76,13 +75,17 @@ public void onPlace(BlockState blockState, Level level, BlockPos blockPos, Block
}


@Override
public void playerDestroy(Level level, Player player, BlockPos blockPos, BlockState blockState, @Nullable BlockEntity blockEntity, ItemStack itemStack) {
super.playerDestroy(level, player, blockPos, blockState, blockEntity, itemStack);
destroy(level, blockPos, blockState);
}

@Override
public void destroy(LevelAccessor levelAccessor, BlockPos blockPos, BlockState blockState) {
super.destroy(levelAccessor, blockPos, blockState);

if(blockState.is(this) && canSurvive(blockState, levelAccessor, blockPos)) {
changeBlockStates((Level) levelAccessor, blockPos, blockState, Blocks.AIR.defaultBlockState());
}
changeBlockStates((Level) levelAccessor, blockPos, blockState, Blocks.AIR.defaultBlockState());
}

private void changeBlockStates(Level level, BlockPos blockPos, BlockState blockState, BlockState blockToSet) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@

import com.mojang.serialization.Codec;
import dev.architectury.injectables.annotations.ExpectPlatform;
import net.minecraft.core.Holder;
import net.minecraft.core.Registry;
import net.minecraft.resources.ResourceKey;
import whocraft.tardis_refined.TardisRefined;

import java.util.Collection;
import java.util.function.Supplier;

/** Abstraction of a Registry handler based off the design patterns of Forge's DeferredRegister. */
Expand All @@ -32,7 +31,7 @@ public abstract class DeferredRegistry<T> {
*/
@ExpectPlatform
public static <T> DeferredRegistry<T> create(String modid, ResourceKey<? extends Registry<T>> resourceKey) {
throw new AssertionError();
throw new RuntimeException(TardisRefined.PLATFORM_ERROR);
}

/** Gets the underlying Codec for the registry object type, if defined. Currently unused and untested, but added for completeness*/
Expand Down
1 change: 0 additions & 1 deletion common/src/main/resources/tardis_refined.accesswidener
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,3 @@ accessible method net/minecraft/server/MinecraftServer wrapRunnable (Ljava/lang/
accessible field net/minecraft/server/level/ServerLevel dragonFight Lnet/minecraft/world/level/dimension/end/EndDragonFight;
accessible method net/minecraft/client/particle/SuspendedParticle <init> (Lnet/minecraft/client/multiplayer/ClientLevel;Lnet/minecraft/client/particle/SpriteSet;DDDDDD)V
accessible field net/minecraft/client/particle/Particle gravity F
accessible field net/minecraft/client/resources/sounds/AbstractSoundInstance sound Lnet/minecraft/client/resources/sounds/Sound;
43 changes: 22 additions & 21 deletions fabric/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -86,24 +86,24 @@ dependencies {
modImplementation ("com.github.iPortalTeam.ImmersivePortalsMod:q_misc_util:v4.0.3-mc1.20.2")
modImplementation ("com.github.iPortalTeam.ImmersivePortalsMod:build:v4.0.3-mc1.20.2")

/* // If working on Immersive Portals, change modCompileOnlyApi to modImplementation for the following two entries, this will enable Immersive Portals in Dev
modCompileOnlyApi("com.github.iPortalTeam.ImmersivePortalsMod:imm_ptl_core:${rootProject.immersive_portals_version}") {
exclude(group: "net.fabricmc.fabric-api")
transitive(false)
}
modCompileOnlyApi("com.github.iPortalTeam.ImmersivePortalsMod:q_misc_util:${rootProject.immersive_portals_version}") {
exclude(group: "net.fabricmc.fabric-api")
transitive(false)
}
//Immersive Portals Dependency, not listed on their repo but required for 1.19+ versions
modCompileOnlyApi("com.github.LlamaLad7:MixinExtras:${rootProject.mixin_extras_version}") {
exclude(group: "net.fabricmc.fabric-api")
transitive(false)
}
//Immersive Portals Dependency, not listed on their repo but required for 1.19+ versions
modCompileOnlyApi("me.shedaniel.cloth:cloth-config-fabric:${rootProject.cloth_config_fabric_version}") {
exclude(group: "net.fabricmc.fabric-api")
}*/
/* // If working on Immersive Portals, change modCompileOnlyApi to modImplementation for the following two entries, this will enable Immersive Portals in Dev
modCompileOnlyApi("com.github.iPortalTeam.ImmersivePortalsMod:imm_ptl_core:${rootProject.immersive_portals_version}") {
exclude(group: "net.fabricmc.fabric-api")
transitive(false)
}
modCompileOnlyApi("com.github.iPortalTeam.ImmersivePortalsMod:q_misc_util:${rootProject.immersive_portals_version}") {
exclude(group: "net.fabricmc.fabric-api")
transitive(false)
}
//Immersive Portals Dependency, not listed on their repo but required for 1.19+ versions
modCompileOnlyApi("com.github.LlamaLad7:MixinExtras:${rootProject.mixin_extras_version}") {
exclude(group: "net.fabricmc.fabric-api")
transitive(false)
}
//Immersive Portals Dependency, not listed on their repo but required for 1.19+ versions
modCompileOnlyApi("me.shedaniel.cloth:cloth-config-fabric:${rootProject.cloth_config_fabric_version}") {
exclude(group: "net.fabricmc.fabric-api")
}*/

// Immersive Portals End

Expand Down Expand Up @@ -182,11 +182,12 @@ publishing {

repositories {
maven {
url = project.findProperty("maven_repo_url") ?: "https://maven.craig.software/repository/whocraft/"
url = project.findProperty("maven_repo_url") ?: "http://craig.software:8081/repository/whocraft/"
credentials {
username = project.findProperty("MAVEN_REPO_USERNAME") ?: System.getenv("MAVEN_REPO_USERNAME") ?: ""
password = project.findProperty("MAVEN_REPO_PASSWORD") ?: System.getenv("MAVEN_REPO_PASSWORD") ?: ""
username = System.getenv("MAVEN_REPO_USERNAME")
password = System.getenv("MAVEN_REPO_PASSWORD")
}
allowInsecureProtocol = true
}
}
}
8 changes: 4 additions & 4 deletions forge/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -155,13 +155,13 @@ publishing {

repositories {
maven {
url = project.findProperty("maven_repo_url") ?: "https://maven.craig.software/repository/whocraft/"
url = project.findProperty("maven_repo_url") ?: "http://craig.software:8081/repository/whocraft/"
credentials {
username = project.findProperty("MAVEN_REPO_USERNAME") ?: System.getenv("MAVEN_REPO_USERNAME") ?: ""
password = project.findProperty("MAVEN_REPO_PASSWORD") ?: System.getenv("MAVEN_REPO_PASSWORD") ?: ""
username = System.getenv("MAVEN_REPO_USERNAME")
password = System.getenv("MAVEN_REPO_PASSWORD")
}
allowInsecureProtocol = true
}
}
}


Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// 1.20.2 2023-12-10T20:38:52.4743381 Shell Patterns
// 1.20.2 2023-12-18T17:52:51.3188952 Shell Patterns
24c3b07d5ebcb921f1a4014c0c7b7ce1db66d291 data/tardis_refined/tardis_refined/patterns/shell/big_ben.json
c023593375b56bf2ba50df33b355f0f99d062227 data/tardis_refined/tardis_refined/patterns/shell/briefcase.json
0c683f48298e8e97709fa8f659a659440e35dc61 data/tardis_refined/tardis_refined/patterns/shell/castle.json
Expand All @@ -12,7 +12,7 @@ a033e392d5ce58b74e9dd2561b2a3012b49525d2 data/tardis_refined/tardis_refined/patt
9636dacb9cae8d3d893a7f9bfca195631397973b data/tardis_refined/tardis_refined/patterns/shell/nuka.json
bb9b537f1b29c2414d9284828094163a425bcd70 data/tardis_refined/tardis_refined/patterns/shell/pagoda.json
9acf33da121ce7c83457b3d85c0a92d5ba511efd data/tardis_refined/tardis_refined/patterns/shell/phone_booth.json
67d26906e3655e7f9f08a906b56b225f71248726 data/tardis_refined/tardis_refined/patterns/shell/police_box.json
d137e095ef4d32650e62dc8cba9a8abdb6634ef2 data/tardis_refined/tardis_refined/patterns/shell/police_box.json
ba4b42fe3655f24a4263e59b614b0644229730a8 data/tardis_refined/tardis_refined/patterns/shell/portaloo.json
fdc997718013ffac35fe5192e0fbf32b60323720 data/tardis_refined/tardis_refined/patterns/shell/present.json
23066a16183502e0751e16f152356bde64f17045 data/tardis_refined/tardis_refined/patterns/shell/vending.json
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
org.gradle.jvmargs=-Xmx4G

##Mod Building and Metadata
jar_name=TARDIS Refined
jar_name=tardis_refined
mod_name=TARDIS Refined
mod_id=tardis_refined
maven_group=whocraft
Expand Down

0 comments on commit 8761933

Please sign in to comment.