forked from jcm236/Starlance
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/main'
# Conflicts: # src/main/java/net/jcm/vsch/util/VSCHUtils.java
- Loading branch information
Showing
15 changed files
with
126 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package net.jcm.vsch.blocks.custom; | ||
|
||
import net.jcm.vsch.blocks.entity.DockerBlockEntity; | ||
import net.minecraft.core.BlockPos; | ||
import net.minecraft.world.level.Level; | ||
import net.minecraft.world.level.block.Block; | ||
import net.minecraft.world.level.block.EntityBlock; | ||
import net.minecraft.world.level.block.entity.BlockEntity; | ||
import net.minecraft.world.level.block.entity.BlockEntityTicker; | ||
import net.minecraft.world.level.block.entity.BlockEntityType; | ||
import net.minecraft.world.level.block.state.BlockState; | ||
import org.jetbrains.annotations.Nullable; | ||
|
||
public class DockerBlock extends Block implements EntityBlock { | ||
public DockerBlock(Properties properties) { | ||
super(properties); | ||
} | ||
|
||
@Override | ||
public @Nullable BlockEntity newBlockEntity(BlockPos blockPos, BlockState blockState) { | ||
return new DockerBlockEntity(blockPos,blockState); | ||
} | ||
|
||
@Override | ||
public @Nullable <T extends BlockEntity> BlockEntityTicker<T> getTicker(Level level, BlockState state, BlockEntityType<T> type) { | ||
return level.isClientSide() ? ((level0, pos0, state0, be) -> ((DockerBlockEntity) be).clientTick(level0, pos0, state0, (DockerBlockEntity) be)) : ((level0, pos0, state0, be) -> ((DockerBlockEntity) be).serverTick(level0, pos0, state0, (DockerBlockEntity) be)); | ||
} | ||
} |
5 changes: 1 addition & 4 deletions
5
src/main/java/net/jcm/vsch/blocks/custom/template/AbstractThrusterBlock.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/main/java/net/jcm/vsch/blocks/entity/AirThrusterBlockEntity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
src/main/java/net/jcm/vsch/blocks/entity/DockerBlockEntity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package net.jcm.vsch.blocks.entity; | ||
|
||
import net.jcm.vsch.blocks.entity.template.ParticleBlockEntity; | ||
import net.minecraft.core.BlockPos; | ||
import net.minecraft.world.level.ClipContext; | ||
import net.minecraft.world.level.Level; | ||
import net.minecraft.world.level.block.entity.BlockEntity; | ||
import net.minecraft.world.level.block.entity.BlockEntityType; | ||
import net.minecraft.world.level.block.state.BlockState; | ||
import net.minecraft.world.phys.HitResult; | ||
import net.minecraft.world.phys.Vec3; | ||
|
||
public class DockerBlockEntity extends BlockEntity{ | ||
|
||
public DockerBlockEntity(BlockPos pPos, BlockState pBlockState) { | ||
super(VSCHBlockEntities.DOCKER_BLOCK_ENTITY.get(), pPos, pBlockState); | ||
} | ||
|
||
public void clientTick(Level level, BlockPos pos, BlockState state, DockerBlockEntity be) { | ||
|
||
} | ||
|
||
public void serverTick(Level level, BlockPos pos, BlockState state, DockerBlockEntity be) { | ||
HitResult hitResult = level.clip(new ClipContext(pos.getCenter(),pos.getCenter().add(new Vec3(0,10,0)),ClipContext.Block.COLLIDER,ClipContext.Fluid.NONE,null)); | ||
System.out.println(hitResult); | ||
} | ||
} |
3 changes: 1 addition & 2 deletions
3
src/main/java/net/jcm/vsch/blocks/entity/GravityInducerBlockEntity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 0 additions & 41 deletions
41
src/main/java/net/jcm/vsch/blocks/entity/ParticleBlockEntity.java
This file was deleted.
Oops, something went wrong.
1 change: 1 addition & 0 deletions
1
src/main/java/net/jcm/vsch/blocks/entity/PowerfulThrusterBlockEntity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
src/main/java/net/jcm/vsch/blocks/entity/ThrusterBlockEntity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...s/entity/AbstractThrusterBlockEntity.java → ...template/AbstractThrusterBlockEntity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
src/main/java/net/jcm/vsch/blocks/entity/template/ParticleBlockEntity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package net.jcm.vsch.blocks.entity.template; | ||
|
||
import net.minecraft.core.BlockPos; | ||
import net.minecraft.server.level.ServerLevel; | ||
import net.minecraft.world.level.Level; | ||
import net.minecraft.world.level.block.state.BlockState; | ||
|
||
public interface ParticleBlockEntity { | ||
|
||
default void clientTick(Level level, BlockPos pos, BlockState state, ParticleBlockEntity be) { | ||
tickParticles(level, pos, state); | ||
} | ||
|
||
default void serverTick(Level level, BlockPos pos, BlockState state, ParticleBlockEntity be) { | ||
if (level instanceof ServerLevel) { | ||
tickForce(level, pos, state); | ||
} | ||
} | ||
|
||
void tickForce(Level level, BlockPos pos, BlockState state); | ||
|
||
void tickParticles(Level level, BlockPos pos, BlockState state); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
src/main/java/net/jcm/vsch/mixin/MixinAerialLightRenderer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package net.jcm.vsch.mixin; | ||
|
||
import net.lointain.cosmos.procedures.AerialLightRenderer; | ||
import net.minecraftforge.fml.loading.FMLEnvironment; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.ModifyVariable; | ||
|
||
@Mixin(AerialLightRenderer.class) | ||
public abstract class MixinAerialLightRenderer { | ||
|
||
// getPrivateField fails when Cosmos is de-obfuscated in a dev enviroment, so this is here to stop that | ||
@ModifyVariable(method = "getPrivateField", at = @At("HEAD"), argsOnly = true) | ||
private static String fixFieldName(String fieldName) { | ||
|
||
// Check if we are dev enviroment or obf enviroment | ||
if (!FMLEnvironment.production) { | ||
if (fieldName.equals("f_110009_")) { | ||
return "passes"; | ||
} | ||
if (fieldName.equals("f_110054_")) { | ||
return "effect"; | ||
} | ||
} | ||
|
||
return fieldName; | ||
} | ||
|
||
} |