generated from NeoForgeMDKs/MDK-1.21-NeoGradle
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f7f1b6f
commit 2e0bab5
Showing
10 changed files
with
95 additions
and
17 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
19 changes: 19 additions & 0 deletions
19
src/main/java/com/leclowndu93150/carbort/content/items/ShrinkinatorItem.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,19 @@ | ||
package com.leclowndu93150.carbort.content.items; | ||
|
||
import com.leclowndu93150.carbort.api.items.SimpleEnergyItem; | ||
|
||
public class ShrinkinatorItem extends SimpleEnergyItem { | ||
public ShrinkinatorItem(Properties properties) { | ||
super(properties); | ||
} | ||
|
||
@Override | ||
public int getEnergyUsage() { | ||
return 0; | ||
} | ||
|
||
@Override | ||
public int getCapacity() { | ||
return 1000; | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
src/main/java/com/leclowndu93150/carbort/events/ClientCarbortEvents.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,24 @@ | ||
package com.leclowndu93150.carbort.events; | ||
|
||
import com.leclowndu93150.carbort.Carbort; | ||
import com.leclowndu93150.carbort.mixins.CameraMixin; | ||
import net.minecraft.client.Camera; | ||
import net.minecraft.client.Minecraft; | ||
import net.minecraft.util.RandomSource; | ||
import net.neoforged.api.distmarker.Dist; | ||
import net.neoforged.bus.api.SubscribeEvent; | ||
import net.neoforged.fml.common.EventBusSubscriber; | ||
import net.neoforged.neoforge.client.event.RenderLevelStageEvent; | ||
|
||
@EventBusSubscriber(modid = Carbort.MODID, value = Dist.CLIENT) | ||
public class ClientCarbortEvents { | ||
@SubscribeEvent | ||
public static void renderLevel(RenderLevelStageEvent event) { | ||
if (event.getStage() == RenderLevelStageEvent.Stage.AFTER_ENTITIES) { | ||
Camera camera = event.getCamera(); | ||
CameraMixin camera1 = (CameraMixin) camera; | ||
RandomSource randomSource = Minecraft.getInstance().player.getRandom(); | ||
camera1.callSetRotation(camera.getYRot()+ randomSource.nextInt(5), camera.getXRot() + randomSource.nextInt(5), 5); | ||
} | ||
} | ||
} |
16 changes: 1 addition & 15 deletions
16
...du93150/carbort/events/CarbortEvents.java → ...0/carbort/events/CommonCarbortEvents.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
14 changes: 14 additions & 0 deletions
14
src/main/java/com/leclowndu93150/carbort/mixins/CameraMixin.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,14 @@ | ||
package com.leclowndu93150.carbort.mixins; | ||
|
||
import net.minecraft.client.Camera; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.gen.Invoker; | ||
|
||
@Mixin(Camera.class) | ||
public interface CameraMixin { | ||
@Invoker | ||
void callSetRotation(float yRot, float xRot, float roll); | ||
|
||
@Invoker | ||
void callSetPosition(double x, double y, double z); | ||
} |
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
24 changes: 24 additions & 0 deletions
24
src/main/java/com/leclowndu93150/carbort/utils/ClientUtils.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,24 @@ | ||
package com.leclowndu93150.carbort.utils; | ||
|
||
import com.leclowndu93150.carbort.mixins.CameraMixin; | ||
import net.minecraft.client.Camera; | ||
import net.minecraft.client.Minecraft; | ||
import net.minecraft.core.BlockPos; | ||
import net.minecraft.util.RandomSource; | ||
import net.minecraft.world.level.block.state.BlockState; | ||
import net.neoforged.neoforge.client.event.RenderLevelStageEvent; | ||
import net.neoforged.neoforge.client.event.RenderPlayerEvent; | ||
|
||
public class ClientUtils { | ||
public static void spawnBreakParticles(BlockPos pos, BlockState state) { | ||
Minecraft.getInstance().particleEngine.destroy(pos, state); | ||
} | ||
|
||
public static void shakeCamera() { | ||
Minecraft minecraft = Minecraft.getInstance(); | ||
Camera camera = minecraft.getEntityRenderDispatcher().camera; | ||
CameraMixin cameraMixin = (CameraMixin) camera; | ||
RandomSource random = minecraft.player.getRandom(); | ||
cameraMixin.callSetPosition(0, 10, 0); | ||
} | ||
} |
Binary file modified
BIN
+10 Bytes
(100%)
src/main/resources/assets/carbort/textures/item/deepsteal_ingot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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