File tree Expand file tree Collapse file tree 3 files changed +46
-0
lines changed
src/main/java/com/github/clientcrash/graphicsmc/graphicsmc/renderers Expand file tree Collapse file tree 3 files changed +46
-0
lines changed Original file line number Diff line number Diff line change 5555 </build >
5656
5757 <repositories >
58+ <repository >
59+ <id >central</id >
60+ <name >Maven Central</name >
61+ <layout >default</layout >
62+ <url >https://repo1.maven.org/maven2</url >
63+ <snapshots >
64+ <enabled >false</enabled >
65+ </snapshots >
66+ </repository >
5867 <repository >
5968 <id >dmulloy2-repo</id >
6069 <url >https://repo.dmulloy2.net/repository/public/</url >
7079 </repositories >
7180
7281 <dependencies >
82+ <dependency >
83+ <groupId >com.github.sarxos</groupId >
84+ <artifactId >webcam-capture</artifactId >
85+ <version >0.3.12</version >
86+ </dependency >
7387 <dependency >
7488 <groupId >org.spigotmc</groupId >
7589 <artifactId >spigot-api</artifactId >
Original file line number Diff line number Diff line change 11# GRAPHICS MC
22* GMC*
33## GraphicsMC is a plugin for rendering images and other things on maps.
4+ ### This plugin has commands and can be used on its own, but it is intended to be used as a lib. Solo use is only recommended for testing.
45### Commands
56` /gmcmode <MODE> `
67Change the gmc mode to :
Original file line number Diff line number Diff line change 1+ package com .github .clientcrash .graphicsmc .graphicsmc .renderers ;
2+
3+ import org .bukkit .entity .Player ;
4+ import org .bukkit .map .MapCanvas ;
5+ import org .bukkit .map .MapRenderer ;
6+ import org .bukkit .map .MapView ;
7+
8+ import java .awt .image .BufferedImage ;
9+
10+ public class SmoothVideoRender extends MapRenderer {
11+ BufferedImage [] frames ;
12+ int currentIndex = 0 ;
13+ int ticksBetweenFrames = 0 ;
14+ public SmoothVideoRender (BufferedImage [] frames ,int startindex ,int ticksBetweenFrames ){
15+ this .frames = frames ;
16+ this .currentIndex = startindex ;
17+ this .ticksBetweenFrames = ticksBetweenFrames ;
18+ }
19+ int currentTick = 0 ;
20+ @ Override
21+ public void render (MapView map , MapCanvas canvas , Player player ) {
22+ if (currentTick < ticksBetweenFrames ){
23+ currentTick ++;
24+ }else {
25+ currentTick =0 ;
26+ currentIndex ++;
27+ }
28+ if (currentIndex +1 >= frames .length ){currentIndex = 0 ;}
29+ canvas .drawImage (0 ,0 , frames [currentIndex ]);
30+ }
31+ }
You can’t perform that action at this time.
0 commit comments